Skip to content

feat: redesign shortcut cards and group headers with zinc palette#799

Closed
crittermike wants to merge 2 commits intomasterfrom
feat/shortcut-card-redesign
Closed

feat: redesign shortcut cards and group headers with zinc palette#799
crittermike wants to merge 2 commits intomasterfrom
feat/shortcut-card-redesign

Conversation

@crittermike
Copy link
Copy Markdown
Owner

Summary

Redesigns the options page shortcut cards and group headers with a polished "developer-tool" aesthetic. This builds on top of PR #797 (Tailwind CSS migration) and focuses on the visual design of the two most prominent UI elements: shortcut cards and group headers.

What changed

Shortcut Cards — 3-section layout

Cards now use a header / body / footer structure:

  • Header: Trigger shortcut input (left) + behavior dropdown (right) + delete button
  • Body: Expanded details panel (ShortcutDetails) — only visible when card is expanded
  • Footer: Site restriction controls (All Sites / Include / Exclude segmented toggle) + URL input + "Active in Inputs" toggle

When a card is expanded, it gets a blue border highlight with a deep shadow (border-2 border-blue-600/50 shadow-[0_20px_50px_rgba(0,0,0,0.4)]).

Group Headers — minimal row design

Replaced card-style group headers with a clean horizontal row:

  • Chevron icon (rotates on collapse/expand)
  • Uppercase group name with tight tracking
  • "+ Add Shortcut" button (right-aligned)
  • Three-dot menu for rename/delete/share

ShortcutRecorder — key badges

The shortcut input now renders typed keys as styled <kbd> badge elements (e.g. Ctrl + Shift + K). Clicking the badges switches to manual text editing mode. Empty state and recording state still show the raw text input.

Key implementation: keyBadges computed property parses the model value string (e.g. "ctrl+shift+k") by splitting on space (sequences) then + (combos).

ShortcutDetails — timeline macro builder

Macro steps render as a vertical timeline with numbered circles and a blue gradient connecting line. Each step shows:

  • Step number in a circle
  • Action name
  • Delay pill (DELAY 0 ms)
  • Action-specific fields: URL input for openurl, bookmark selector for bookmark
  • Delete button

Card theming — CSS variable system

All card colors use CSS custom properties (--card-bg, --card-border, --card-text, --card-deepest, etc.) registered as Tailwind theme colors (bg-card, border-card-border, etc.). This enables proper light/dark mode support:

Light mode: white/gray card surfaces (#ffffff, #f3f4f6, #e5e7eb)
Dark mode: zinc card surfaces (#18181b, #27272a, #3f3f46, #09090b)

Variables are defined in :root and [data-theme="dark"] blocks in style.css.

Files changed (11 files, +392/-275)

File What changed
src/entrypoints/options/App.vue Card template (3-section layout), group header design, footer with site rules
src/entrypoints/options/style.css Card CSS variables (light+dark), @theme color registration, density overrides
src/components/ShortcutDetails.vue Timeline macro builder, action-specific fields (URL/bookmark), zinc theming
src/components/ShortcutRecorder.vue Key badge display, manual edit toggle, recording pulse animation
src/components/SearchSelect.vue Card-themed trigger button and dropdown
src/components/OnboardingWizard.vue Minor layout adjustments for new card system
src/utils/url-matching.ts MacroStep interface extended with openurl? and bookmark? fields
src/actions/action-handlers.ts Macro handler merges step-level fields into request ({ ...request, ...step })
e2e/options.spec.ts Updated selectors for new DOM structure
e2e/content.spec.ts Updated selectors for new DOM structure
e2e/popup.spec.ts Updated selectors for new DOM structure

Architecture notes for future agents

Card color system

Never use hardcoded zinc-* or gray-* classes on card elements. Always use the card-* Tailwind classes which map to CSS variables:

  • bg-card / bg-card-dim / bg-card-deepest — surface layers
  • text-card-text / text-card-text-muted / text-card-text-placeholder — text hierarchy
  • border-card-border / border-card-border-muted — borders

Key CSS classes preserved for e2e tests

These classes are used as selectors in e2e tests and must not be removed:
shortcut-card, shortcut-label-title, shortcut-input, shortcut-actions, shortcut-details, search-select, btn-primary, btn-secondary, btn-delete, btn-icon, btn-sm, toggle, group-header, tab-btn, stats-bar, search-clear, theme-toggle, toast, empty-state

Overflow-hidden gotcha

Do NOT add overflow-hidden to shortcut cards — it clips the SearchSelect dropdown which portals within the card. The rounded-2xl works without it.

Density overrides

The [data-density="condensed"] CSS targets named classes (shortcut-header, shortcut-row, etc.). These class names must be preserved alongside Tailwind utilities.

Test results

  • ✅ 730 unit tests passing
  • ✅ 19 e2e tests passing
  • ✅ Build succeeds
  • ✅ Manually tested in Chrome dev mode

Dependencies

crittermike and others added 2 commits March 9, 2026 09:41
- Install tailwindcss v4, @tailwindcss/postcss, configure PostCSS
- Create style.css with Tailwind theme, CSS custom properties (light/dark), shared component classes, toggle switch, density overrides, Vue transitions
- Migrate App.vue template to Tailwind utilities (2,324 → 482 lines)
- Migrate all 12 components: SearchSelect, ShortcutRecorder, CodeEditor, ShortcutDetails, PacksTab, PackPreviewModal, CommunityPackModal, JsWarningDialog, ImportTab, ExportTab, AnalyticsTab, OnboardingWizard
- Remove container div from index.html (conflicts with Tailwind's .container)
- All 730 tests passing, production build clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Redesign the options page shortcut cards and group headers with a
developer-tool aesthetic using a zinc color palette. Cards use a
3-section layout (header/body/footer) with CSS variable theming
for light and dark modes. Group headers are minimal rows with
chevron toggles and uppercase names.

Key changes:
- ShortcutRecorder: key badge display with kbd elements
- ShortcutDetails: timeline macro builder with action-specific fields
- SearchSelect: card-themed dropdown with zinc colors
- App.vue: new group header design, card footer with site rules
- style.css: card-* CSS variable system for light/dark theming
- url-matching.ts: MacroStep extended with openurl/bookmark fields
- action-handlers.ts: macro handler merges step-level fields
- e2e tests: updated selectors for new DOM structure

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant