Skip to content

feat(BusinessHours): add condensed view support#165

Merged
garrity-miepub merged 22 commits intomainfrom
feature/condensed-view-provider
Apr 8, 2026
Merged

feat(BusinessHours): add condensed view support#165
garrity-miepub merged 22 commits intomainfrom
feature/condensed-view-provider

Conversation

@garrity-miepub
Copy link
Copy Markdown
Contributor

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

Condensed View — Provider Components

Adds data-slot attributes and condensed CSS overrides for the following Provider components:

  1. BusinessHours — 14 data-slots, ~115 lines CSS (scoped under root slot)
  2. EmployerContactCard — 7 data-slots, ~90 lines CSS
  3. EmployerList — 10 data-slots, ~130 lines CSS
  4. EmployerPricingCard — 8 data-slots, ~110 lines CSS
  5. EmployerView — 14 data-slots, ~310 lines CSS
  6. HelpSupportPanel — 9 data-slots, ~220 lines CSS
  7. InvoiceList — 10 data-slots, ~130 lines CSS
  8. InvoicePaymentPage — 12 data-slots, ~230 lines CSS
  9. InvoiceView — 10 data-slots, ~210 lines CSS
  10. NotificationCenter — 11 data-slots, ~120 lines CSS

Pattern

data-slot="component-element" on JSX elements
body.condensed [data-slot='component-element'] { ... !important; } in src/styles/condensed-view.css
• Block containers using gap get explicit display: flex; flex-direction: column to ensure gap works
• Prefer structural selectors over Tailwind class selectors for long-term maintainability

Add data-slot attributes to all BusinessHours sub-components and
condensed CSS overrides for tighter spacing, smaller fonts, and
compact layout across all variants (default, card, compact, inline,
expandable summary).

Data-slots added:
- business-hours (container)
- business-hours-header, business-hours-title
- business-hours-status (OpenStatusBadge)
- business-hours-content, business-hours-schedule
- business-hours-day-row, business-hours-day-name, business-hours-day-hours
- business-hours-timezone, business-hours-text
- business-hours-compact, business-hours-summary, business-hours-summary-content
Copilot AI review requested due to automatic review settings April 7, 2026 01:57
Copy link
Copy Markdown

Copilot AI left a comment

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-view support for the BusinessHours display components by introducing data-slot hooks in the TSX and corresponding condensed CSS overrides, enabling tighter spacing/typography in condensed mode.

Changes:

  • Added data-slot attributes across BusinessHours, DayScheduleRow, OpenStatusBadge, CompactHours, and HoursSummary subtrees.
  • Added a new condensed CSS section targeting the business-hours-* slots to reduce font sizes, padding, and spacing.

Reviewed changes

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

File Description
src/styles/condensed-view.css Adds condensed-mode overrides for the new business-hours-* slot hooks.
src/components/BusinessHours/BusinessHours.tsx Adds data-slot attributes to BusinessHours and related sub-components to support condensed styling.

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

- Scope all BusinessHours condensed selectors under
  [data-slot='business-hours'] parent to prevent style bleeding
  into BusinessHoursEditor which shares slot names like
  business-hours-day-name.
- Add missing business-hours-title wrapper in the 'no hours
  available' render path for consistent condensed styling.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 7, 2026

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6298ec1
Status: ✅  Deploy successful!
Preview URL: https://4c2797bd.ui-6d0.pages.dev
Branch Preview URL: https://feature-condensed-view-provi.ui-6d0.pages.dev

View logs

Add data-slot attributes and condensed CSS overrides for tighter
spacing, smaller fonts, compact avatars, and reduced card padding.

Data-slots added:
- employer-contact-card (Card root)
- employer-contact-header (header with title + add button)
- employer-contact-list (contacts container)
- employer-contact-item (individual contact row)
- employer-contact-info (name/role text)
- employer-contact-actions (email/call buttons)
- employer-contact-empty (empty state)
Copilot AI review requested due to automatic review settings April 7, 2026 18:48
Copy link
Copy Markdown

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated 4 comments.


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

- Add explicit line-height to scoped business-hours-day-name to
  prevent inheriting unscoped editor rule.
- Remove dead gap:0 on business-hours-schedule (block layout with
  space-y, gap has no effect).
- Add data-slot="employer-contact-header" to loading-state CardHeader
  for consistent condensed styling across states.
Add data-slot attributes and condensed CSS overrides following the
OrderList pattern — compact search, smaller logos, tight item
padding, smaller fonts for info/stats, and reduced spacing.

