Skip to content

feat(condensed): add condensed view support for Feature Module components#161

Merged
garrity-miepub merged 18 commits into
mainfrom
feature/condensed-view-feature-modules
Apr 6, 2026
Merged

feat(condensed): add condensed view support for Feature Module components#161
garrity-miepub merged 18 commits into
mainfrom
feature/condensed-view-feature-modules

Conversation

@garrity-miepub

@garrity-miepub garrity-miepub commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add condensed view support (data-slot attributes + condensed CSS overrides) to multiple Feature Module components:

AI Components

  • AIChat.tsx — 10 data-slots: chat container, header, messages, input, suggestions, empty state
  • AIChatModal.tsx — 3 data-slots: trigger button, modal, notification badge
  • AIMessage.tsx — 7 data-slots: message, avatar, bubble, thinking, code, typing indicator, timestamp
  • MCPToolCall.tsx — 6 data-slots: tool call, icon, status, content, result, parameters

CheckrIntegration

  • CheckrIntegration.tsx — 11 data-slots covering reports card, status badges, table, actions, not-connected state
  • Also fixes an infinite re-render loop when reports=[] (default) by using a functional state update

Dashboard

  • Dashboard.stories.tsx — Refactored inline hand-rolled sidebar to use library Sidebar components (which already have data-slots + condensed CSS)

EmployeeProfile

  • EmployeeProfileCard — 9 data-slots: card, header, avatar, photo-edit, name, title, toggle, details, detail-row
  • OrderSidebarTabs — 2 data-slots: tabs container, tab button
  • OrderDetailSidebar — 3 data-slots: sidebar root, profile wrapper, content area

ErrorPage

  • ErrorPage — 8 data-slots: page root, illustration, code, title, description, actions, children, details
  • ServerErrorPage — error details section with collapsible styling
  • Action <a> tags styled to match the global Button condensed dimensions

LoadingPage

  • LoadingPage — 14 data-slots: loading-page, loading-page-indicator, loading-page-message, loading-page-submessage, loading-overlay, loading-overlay-backdrop, loading-overlay-message, loading-dots, loading-bar, loading-bar-track, loading-bar-percentage, loading-skeleton, card-skeleton, pulse-indicator

OnboardingWizard

  • OnboardingWizard — 17 data-slots across OnboardingWizard, OnboardingStepQuestion, and OnboardingCompletion components
  • Story preview container reduced from 700px to 350px in condensed mode

OrderList

  • OrderList — 12 data-slots: order-list, order-list-header, order-list-tabs, order-list-tab, order-list-tab-count, order-list-actions, order-list-search, order-list-body, order-list-loading, order-list-empty, order-list-empty-message, order-list-items
  • Item-level condensed CSS targets consumer-rendered order items via parent slot selectors

PaymentMethod

  • PaymentMethodCard — 6 data-slots: payment-card, payment-card-header, payment-card-label, payment-card-badge, payment-card-details, payment-card-footer
  • PaymentMethodBank — 5 data-slots: payment-bank, payment-bank-header, payment-bank-label, payment-bank-details, payment-bank-footer
  • PaymentMethodList — 3 data-slots: payment-list, payment-list-empty, payment-list-empty-title, payment-list-empty-message

ProductVersion

  • ProductVersion — 5 data-slots: product-version (wrapper), product-version-minimal, product-version-stacked, product-version-inline, product-version-env
  • ProductVersionBadge — 1 data-slot: product-version-badge

ServiceGeneralSettings

  • ServiceGeneralSettings — 10 data-slots: service-settings, service-settings-header, service-settings-title, service-settings-description, service-settings-content, service-settings-error, service-settings-toggles, service-settings-basic, service-settings-pricing, service-settings-billing, service-settings-section-label, service-settings-actions
  • Textarea uses min-height/max-height for condensed sizing; "days" suffix repositioned next to number in turnaround field

ServiceShippingSettings

  • ServiceShippingSettings — 10 data-slots: shipping-settings, shipping-settings-header, shipping-settings-title, shipping-settings-description, shipping-settings-content, shipping-settings-kit-toggle, shipping-settings-address, shipping-settings-section-label, shipping-settings-instructions, shipping-settings-actions
  • Textarea uses min-height/max-height; address grid gap tightened in condensed mode

CSS

~1600 lines of condensed overrides in condensed-view.css covering all the above components.

- AIChat: data-slots on root, header, header-icon, messages, input,
  suggestions container/buttons, empty state icon
- AIChatModal: data-slots on trigger button and modal container
- AIMessage: data-slots on message wrapper, avatar, bubble, thinking
  block, code block, typing indicator, timestamp
- MCPToolCall: data-slots on tool call container, tool icon, status
  icon, content, result section, parameters section
- Condensed CSS: ~330 lines covering all AI sub-components with
  smaller padding, fonts, icons, gaps, and avatar collapse to sm
Copilot AI review requested due to automatic review settings April 2, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds condensed-density support for the AI chat UI by introducing data-slot hooks on AI components and providing corresponding overrides in condensed-view.css, aligning AI components with the repo’s existing condensed styling approach.

