Skip to content

Commit 947b851

Browse files
j15zclaude
andcommitted
fix(search): give the first glyph real ink clearance via text-indent
Chrome clips input text at the content box, not the padding box, so the previous padding-based clearance was dead space — glyph ink still started exactly at the clip edge, and the first letter kept losing its left edge under low browser zoom. text-indent starts the text 3px inside the clip region, which is clearance the renderer can actually paint into; the compensating negative margin keeps the text aligned with the result-row titles as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ed3d010 commit 947b851

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-chrome

‎apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-chrome/command-chrome.tsx‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ const LIST_FADE_CLASSNAME = {
5858
/**
5959
* Borderless search field layered over a fading command-result list.
6060
*
61-
* The input carries `pl-[3px]` with a compensating `-ml-[3px]`: inputs clip
62-
* glyph ink at their padding box, and the brand font's `j` overhangs left of
63-
* its pen origin, so with zero padding a leading `j` loses its hook — worst
64-
* at low zoom, where the clip edge snaps to whole device pixels and eats up
65-
* to 2 CSS px. The negative margin keeps the text at the same x, aligned
66-
* with the result-row titles.
61+
* The input carries `indent-[3px]` with a compensating `-ml-[3px]`: Chrome
62+
* clips input text at the content box (verified — padding gives no ink
63+
* clearance), and the first glyph's ink starts exactly at that clip edge,
64+
* so a leading `j` loses its hook — worst at low browser zoom, where the
65+
* clip edge snaps to whole device pixels and eats up to ~2 CSS px of the
66+
* first letter. The indent starts the text 3px inside the clip region and
67+
* the negative margin keeps it at the same x, aligned with the result-row
68+
* titles.
6769
*/
6870
export const CommandSearch = forwardRef<HTMLInputElement, CommandSearchProps>(
6971
function CommandSearch(
@@ -94,7 +96,7 @@ export const CommandSearch = forwardRef<HTMLInputElement, CommandSearchProps>(
9496
<Search className='size-[14px] flex-shrink-0 text-[var(--text-muted)]' />
9597
<Command.Input
9698
ref={ref}
97-
className='-ml-[3px] h-8 min-w-0 flex-1 cursor-text bg-transparent pl-[3px] text-[var(--text-body)] text-sm outline-none placeholder:text-[var(--text-muted)] focus:outline-none'
99+
className='-ml-[3px] h-8 min-w-0 flex-1 cursor-text bg-transparent text-[var(--text-body)] text-sm indent-[3px] outline-none placeholder:text-[var(--text-muted)] focus:outline-none'
98100
onKeyDown={handleKeyDown}
99101
{...props}
100102
/>

0 commit comments

Comments
 (0)