The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 04:30 UTC
fix(web): sidebar project filter rows line up and stay still on hover (#29639)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
shivam committed
Nov 5, 2026 at 09:24 UTC
20e92ffe022fe7813c854eeb68195ffa8e04850f
3 files changed
+66
-31
apps/web/src/components/ProjectComboboxRow.tsx
new
+18
@@ -0,0 +1,18 @@
1
+import type { ReactNode } from "react";
2
+
3
+/** Settings shows only on the highlighted row; the pin keeps the far-right column. */
4
+export function ProjectRowActions(props: {
5
+ readonly settings?: ReactNode;
6
+ readonly pin?: ReactNode;
7
+}) {
8
+ return (
9
+ <span className="ml-auto flex shrink-0 items-center pointer-coarse:gap-1">
10
+ {props.settings ? (
11
+ <span className="flex pointer-fine:invisible pointer-fine:in-data-highlighted:visible">
12
+ {props.settings}
13
+ </span>
14
+ ) : null}
15
+ {props.pin ?? <span className="size-7 sm:size-6" />}
16
+ </span>
17
+ );
18
+}
apps/web/src/components/ProjectEnvironmentBadge.tsx
+1
-1
@@ -28,7 +28,7 @@ export function ProjectEnvironmentBadge(props: {
28
<span
29
role="img"
30
aria-label={description}
31
- className="ml-auto inline-flex shrink-0 items-center text-muted-foreground"
31
+ className="inline-flex shrink-0 items-center text-muted-foreground"
32
/>
33
}
34
>
apps/web/src/components/Sidebar.tsx
+47
-30
@@ -170,6 +170,7 @@ import type { SidebarThreadSummary } from "../types";
170
import { isScratchProject } from "@t3tools/client-runtime/state/projects";
171
import { cn } from "~/lib/utils";
172
import { ProjectEnvironmentBadge } from "./ProjectEnvironmentBadge";
173
+import { ProjectRowActions } from "./ProjectComboboxRow";
174
import {
175
buildDraftActionMenuItems,
176
buildThreadActionMenuItems,
@@ -3020,13 +3021,18 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3021
}
3022
>
3023
{scopedProjectGroups.length > 1 ? (
3023
- <span className="flex shrink-0 -space-x-1.5">
3024
- {scopedProjectGroups.slice(0, 2).map((project) => (
3025
- <ProjectFavicon
3024
+ <span className="flex shrink-0">
3025
+ {scopedProjectGroups.slice(0, 2).map((project, index) => (
3026
+ <span
3027
key={project.projectKey}
3027
- project={project}
3028
- className="size-3.5"
3029
- />
3028
+ className={
3029
+ index === 0
3030
+ ? "flex"
3031
+ : "-ml-1 flex rounded-[25%] bg-sidebar ring-2 ring-sidebar"
3032
+ }
3033
+ >
3034
+ <ProjectFavicon project={project} className="size-3.5" />
3035
+ </span>
3036
))}
3037
</span>
3038
) : scopedProjectGroups[0] ? (
@@ -3117,15 +3123,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3123
<FolderIcon className="size-4 shrink-0" />
3124
)}
3125
</ProjectScopeRowIcon>
3120
- <span className="min-w-0 flex-1 truncate text-sm">{item.label}</span>
3121
- {project && canPinProject(project) ? (
3122
- <ProjectPinButton
3123
- name={project.displayName}
3124
- pinned={project.pinned}
3125
- shortcutLabel={shortcutLabelForCommand(keybindings, "thread.pin")}
3126
- onToggle={() => toggleProjectGroupPin(project)}
3127
- />
3128
- ) : null}
3126
+ <span className="min-w-0 truncate text-sm">{item.label}</span>
3127
{project && showProjectEnvironments ? (
3128
<ProjectEnvironmentBadge
3129
group={project}
@@ -3134,21 +3132,40 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3132
/>
3133
) : null}
3134
{project ? (
3137
- <Button
3138
- size="icon-xs"
3139
- variant="ghost-muted"
3140
- tabIndex={-1}
3141
- aria-hidden="true"
3142
- title={`Project settings for ${project.displayName}`}
3143
- className={canPinProject(project) ? undefined : "ml-auto"}
3144
- onPointerDown={(event) => event.stopPropagation()}
3145
- onClick={(event) => {
3146
- void handleProjectSettings(event, project);
3147
- }}
3148
- >
3149
- <SettingsIcon className="size-3.5" />
3150
- </Button>
3151
- ) : null}
3135
+ <ProjectRowActions
3136
+ pin={
3137
+ canPinProject(project) ? (
3138
+ <ProjectPinButton
3139
+ name={project.displayName}
3140
+ pinned={project.pinned}
3141
+ shortcutLabel={shortcutLabelForCommand(
3142
+ keybindings,
3143
+ "thread.pin",
3144
+ )}
3145
+ onToggle={() => toggleProjectGroupPin(project)}
3146
+ />
3147
+ ) : null
3148
+ }
3149
+ settings={
3150
+ <Button
3151
+ size="icon-xs"
3152
+ variant="ghost-muted"
3153
+ tabIndex={-1}
3154
+ aria-hidden="true"
3155
+ title={`Project settings for ${project.displayName}`}
3156
+ onPointerDown={(event) => event.stopPropagation()}
3157
+ onClick={(event) => {
3158
+ void handleProjectSettings(event, project);
3159
+ }}
3160
+ >
3161
+ <SettingsIcon className="size-3.5" />
3162
+ </Button>
3163
+ }
3164
+ />
3165
+ ) : (
3166
+ // Keeps "All projects" as tall as the project rows.
3167
+ <span className="ml-auto size-7 shrink-0 sm:size-6" />
3168
+ )}
3169
</ComboboxItem>
3170
);
3171
}}