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
43 changes: 29 additions & 14 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ export default function Sidebar() {
(store) => store.clearProjectDraftThreadById,
);
const navigate = useNavigate();
const isOnSettings = useLocation({ select: (loc) => loc.pathname === "/settings" });
const pathname = useLocation({ select: (loc) => loc.pathname });
const isOnSubPage = pathname === "/settings" || pathname === "/pr-review";
const { settings: appSettings, updateSettings } = useAppSettings();
const { resolvedTheme } = useTheme();
const { handleNewThread } = useHandleNewThread();
Expand Down Expand Up @@ -1886,8 +1887,8 @@ export default function Sidebar() {
<SidebarMenuItem>
<SpotifyToggleButton />
</SidebarMenuItem>
<SidebarMenuItem>
{isOnSettings ? (
{isOnSubPage ? (
<SidebarMenuItem>
<SidebarMenuButton
size="sm"
className="gap-2 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground"
Expand All @@ -1896,17 +1897,31 @@ export default function Sidebar() {
<ArrowLeftIcon className="size-3.5" />
<span className="text-xs">Back</span>
</SidebarMenuButton>
) : (
<SidebarMenuButton
size="sm"
className="gap-2 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground"
onClick={() => void navigate({ to: "/settings" })}
>
<SettingsIcon className="size-3.5" />
<span className="text-xs">Settings</span>
</SidebarMenuButton>
)}
</SidebarMenuItem>
</SidebarMenuItem>
) : (
<>
<SidebarMenuItem>
<SidebarMenuButton
size="sm"
className="gap-2 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground"
onClick={() => void navigate({ to: "/pr-review" })}
>
<GitPullRequestIcon className="size-3.5" />
<span className="text-xs">PR Review</span>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton
size="sm"
className="gap-2 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground"
onClick={() => void navigate({ to: "/settings" })}
>
<SettingsIcon className="size-3.5" />
<span className="text-xs">Settings</span>
</SidebarMenuButton>
</SidebarMenuItem>
</>
)}
</SidebarMenu>
</SidebarFooter>
</>
Expand Down
30 changes: 27 additions & 3 deletions apps/web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Route as rootRouteImport } from './routes/__root'
import { Route as ChatRouteImport } from './routes/_chat'
import { Route as ChatIndexRouteImport } from './routes/_chat.index'
import { Route as ChatSettingsRouteImport } from './routes/_chat.settings'
import { Route as ChatPrReviewRouteImport } from './routes/_chat.pr-review'
import { Route as ChatThreadIdRouteImport } from './routes/_chat.$threadId'

const ChatRoute = ChatRouteImport.update({
Expand All @@ -28,6 +29,11 @@ const ChatSettingsRoute = ChatSettingsRouteImport.update({
path: '/settings',
getParentRoute: () => ChatRoute,
} as any)
const ChatPrReviewRoute = ChatPrReviewRouteImport.update({
id: '/pr-review',
path: '/pr-review',
getParentRoute: () => ChatRoute,
} as any)
const ChatThreadIdRoute = ChatThreadIdRouteImport.update({
id: '/$threadId',
path: '/$threadId',
Expand All @@ -37,26 +43,35 @@ const ChatThreadIdRoute = ChatThreadIdRouteImport.update({
export interface FileRoutesByFullPath {
'/': typeof ChatIndexRoute
'/$threadId': typeof ChatThreadIdRoute
'/pr-review': typeof ChatPrReviewRoute
'/settings': typeof ChatSettingsRoute
}
export interface FileRoutesByTo {
'/$threadId': typeof ChatThreadIdRoute
'/pr-review': typeof ChatPrReviewRoute
'/settings': typeof ChatSettingsRoute
'/': typeof ChatIndexRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/_chat': typeof ChatRouteWithChildren
'/_chat/$threadId': typeof ChatThreadIdRoute
'/_chat/pr-review': typeof ChatPrReviewRoute
'/_chat/settings': typeof ChatSettingsRoute
'/_chat/': typeof ChatIndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/$threadId' | '/settings'
fullPaths: '/' | '/$threadId' | '/pr-review' | '/settings'
fileRoutesByTo: FileRoutesByTo
to: '/$threadId' | '/settings' | '/'
id: '__root__' | '/_chat' | '/_chat/$threadId' | '/_chat/settings' | '/_chat/'
to: '/$threadId' | '/pr-review' | '/settings' | '/'
id:
| '__root__'
| '/_chat'
| '/_chat/$threadId'
| '/_chat/pr-review'
| '/_chat/settings'
| '/_chat/'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
Expand Down Expand Up @@ -86,6 +101,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof ChatSettingsRouteImport
parentRoute: typeof ChatRoute
}
'/_chat/pr-review': {
id: '/_chat/pr-review'
path: '/pr-review'
fullPath: '/pr-review'
preLoaderRoute: typeof ChatPrReviewRouteImport
parentRoute: typeof ChatRoute
}
'/_chat/$threadId': {
id: '/_chat/$threadId'
path: '/$threadId'
Expand All @@ -98,12 +120,14 @@ declare module '@tanstack/react-router' {

interface ChatRouteChildren {
ChatThreadIdRoute: typeof ChatThreadIdRoute
ChatPrReviewRoute: typeof ChatPrReviewRoute
ChatSettingsRoute: typeof ChatSettingsRoute
ChatIndexRoute: typeof ChatIndexRoute
}

const ChatRouteChildren: ChatRouteChildren = {
ChatThreadIdRoute: ChatThreadIdRoute,
ChatPrReviewRoute: ChatPrReviewRoute,
ChatSettingsRoute: ChatSettingsRoute,
ChatIndexRoute: ChatIndexRoute,
}
Expand Down
Loading
Loading