Data-slots added:
- employer-list (container)
- employer-list-header (search + add button row)
- employer-list-search (search input wrapper)
- employer-list-empty (empty state)
- employer-list-items (list container)
- employer-list-item (individual employer row)
- employer-list-item-content (inner flex row)
- employer-list-item-info (name/email/date block)
- employer-list-item-stats (employee/pending counts)
Copilot AI review requested due to automatic review settings April 7, 2026 19:27
Copy link
Copy Markdown

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 6 comments.


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

- Extend OpenStatusBadge condensed selectors to cover compact and
  summary variants (not just main BusinessHours container).
- Scope business-hours-content padding to card variant only
  (.rounded-lg) to avoid adding padding to non-card variants.
- Add explicit data-slot='employer-list-item-logo' to both img and
  fallback initial div, replacing brittle DOM-structure selectors.
- Update PR description to list all 3 components.
- Add 8 data-slot attributes: employer-pricing-card (root),
  employer-pricing-header, employer-pricing-title, employer-pricing-base-price,
  employer-pricing-tiers, employer-pricing-tier-row, employer-pricing-notes,
  employer-pricing-actions.
- Add ~110 lines condensed CSS: tighter card padding, smaller price/text,
  compact tier rows, reduced notes callout, smaller action buttons.
Copilot AI review requested due to automatic review settings April 7, 2026 19:58
Copy link
Copy Markdown

Copilot AI left a comment

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 1 comment.


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

- Add 14 data-slot attributes: employer-view (root), employer-view-header-card,
  employer-view-header, employer-view-logo, employer-view-info,
  employer-view-stats, employer-view-address-card, employer-view-contact-card,
  employer-view-orders-card, employer-view-order-row,
  employer-view-invoices-card, employer-view-invoice-row,
  employer-view-contacts-card, employer-view-contact-row.
- Add ~310 lines condensed CSS: compact header with smaller logo (2.25rem),
  tighter stats grid, smaller tabs, compact card headers/content across all
  four tab panels, tighter order/invoice/contact rows with smaller badges
  and buttons.
Copilot AI review requested due to automatic review settings April 7, 2026 20:57
Copy link
Copy Markdown

Copilot AI left a comment

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 7 changed files in this pull request and generated 3 comments.


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

@garrity-miepub garrity-miepub force-pushed the feature/condensed-view-provider branch from 954dc9c to 28a2845 Compare April 7, 2026 21:04
Remove baseUrl (redundant in TS 5.x+ — paths resolve relative to
tsconfig location by default). Eliminates deprecation warning in both
IDE and CLI.
Copilot AI review requested due to automatic review settings April 7, 2026 21:06
@garrity-miepub garrity-miepub force-pushed the feature/condensed-view-provider branch from 28a2845 to 062c840 Compare April 7, 2026 21:06
Copy link
Copy Markdown

Copilot AI left a comment

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 7 changed files in this pull request and generated 5 comments.


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

- Add data-slot='help-support-success' to success callout, replacing .rounded-lg.bg-green-100 selector
- Add data-slot='employer-view-edit-btn' to Edit Employer button, replacing fragile child-combinator selector
- Update PR description to list all 7 components
Copilot AI review requested due to automatic review settings April 7, 2026 21:59
Copy link
Copy Markdown

Copilot AI left a comment

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 8 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.

…ata-slots

- EmployerList: .mt-0.5 → h3 + * (structural sibling selector)
- EmployerList: p.text-lg/p.text-xs → p:first-of-type/p:last-of-type
- InvoiceList: add data-slot='invoice-list-actions', replace .flex child combinator
Copilot AI review requested due to automatic review settings April 7, 2026 22:13
Copy link
Copy Markdown

Copilot AI left a comment

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 10 changed files in this pull request and generated 4 comments.


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

- Add data-slot='invoice-payment' to loading skeleton
- Add data-slot='invoice-payment-grid' to two-column layout, replace .grid selector
- Add data-slot='invoice-payment-success-icon', replace .rounded-full selectors
- Replace .text-sm/.text-lg with structural selectors in totals section
- Update PR description to list all 8 components
- 10 data-slots across header, actions, card, provider, meta, bill-to, line-items, totals, notes
- Scoped font-size rules under invoice-view-card to beat card-content .font-medium specificity (0,3,1 trap)
Copilot AI review requested due to automatic review settings April 7, 2026 22:44
Copy link
Copy Markdown

Copilot AI left a comment

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 11 changed files in this pull request and generated 2 comments.


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

- Add 10 data-slots: notification-center (root), header, empty, list,
  item, item-row, icon, content, meta, footer
- Add ~108 lines condensed CSS: reduced padding, smaller fonts,
  compact icon circles, tighter spacing
