fix(web): pad the command palette search field and center the account row (UF-047, UF-048)
The ⌘K search input had no padding but drew its own focus ring with an offset, so the ring ran right against the text. It now has inner padding and no offset, so the ring reads as the field's outline; the palette test checks both. The sidebar account row had 8px above its content and 22px below, because its bottom padding added to the nav's own. It now has 14px above and none below, matching the nav padding underneath.
This commit is contained in:
@@ -236,7 +236,9 @@ const Sidebar = ({
|
||||
data-testid="sidebar-user"
|
||||
aria-label="Account and settings"
|
||||
onClick={() => navigate("/settings")}
|
||||
className="mt-1.5 flex items-center justify-center gap-2.5 border-t border-[var(--line-soft)] px-2.5 py-2 text-left lg:justify-start"
|
||||
// pt-3.5 matches the nav's own bottom padding, so the row sits centered
|
||||
// between the divider and the window edge.
|
||||
className="mt-1.5 flex items-center justify-center gap-2.5 border-t border-[var(--line-soft)] px-2.5 pb-0 pt-3.5 text-left lg:justify-start"
|
||||
>
|
||||
<span className="grid h-7 w-7 shrink-0 place-items-center rounded-full bg-[var(--honey)] text-[11px] font-bold text-[#1a1407]">
|
||||
{initialOf(userName, "W")}
|
||||
|
||||
@@ -565,15 +565,16 @@ const CommandCenter = ({ open, onClose, onNavigate, onExecute, workspaceId, cata
|
||||
>
|
||||
{/* Query input */}
|
||||
<div
|
||||
className="flex items-center gap-3 px-4 py-3"
|
||||
className="flex items-center gap-2 px-4 py-3"
|
||||
style={{ borderBottom: '1px solid var(--hive-700)' }}
|
||||
>
|
||||
<Search className="h-5 w-5 shrink-0" style={{ color: 'var(--hive-400)' }} />
|
||||
{/* Padding keeps the text clear of the focus ring, which outlines the field. */}
|
||||
<CommandPrimitive.Input
|
||||
value={query}
|
||||
onValueChange={setQuery}
|
||||
placeholder="What do you want to do? Search, launch, create, run, navigate, extend…"
|
||||
className="h-auto flex-1 rounded-md border-0 bg-transparent p-0 text-sm outline-none placeholder:text-[var(--hive-500)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--hive-850)]"
|
||||
className="h-auto min-w-0 flex-1 rounded-md border-0 bg-transparent px-2.5 py-1.5 text-sm text-ellipsis outline-none placeholder:text-[var(--hive-500)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"
|
||||
aria-label="Command Center search"
|
||||
/>
|
||||
{searching && <Loader2 className="h-4 w-4 animate-spin" style={{ color: 'var(--honey-500)' }} />}
|
||||
|
||||
@@ -48,6 +48,10 @@ describe('P7/B3 — Command Center error containment', () => {
|
||||
|
||||
expect(input.className).toContain('focus-visible:ring-2');
|
||||
expect(input.className).toContain('focus-visible:ring-[var(--focus-ring)]');
|
||||
// The ring outlines the field itself, so the text needs inner padding (UF-047).
|
||||
expect(input.className).not.toMatch(/\bp-0\b/);
|
||||
expect(input.className).toContain('px-2.5');
|
||||
expect(input.className).not.toContain('ring-offset');
|
||||
});
|
||||
|
||||
it('renders catalog subtitles as their own truncating line for mobile fit', async () => {
|
||||
|
||||
Reference in New Issue
Block a user