Changes:

  • Added data-slot attributes across AIChat, AIChatModal, AIMessage, and MCPToolCall sub-elements to enable stable condensed-mode targeting.
  • Added condensed CSS overrides for AI component layout/typography (header, messages, input, suggested actions, empty state, tool call UI).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/styles/condensed-view.css Adds condensed overrides for AIChat/AIMessage/MCPToolCall/AIChatModal UI elements.
src/components/AI/MCPToolCall.tsx Adds data-slot hooks for tool call container, icon, status icon, content, result, and parameters.
src/components/AI/AIMessage.tsx Adds data-slot hooks for message wrapper, avatar, bubble, thinking block, code block, typing indicator, and timestamp.
src/components/AI/AIChatModal.tsx Adds data-slot hooks for the floating trigger and modal container.
src/components/AI/AIChat.tsx Adds data-slot hooks for chat root, header, header icon, messages area, input area, and suggestions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
Comment thread src/styles/condensed-view.css Outdated
Comment thread src/styles/condensed-view.css Outdated
Comment thread src/styles/condensed-view.css Outdated
The badge selector (> span:first-child) was incorrectly targeting
the pulse animation span instead of the notification badge. Changed
to target the badge via its positioning classes (.-top-1.-right-1).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 2, 2026

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2812ecf
Status: ✅  Deploy successful!
Preview URL: https://c9196df9.ui-6d0.pages.dev
Branch Preview URL: https://feature-condensed-view-featu.ui-6d0.pages.dev

View logs

1. Badge selector: added data-slot='ai-chat-trigger-badge' instead of
   fragile class-based or positional selectors
2. Header button padding: scoped compact padding to icon-only buttons
   via data-slot='ai-chat-header-action', preserving Stop button sizing
3. Brittle .px-4 selector: removed, moved padding to existing
   ai-chat-suggestions data-slot
4. Broad span selector: scoped to > .flex > span to target only the
   status line, avoiding conflict with parameter text
Copilot AI review requested due to automatic review settings April 2, 2026 23:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css Outdated
Comment thread src/styles/condensed-view.css Outdated
1. Suggestions double-padding: added data-slot='ai-chat-input-suggestions'
   on the wrapper div; ai-chat-suggestions now only controls gap, wrapper
   controls padding — no cumulative padding across contexts
2. Tool error selector: expanded to cover ToolResultDisplay error classes
   (bg-red-50, dark:bg-red-900/20) in addition to top-level error block
- 11 data-slots: checkr-integration, checkr-header, checkr-header-icon,
  checkr-error, checkr-status-summary, checkr-actions, checkr-reports-card,
  checkr-reports-header, checkr-report-row, checkr-reports-footer,
  checkr-empty-state, checkr-not-connected
- Condensed CSS: smaller header icon/title, tighter report rows,
  smaller checkboxes/badges, compact status summary dots, reduced
  padding on card sections, smaller empty/disconnected states
Copilot AI review requested due to automatic review settings April 3, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
…state

useEffect was calling setSelectedReports(new Set()) unconditionally,
but when reports=[] (default), every render creates a new array ref
that re-triggers the effect. The new Set() also creates a new ref,
causing another render → infinite loop.

Fix: use functional update that only creates a new Set when the
previous one had items (prev.size > 0), returning the same ref
otherwise to break the cycle.
…onent

The Dashboard story had a hand-rolled Sidebar function with raw HTML
that didn't use data-slot attributes, so condensed view had no effect.

Replaced with the library's Sidebar, SidebarHeader, SidebarContent,
SidebarNav, SidebarNavItem, SidebarFooter components which already
have data-slots and condensed CSS support.

Also wraps AppShell in SidebarProvider and replaces the manual
hamburger button with SidebarMobileToggle.
Copilot AI review requested due to automatic review settings April 3, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/components/Dashboard/Dashboard.stories.tsx:75

  • This PR is described as adding condensed-view support for AI components, but this file also refactors the Dashboard story shell to use the shared Sidebar/SidebarProvider components. If this change is intentional, please update the PR description/scope (or split into a separate PR) so reviewers can track why the Dashboard story is being modified here.
import {
  Sidebar as SidebarComponent,
  SidebarHeader,
  SidebarContent,
  SidebarNav,
  SidebarNavItem,
  SidebarFooter,
  SidebarMobileToggle,
} from '../Sidebar';
import { SidebarProvider } from '../Sidebar/SidebarProvider';

// ============================================================================
// Meta
// ============================================================================

