Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions apps/web/src/components/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1506,16 +1506,32 @@ function OpenCommandPaletteDialog(props: {
},
});

actionItems.push({
kind: "action",
value: "action:project-settings",
searchTerms: ["project", "settings", "scripts", "model", "grouping", "checkout"],
title: "Project settings",
icon: <FolderIcon className={ITEM_ICON_CLASS} />,
run: async () => {
await navigate({ to: "/settings/projects" });
},
});
// There is no projects listing page; the action targets the contextual
// project (active thread/draft, falling back to the first sidebar group).
const contextualProjectGroup =
(contextualProjectRef
? projectGroupByTargetKey.get(
`${contextualProjectRef.environmentId}:${contextualProjectRef.projectId}`,
)
: null) ??
projectGroups[0] ??
null;
if (contextualProjectGroup) {
actionItems.push({
kind: "action",
value: "action:project-settings",
searchTerms: ["project", "settings", "scripts", "model", "grouping", "checkout"],
title: "Project settings",
description: contextualProjectGroup.displayName,
icon: <FolderIcon className={ITEM_ICON_CLASS} />,
run: async () => {
await navigate({
to: "/projects/$projectKey",
params: { projectKey: contextualProjectGroup.projectKey },
});
},
});
}

const rootGroups = buildRootGroups({ actionItems, recentThreadItems });
const sourceSelectionViewValue =
Expand Down
14 changes: 7 additions & 7 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ import {
FolderIcon,
FolderPlusIcon,
GitBranchIcon,
EllipsisIcon,
MessageSquareIcon,
PinIcon,
PlusIcon,
SearchIcon,
ServerIcon,
SettingsIcon,
SquarePenIcon,
TerminalIcon,
Undo2Icon,
Expand Down Expand Up @@ -1836,7 +1836,7 @@ export default function Sidebar() {
clearSelection();
}, [clearSelection, projectScopeKey]);

const handleProjectActions = useCallback(
const handleProjectSettings = useCallback(
(event: ReactMouseEvent<HTMLButtonElement>, projectGroup: SidebarProjectSnapshot) => {
event.preventDefault();
event.stopPropagation();
Expand All @@ -1845,7 +1845,7 @@ export default function Sidebar() {
setOpenMobile(false);
}
void router.navigate({
to: "/settings/projects/$projectKey",
to: "/projects/$projectKey",
params: { projectKey: projectGroup.projectKey },
});
},
Expand Down Expand Up @@ -3295,15 +3295,15 @@ export default function Sidebar() {
<span className="min-w-0 truncate text-sm">{project.displayName}</span>
<button
type="button"
aria-label={`Project actions for ${project.displayName}`}
title={`Project actions for ${project.displayName}`}
aria-label={`Project settings for ${project.displayName}`}
title={`Project settings for ${project.displayName}`}
className="ml-auto inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-icon-muted outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
void handleProjectActions(event, project);
void handleProjectSettings(event, project);
}}
>
<EllipsisIcon className="size-3.5" />
<SettingsIcon className="size-3.5" />
</button>
</MenuRadioItem>
);
Expand Down
Loading
Loading