- Root slot on both loading and main render paths
Copilot AI review requested due to automatic review settings April 7, 2026 23:07
Copy link
Copy Markdown

Copilot AI left a comment

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 11 out of 12 changed files in this pull request and generated 6 comments.


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

- Add data-slot to badges container for targeted styling
- Fix unread dot selector (span) accidentally shrinking Badge spans
  to 6px height — use :not([data-slot]) to only target the dot
- Add condensed badge sizing (smaller font, padding, gap)
- Add title text truncation in condensed mode
- Add overflow:hidden on content title row
- EmployerPricingCard: .text-sm/.text-xs → span / span:nth-child(2)
- EmployerView order-row: p.font-medium/p.text-sm/p.text-xs →
  p:first-child / p:nth-child(2) / p:last-child
- EmployerView invoice-row: p.font-medium/p.text-sm/p.font-semibold →
  structural selectors scoped by div position
- InvoiceList: p.text-xs → p + p (adjacent sibling)
- InvoicePaymentPage: .grid → data-slot="invoice-payment-card-row"
Copilot AI review requested due to automatic review settings April 7, 2026 23:33
Copy link
Copy Markdown

Copilot AI left a comment

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 11 out of 12 changed files in this pull request and generated 2 comments.


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

…tors

- employer-view-contact-row: p.font-medium → p:first-of-type, p.text-sm → p + p
- invoice-payment-summary: .text-sm → > div:first-child
@garrity-miepub garrity-miepub marked this pull request as ready for review April 8, 2026 00:29
Copilot AI review requested due to automatic review settings April 8, 2026 00:29
@garrity-miepub garrity-miepub merged commit 9366f59 into main Apr 8, 2026
12 checks passed
@garrity-miepub garrity-miepub deleted the feature/condensed-view-provider branch April 8, 2026 00:32
Copy link
Copy Markdown

Copilot AI left a comment

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 11 out of 12 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 on lines +8741 to +8752
body.condensed [data-slot='help-support-contact-item'] p.font-medium {
font-size: 0.75rem !important;
line-height: 1rem !important;
}

body.condensed [data-slot='help-support-contact-item'] a,
body.condensed [data-slot='help-support-contact-item'] p.text-sm {
font-size: 0.6875rem !important;
line-height: 0.9375rem !important;
}

body.condensed [data-slot='help-support-contact-item'] p.text-xs {
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

These condensed overrides for HelpSupport contact items rely on Tailwind utility classes (p.font-medium, p.text-sm, p.text-xs) to find the label/value/availability nodes. That’s brittle (class refactors can silently break condensed view) and conflicts with the PR’s stated preference for structural selectors. Prefer targeting these nodes structurally within [data-slot='help-support-contact-item'] or add dedicated data-slots (e.g., contact-label/contact-value/contact-availability) and target those instead.

Suggested change
body.condensed [data-slot='help-support-contact-item'] p.font-medium {
font-size: 0.75rem !important;
line-height: 1rem !important;
}
body.condensed [data-slot='help-support-contact-item'] a,
body.condensed [data-slot='help-support-contact-item'] p.text-sm {
font-size: 0.6875rem !important;
line-height: 0.9375rem !important;
}
body.condensed [data-slot='help-support-contact-item'] p.text-xs {
body.condensed [data-slot='help-support-contact-item'] > :not(svg) > p:first-of-type {
font-size: 0.75rem !important;
line-height: 1rem !important;
}
body.condensed [data-slot='help-support-contact-item'] > :not(svg) > a,
body.condensed [data-slot='help-support-contact-item'] > :not(svg) > p:first-of-type + p:not(:last-of-type),
body.condensed [data-slot='help-support-contact-item'] > :not(svg) > p:first-of-type + p:last-of-type:first-child {
font-size: 0.6875rem !important;
line-height: 0.9375rem !important;
}
body.condensed [data-slot='help-support-contact-item'] > :not(svg) > p:last-of-type:not(:first-of-type) {

Copilot uses AI. Check for mistakes.

/* ── Stripe branding ── */

body.condensed [data-slot='invoice-payment-form'] form > p.text-xs {
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This selector for Stripe branding depends on the .text-xs Tailwind utility class (form > p.text-xs). Since utility classes are implementation details, condensed styling can break with harmless refactors. Prefer adding a stable data-slot to the Stripe branding <p> and targeting that, or use a more structural selector (e.g., the branding paragraph’s position within the form) scoped under [data-slot='invoice-payment-form'].

Suggested change
body.condensed [data-slot='invoice-payment-form'] form > p.text-xs {
body.condensed [data-slot='invoice-payment-form'] form > p:last-of-type {

Copilot uses AI. Check for mistakes.
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