Skip to content

feat: add style.menu dropdown style overrides to PromptInput#4708

Draft
ernst-dev wants to merge 4 commits into
mainfrom
dev-v3-ernstka-prompt-input-menu-styling
Draft

feat: add style.menu dropdown style overrides to PromptInput#4708
ernst-dev wants to merge 4 commits into
mainfrom
dev-v3-ernstka-prompt-input-menu-styling

Conversation

@ernst-dev

@ernst-dev ernst-dev commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

Extends PromptInput's style prop with a style.menu sub-object so consumers can theme the trigger-based command/shortcuts dropdown (the menu shown when a trigger character is typed) to match a custom design system.

PromptInputProps.Style.menu adds four overrides: backgroundColor, borderColor, borderRadius, and borderWidth. Each maps to a CSS custom property in getPromptInputStyles(). The value is threaded through InternalPromptInputTokenMode and reuses the internal Dropdown's existing DropdownProps.Style API. (DropdownProps.Style names the fill background; the bridge to backgroundColor is in token-mode.tsx.) The API is annotated @awsuiSystem core.

A dev page for visual testing is included: pages/prompt-input/menu-style.page.tsx.

Related links, issue #, if available: n/a

How has this been tested?

src/prompt-input/__tests__/styles.test.tsx covers the style → CSS-custom-property mapping and the Core-only gating (2/2 passing locally). The dev page menu-style.page.tsx was used for manual visual verification of the dropdown styling overrides.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ernst-dev added 2 commits July 9, 2026 09:39
Adds a new `style.menu` sub-object to `PromptInputProps.Style` that
lets design-system consumers (e.g. Horizon-Rhythm-Core) override the
visual appearance of the trigger-based menus/shortcuts dropdown.

New style properties:
  - style.menu.backgroundColor  -> dropdown content-wrapper background
  - style.menu.borderColor      -> dropdown border colour
  - style.menu.borderRadius     -> dropdown border radius
  - style.menu.borderWidth      -> dropdown border width

Implementation:
  - 4 new custom CSS properties added to the generator list
  - getPromptInputStyles() maps them onto the root element as CSS vars
  - InternalPromptInput threads style.menu down to TokenMode
  - TokenMode builds a DropdownProps.Style and passes it to Dropdown
  - Existing Dropdown style API (dropdownContentBorder* CSS vars) reused
  - Unit tests updated; dev page added (menu-style.page.tsx)
Remove per-property JSDoc that restated prop names (inconsistent with sibling root/placeholder style sub-objects) and a redundant internal prop comment. Keep the public menu block doc + @awsuiSystem core tag, and add a short note on the DropdownProps.Style background<-backgroundColor bridge.
@ernst-dev ernst-dev changed the title feat(prompt-input): add style.menu dropdown style overrides feat: add style.menu dropdown style overrides to PromptInput Jul 9, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.56%. Comparing base (c2472a9) to head (4db0848).

Files with missing lines Patch % Lines
src/prompt-input/styles.tsx 47.05% 9 Missing ⚠️
src/prompt-input/components/token-mode.tsx 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4708      +/-   ##
==========================================
- Coverage   97.59%   97.56%   -0.04%     
==========================================
  Files         950      950              
  Lines       30655    30676      +21     
  Branches    11234    11252      +18     
==========================================
+ Hits        29919    29929      +10     
- Misses        729      739      +10     
- Partials        7        8       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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