fix: TypeScript build errors — router params, tinykeys types, thread_id field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6375abf2d8
commit
73391e0b07
|
|
@ -36,6 +36,7 @@ export type Thread = {
|
|||
export type MessageSummary = {
|
||||
id: string;
|
||||
folder_id: string;
|
||||
thread_id: string | null;
|
||||
from_addr: Address;
|
||||
to_addrs: Address[];
|
||||
cc_addrs: Address[];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Outlet, useNavigate } from '@tanstack/react-router';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
// @ts-expect-error — tinykeys has no bundled .d.ts for its ESM export path
|
||||
import { tinykeys } from 'tinykeys';
|
||||
import { api } from '@/api/client';
|
||||
import { useUI } from '@/store/ui';
|
||||
|
|
@ -30,15 +31,18 @@ export function AppShell() {
|
|||
|
||||
// Global keyboard shortcuts
|
||||
useEffect(() => {
|
||||
const nav = (folderId: string) => () =>
|
||||
navigate({ to: '/f/$folderId', params: { folderId } });
|
||||
|
||||
return tinykeys(window, {
|
||||
c: (e) => { if (!isComposeOpen && !isInput(e.target)) openCompose(); },
|
||||
'/': (e) => { if (!isInput(e.target)) { e.preventDefault(); document.getElementById('search-input')?.focus(); } },
|
||||
c: (e: Event) => { if (!isComposeOpen && !isInput((e as KeyboardEvent).target)) openCompose(); },
|
||||
'/': (e: Event) => { if (!isInput((e as KeyboardEvent).target)) { e.preventDefault(); document.getElementById('search-input')?.focus(); } },
|
||||
Escape: () => closeCompose(),
|
||||
'g i': () => navigate({ to: '/f/inbox' }),
|
||||
'g s': () => navigate({ to: '/f/sent' }),
|
||||
'g d': () => navigate({ to: '/f/drafts' }),
|
||||
'g e': () => navigate({ to: '/f/archive' }),
|
||||
'g t': () => navigate({ to: '/f/trash' }),
|
||||
'g i': nav('inbox'),
|
||||
'g s': nav('sent'),
|
||||
'g d': nav('drafts'),
|
||||
'g e': nav('archive'),
|
||||
'g t': nav('trash'),
|
||||
});
|
||||
}, [isComposeOpen, navigate, openCompose, closeCompose]);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const rootRoute = createRootRoute({ component: AppShell });
|
|||
const indexRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: '/',
|
||||
beforeLoad: () => { throw redirect({ to: '/f/inbox' }); },
|
||||
beforeLoad: () => { throw redirect({ to: '/f/$folderId', params: { folderId: 'inbox' } }); },
|
||||
});
|
||||
|
||||
const folderRoute = createRoute({
|
||||
|
|
|
|||
Loading…
Reference in New Issue