authorgravatar for simon.doba@hotmail.deSimon Doba <simon.doba@hotmail.de> 2026-08-15 13:42:08+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-15 11:42:08+00:00
loga38cac81d82b82a6967eaf8cb90ed2770c514f3c
treeff88fecf0cb1c1fce8fadc4f5384894ec889d35a
parent3bc4fdf05b6b748a7b506c81dc125f3504f35278
signature Signed by PGP key B5690EEEBB952194

fix(web): keep a long path from running under the folder picker button (#4823)

Co-authored-by: Sy-D <8460326+Sy-D@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>

3 files changed, 51 insertions(+), 4 deletions(-)

apps/web/src/components/CommandPalette.logic.test.ts+30
......@@ -2,6 +2,7 @@ import { describe, expect, it, vi } from "vite-plus/test";
22import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
33import type { Thread } from "../types";
44import {
5 browseInputEndPaddingClass,
56 buildBrowseGroups,
67 buildThreadActionItems,
78 enumerateCommandPaletteItems,
......@@ -10,6 +11,35 @@ import {
1011 type CommandPaletteGroup,
1112} from "./CommandPalette.logic";
1213
14describe("browseInputEndPaddingClass", () => {
15 it("reserves the widest space for the create action", () => {
16 expect(
17 browseInputEndPaddingClass({
18 willCreateProjectPath: true,
19 hasHighlightedBrowseItem: false,
20 }),
21 ).toContain("pe-38");
22 });
23
24 it("reserves space for the wider highlighted-item shortcut", () => {
25 expect(
26 browseInputEndPaddingClass({
27 willCreateProjectPath: false,
28 hasHighlightedBrowseItem: true,
29 }),
30 ).toContain("pe-30");
31 });
32
33 it("keeps the compact reserve for the normal add action", () => {
34 expect(
35 browseInputEndPaddingClass({
36 willCreateProjectPath: false,
37 hasHighlightedBrowseItem: false,
38 }),
39 ).toContain("pe-24");
40 });
41});
42
1343describe("reduceCommandPaletteUiState", () => {
1444 const closedState = { open: false, mode: "command", openIntent: null } as const;
1545
apps/web/src/components/CommandPalette.logic.ts+13
......@@ -15,6 +15,19 @@ export const RECENT_THREAD_LIMIT = 12;
1515export const ITEM_ICON_CLASS = "size-4 text-icon-muted";
1616export const ADDON_ICON_CLASS = "size-4";
1717
18export function browseInputEndPaddingClass(input: {
19 readonly willCreateProjectPath: boolean;
20 readonly hasHighlightedBrowseItem: boolean;
21}): string {
22 if (input.willCreateProjectPath) {
23 return "*:data-[slot=autocomplete-input]:pe-38!";
24 }
25 if (input.hasHighlightedBrowseItem) {
26 return "*:data-[slot=autocomplete-input]:pe-30!";
27 }
28 return "*:data-[slot=autocomplete-input]:pe-24!";
29}
30
1831/**
1932 * The global search overlay hosts three mutually exclusive surfaces: the
2033 * command palette (⌘K), the project file picker (⌘P), and project content
apps/web/src/components/CommandPalette.tsx+8-4
......@@ -98,6 +98,7 @@ import {
9898} from "../wslPaths";
9999import {
100100 ADDON_ICON_CLASS,
101 browseInputEndPaddingClass,
101102 buildBrowseGroups,
102103 buildProjectActionItems,
103104 buildRootGroups,
......@@ -2345,13 +2346,16 @@ function OpenCommandPaletteDialog(props: {
23452346 footerTrailing={footerTrailing}
23462347 inputAccessory={inputAccessory}
23472348 inputProps={{
2349 // The submit button is absolutely positioned over the field, so the
2350 // inner input must reserve enough room for the full action label.
23482351 className:
23492352 addProjectCloneFlow?.step === "repository"
2350 ? "pe-32"
2353 ? "*:data-[slot=autocomplete-input]:pe-32!"
23512354 : isBrowsing
2352 ? willCreateProjectPath
2353 ? "pe-36"
2354 : "pe-16"
2355 ? browseInputEndPaddingClass({
2356 willCreateProjectPath,
2357 hasHighlightedBrowseItem,
2358 })
23552359 : undefined,
23562360 placeholder: inputPlaceholder,
23572361 wrapperClassName: isSubmenu