-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(web): normalize compact UI geometry #4498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -334,15 +334,16 @@ export default function ProjectScriptsControl({ | |
| <TooltipTrigger | ||
| render={ | ||
| <Button | ||
| size="xs" | ||
| size="icon-xs" | ||
| variant="outline" | ||
| className="@3xl/header-actions:w-auto @3xl/header-actions:px-[calc(--spacing(2)-1px)]" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expanded script buttons lose compact typographyMedium Severity Switching these controls to Additional Locations (1)Reviewed by Cursor Bugbot for commit b931602. Configure here. |
||
| aria-label={`Run ${primaryScript.name}`} | ||
| onClick={() => onRunScript(primaryScript)} | ||
| /> | ||
| } | ||
| > | ||
| <ScriptIcon icon={primaryScript.icon} /> | ||
| <span className="sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5"> | ||
| <span className="hidden @3xl/header-actions:ml-0.5 @3xl/header-actions:inline"> | ||
| {primaryScript.name} | ||
| </span> | ||
| </TooltipTrigger> | ||
|
|
@@ -428,11 +429,17 @@ export default function ProjectScriptsControl({ | |
| <Tooltip> | ||
| <TooltipTrigger | ||
| render={ | ||
| <Button size="xs" variant="outline" aria-label="Add action" onClick={openAddDialog} /> | ||
| <Button | ||
| size="icon-xs" | ||
| variant="outline" | ||
| className="@3xl/header-actions:w-auto @3xl/header-actions:px-[calc(--spacing(2)-1px)]" | ||
| aria-label="Add action" | ||
| onClick={openAddDialog} | ||
| /> | ||
| } | ||
| > | ||
| <PlusIcon className="size-3.5" /> | ||
| <span className="sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5"> | ||
| <span className="hidden @3xl/header-actions:ml-0.5 @3xl/header-actions:inline"> | ||
| Add action | ||
| </span> | ||
| </TooltipTrigger> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { renderToStaticMarkup } from "react-dom/server"; | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
| import { FlaskConicalIcon } from "lucide-react"; | ||
|
|
||
| import { Button } from "./button"; | ||
|
|
||
| describe("button geometry tokens", () => { | ||
| it("uses the shared control radius and an opaque semantic icon color", () => { | ||
| const html = renderToStaticMarkup( | ||
| <Button size="icon-xs" variant="outline" aria-label="Run tests"> | ||
| <FlaskConicalIcon /> | ||
| </Button>, | ||
| ); | ||
|
|
||
| expect(html).toContain("rounded-[var(--control-radius)]"); | ||
| expect(html).toContain("[--control-icon-color:var(--muted-foreground)]"); | ||
| expect(html).toContain("text-[var(--control-icon-color)]"); | ||
| expect(html).not.toContain("opacity-80"); | ||
| }); | ||
|
|
||
| it("keeps compact icon buttons square at every breakpoint", () => { | ||
| const html = renderToStaticMarkup( | ||
| <Button size="icon-xs" aria-label="Add action"> | ||
| <span>+</span> | ||
| </Button>, | ||
| ); | ||
|
|
||
| expect(html).toContain("size-7"); | ||
| expect(html).toContain("sm:size-6"); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,7 +103,12 @@ function CommandInput({ | |
| wrapperClassName?: string | undefined; | ||
| }) { | ||
| return ( | ||
| <div className={cn("px-2.5 py-1.5", wrapperClassName)}> | ||
| <div | ||
| className={cn( | ||
| "px-[var(--command-shell-inset)] py-1.5 [&_[data-slot=autocomplete-start-addon]]:ps-[calc(var(--command-shell-inset)+0.0625rem)] sm:*:data-[slot=autocomplete-input]:ps-[calc(var(--command-shell-inset)+1.5rem)]", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Command input padding never appliesMedium Severity The Reviewed by Cursor Bugbot for commit b931602. Configure here. |
||
| wrapperClassName, | ||
| )} | ||
| > | ||
| <AutocompleteInput | ||
| autoFocus | ||
| className={cn( | ||
|
|
@@ -211,7 +216,7 @@ function CommandFooter({ className, ...props }: React.ComponentProps<"div">) { | |
| return ( | ||
| <div | ||
| className={cn( | ||
| "relative flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] bg-foreground/[0.025] px-5 py-3 font-medium text-sm text-muted-foreground [&_[data-slot=kbd-group]]:font-sans [&_[data-slot=kbd]]:bg-foreground/[0.08] [&_[data-slot=kbd]]:text-foreground [&_[data-slot=kbd]]:ring-0", | ||
| "relative flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] bg-foreground/[0.025] px-[var(--command-content-inset)] py-3 font-medium text-sm text-muted-foreground [&_[data-slot=kbd-group]]:font-sans [&_[data-slot=kbd]]:bg-foreground/[0.08] [&_[data-slot=kbd]]:text-foreground [&_[data-slot=kbd]]:ring-0", | ||
| className, | ||
| )} | ||
| data-slot="command-footer" | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanded script buttons stay cramped
Medium Severity
Switching these controls to
icon-xskeepssm:size-6width while only adding@3xl/header-actions:w-auto. Depending on stylesheet order, the fixed width can win, so when labels unhide the button stays 24px wide and the text overflows. The override also omits the oldxstext and gap sizing used by neighboring header actions.Additional Locations (1)
apps/web/src/components/ProjectScriptsControl.tsx#L431-L435Reviewed by Cursor Bugbot for commit b931602. Configure here.