const meta: Meta = {
  title: 'Product/Feature Modules/Dashboard',
  parameters: {
    layout: 'fullscreen',

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Dashboard/Dashboard.stories.tsx Outdated
Comment thread src/styles/condensed-view.css
…ider import

Add data-slot attributes and condensed CSS overrides for:
- EmployeeProfileCard (avatar, name, title, details, toggle)
- OrderSidebarTabs (tabs, tab buttons)
- OrderDetailSidebar (sidebar layout, content area)

Fix Dashboard story to import SidebarProvider from the barrel
'../Sidebar' instead of the deep path '../Sidebar/SidebarProvider'.
@garrity-miepub garrity-miepub changed the title feat(condensed): add condensed view support for AI components feat(condensed): add condensed view support for Feature Module components Apr 3, 2026
Add data-slot attributes to ErrorPage, ServerErrorPage, and ActionButton.
Add ~100 lines of condensed CSS for smaller illustrations, error codes,
titles, descriptions, action buttons, and error details.

Fix: target <a> action buttons via parent selector since Button component
hardcodes data-slot='button', overriding any custom data-slot. Mirror the
global button condensed dimensions on the <a> tags for visual consistency.
Copilot AI review requested due to automatic review settings April 3, 2026 01:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
Comment thread src/styles/condensed-view.css
Comment thread src/styles/condensed-view.css Outdated
Add data-slot='order-sidebar-profile' to the profile wrapper in
OrderDetailSidebar and update condensed CSS to target it directly
instead of coupling to the Tailwind .px-3 utility class.
Add data-slot attributes and condensed CSS overrides for:
- LoadingPage (root, indicator, message, sub-message)
- LoadingOverlay (root, backdrop, message)
- LoadingDots (container, dots)
- LoadingBar (root, track, percentage)
- LoadingSkeleton (items)
- CardSkeleton (root, inner skeletons)
- PulseIndicator (root)
Copilot AI review requested due to automatic review settings April 6, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
- Add 17 data-slot attributes across OnboardingWizard, OnboardingStepQuestion,
  and OnboardingCompletion components
- Add ~100 lines of condensed CSS covering header, loading, content, footer,
  step question, and completion sections
- Reduce story preview container from 700px to 350px in condensed mode
Add scoped min-width: 100px rule for [data-slot='button'] inside
error-page-actions to match the <a> variant, preventing inconsistent
widths in mixed action rows.
Copilot AI review requested due to automatic review settings April 6, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
- Add 12 data-slot attributes covering tabs, search, actions, loading,
  empty state, and items container
- Add ~95 lines of condensed CSS including order item text/padding reduction
- All 7 items now visible on screen in condensed mode vs ~5 in default
- Add 14 data-slot attributes across PaymentMethodCard, PaymentMethodBank,
  and PaymentMethodList components
- Add ~120 lines of condensed CSS covering card/bank headers, details,
  footers, grid layout, and empty state
Copilot AI review requested due to automatic review settings April 6, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css
Comment thread src/styles/condensed-view.css
- Add 7 data-slot attributes across ProductVersion (inline/stacked/minimal
  variants) and ProductVersionBadge
- Add ~50 lines of condensed CSS covering all variants, environment badges,
  and badge component
Copilot AI review requested due to automatic review settings April 6, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/components/PaymentMethod/PaymentMethod.tsx:157

  • For a div with role="button", handling the Space key should call e.preventDefault() (typically on keydown) to avoid the page scrolling and to better match native button behavior. Consider preventing default for the Space key (and/or moving Space activation to onKeyUp per ARIA button patterns).
      data-slot="payment-card"
      onClick={handleSelect}
      role={selectable ? 'button' : undefined}
      tabIndex={selectable ? 0 : undefined}
      onKeyDown={
        selectable
          ? (e) => {
              if (e.key === 'Enter' || e.key === ' ') handleSelect();
            }
          : undefined

src/components/PaymentMethod/PaymentMethod.tsx:346

  • Same as PaymentMethodCard: Space key activation should prevent default to avoid page scroll when using role="button" on a div. Add e.preventDefault() for Space (and/or use keyup for Space) so keyboard interaction matches native buttons.
      data-slot="payment-bank"
      onClick={handleSelect}
      role={selectable ? 'button' : undefined}
      tabIndex={selectable ? 0 : undefined}
      onKeyDown={
        selectable
          ? (e) => {
              if (e.key === 'Enter' || e.key === ' ') handleSelect();
            }
          : undefined

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/styles/condensed-view.css Outdated
@garrity-miepub garrity-miepub marked this pull request as ready for review April 6, 2026 21:58
Copilot AI review requested due to automatic review settings April 6, 2026 21:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/components/PaymentMethod/PaymentMethod.tsx:346

  • Same issue as PaymentMethodCard: the Space key handler on the custom <div role="button"> should call e.preventDefault() to avoid page scrolling and match native button keyboard interaction.
      onClick={handleSelect}
      role={selectable ? 'button' : undefined}
      tabIndex={selectable ? 0 : undefined}
      onKeyDown={
        selectable
          ? (e) => {
              if (e.key === 'Enter' || e.key === ' ') handleSelect();
            }
          : undefined

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/ServiceGeneralSettings/ServiceGeneralSettings.tsx
Comment thread src/components/ServiceGeneralSettings/ServiceGeneralSettings.tsx
Comment thread src/components/OrderList/OrderList.tsx
Comment thread src/components/PaymentMethod/PaymentMethod.tsx
@garrity-miepub garrity-miepub merged commit 5fd489b into main Apr 6, 2026
14 checks passed
@garrity-miepub garrity-miepub deleted the feature/condensed-view-feature-modules branch April 6, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants