feat: US-004 — App shell layout and sidebar navigation
- Add electron-store@8 for sidebar collapse state persistence via settings tRPC router - Add @fontsource/geist for self-hosted Geist font (remove Google Fonts CDN) - Add right-edge vertical 'keep scrolling for AI' label with chevron-down in all views - Wire AppShell collapse toggle to settings.setSidebarCollapsed tRPC mutation - Fix ESLint config with eslint-import-resolver-typescript to resolve @/* path aliases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { initTRPC } from '@trpc/server';
|
||||
import { z } from 'zod';
|
||||
import { getStore } from '../store';
|
||||
|
||||
const t = initTRPC.create();
|
||||
|
||||
@@ -134,6 +135,16 @@ const notesRouter = router({
|
||||
.mutation(() => null),
|
||||
});
|
||||
|
||||
const settingsRouter = router({
|
||||
getSidebarCollapsed: publicProcedure.query(() => getStore().get('sidebarCollapsed')),
|
||||
setSidebarCollapsed: publicProcedure
|
||||
.input(z.object({ collapsed: z.boolean() }))
|
||||
.mutation(({ input }) => {
|
||||
getStore().set('sidebarCollapsed', input.collapsed);
|
||||
return null;
|
||||
}),
|
||||
});
|
||||
|
||||
const aiRouter = router({
|
||||
chat: publicProcedure
|
||||
.input(z.object({
|
||||
@@ -152,6 +163,7 @@ const aiRouter = router({
|
||||
|
||||
export const appRouter = router({
|
||||
health: healthRouter,
|
||||
settings: settingsRouter,
|
||||
clients: clientsRouter,
|
||||
projects: projectsRouter,
|
||||
tasks: tasksRouter,
|
||||
|
||||
18
src/main/store.ts
Normal file
18
src/main/store.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Store from 'electron-store';
|
||||
|
||||
interface AppSettings {
|
||||
sidebarCollapsed: boolean;
|
||||
}
|
||||
|
||||
let _store: Store<AppSettings> | null = null;
|
||||
|
||||
export function getStore(): Store<AppSettings> {
|
||||
if (!_store) {
|
||||
_store = new Store<AppSettings>({
|
||||
defaults: {
|
||||
sidebarCollapsed: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
return _store;
|
||||
}
|
||||
Reference in New Issue
Block a user