Skip to content

Commit eefc7e8

Browse files
serpentbladeclaude
andcommitted
fix(command-palette): wire up option-row flex layout (categories right-aligned)
The default #option slot rendered the action label + category as two bare sibling <span>s; their only separation was the collapsible whitespace text node between them. esbuild (Vite ≤7) preserved that whitespace, so the category sat just after the label; Vite 8's transforms drop it, so the two crammed together (`New FileFILE`) on all 5 non-lit targets (lit's html`` literals kept the space, so it was unaffected). The `.rozie-command-palette-option` rule (display:flex; space-between) was authored for exactly this row but never applied to any element — so the intended "label left, category right-aligned" layout never shipped. Wrap the two spans in it (now live), trim it to layout-only (combobox's <li> already supplies padding/cursor), and drop the dead --active/--disabled modifiers. Layout no longer depends on collapsible markup whitespace, so it's robust across all 6 targets and both bundlers. Visually confirmed: categories now align on the right edge, labels on the left, on every target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KSYH6VBAJwa7nYy4AksuNH
1 parent c29c7dd commit eefc7e8

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

packages/ui/command-palette/src/CommandPalette.rozie

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,10 @@ $expose({ show, close, toggle, focus })
363363
:selected="selected"
364364
:disabled="disabled"
365365
>
366-
<span class="rozie-command-palette-option-label">{{ labelText(option) }}</span>
367-
<span r-if="groupText(option)" class="rozie-command-palette-option-group">{{ groupText(option) }}</span>
366+
<div class="rozie-command-palette-option">
367+
<span class="rozie-command-palette-option-label">{{ labelText(option) }}</span>
368+
<span r-if="groupText(option)" class="rozie-command-palette-option-group">{{ groupText(option) }}</span>
369+
</div>
368370
</slot>
369371
</template>
370372

@@ -443,25 +445,18 @@ $expose({ show, close, toggle, focus })
443445
overflow-y: auto;
444446
}
445447

448+
/*
449+
Layout for the default `#option` row: action label on the left, category
450+
pushed to the right edge (`space-between`). This wraps the two spans inside
451+
combobox's own `<li class="rozie-combobox-option">`, which already supplies the
452+
row's padding/cursor/active styling — so this rule is layout-only (padding /
453+
radius / cursor here would double up with the combobox option and are omitted).
454+
*/
446455
.rozie-command-palette-option {
447456
display: flex;
448457
align-items: center;
449458
justify-content: space-between;
450459
gap: var(--rozie-command-palette-option-gap, 0.75rem);
451-
padding: var(--rozie-command-palette-option-padding, 0.5rem 0.625rem);
452-
border-radius: var(--rozie-command-palette-option-radius, 0.5rem);
453-
cursor: pointer;
454-
color: var(--rozie-command-palette-option-color, inherit);
455-
}
456-
457-
.rozie-command-palette-option--active {
458-
background: var(--rozie-command-palette-option-active-bg, rgba(0, 102, 204, 0.12));
459-
color: var(--rozie-command-palette-option-active-color, inherit);
460-
}
461-
462-
.rozie-command-palette-option--disabled {
463-
cursor: not-allowed;
464-
opacity: var(--rozie-command-palette-option-disabled-opacity, 0.45);
465460
}
466461

467462
.rozie-command-palette-option-group {

0 commit comments

Comments
 (0)