fix(desktop): address code-review findings on the desktop wave
- fileEntries: a single unreadable file/dir in a dropped folder no longer aborts the whole traversal (try/catch per entry, skip failures) — was discarding ALL dropped files (incl. the flat-file path) + an unhandled rejection; also add .catch in both useFileDrop consumers. - RoomInput: mirror a localStorage-restored draft into the draft atom so the P5-57 indicator reflects a persisted draft after a page reload, not only on same-session room re-entry. - useTauriThumbbar: swallow toggleMicrophone()/hangup() rejections (parity with SMTC) — avoids an unhandled rejection when clicked mid-teardown. - App/DesktopChrome: keep wrapper element types stable across the chrome toggle (display:contents when off) so flipping it no longer remounts RouterProvider. - settings: normalizeComposerToolbarOrder also appends missing keys from the canonical key set (safety net if a new button is absent from the default order). Gates: tsc/eslint/prettier clean, build OK, 559 tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+17
-4
@@ -100,11 +100,24 @@ function TauriEffects() {
|
||||
function DesktopChrome({ children }: { children: ReactNode }) {
|
||||
const customChrome = useAtomValue(customWindowChromeAtom);
|
||||
useTauriWindowChrome();
|
||||
if (!(isTauri() && customChrome)) return <>{children}</>;
|
||||
const useChrome = isTauri() && customChrome;
|
||||
// Keep the wrapper element structure STABLE across the toggle so flipping the
|
||||
// setting never changes the element type in `children`'s ancestry — otherwise
|
||||
// React would unmount/remount the whole RouterProvider subtree (losing scroll,
|
||||
// menus, unsaved composer state). When off, both wrappers use `display:contents`
|
||||
// so they generate no box → zero layout impact (also the browser default path).
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', height: '100vh' }}>
|
||||
<TitleBar />
|
||||
<div style={{ flexGrow: 1, minHeight: 0 }}>{children}</div>
|
||||
<div
|
||||
style={
|
||||
useChrome
|
||||
? { display: 'flex', flexDirection: 'column', height: '100vh' }
|
||||
: { display: 'contents' }
|
||||
}
|
||||
>
|
||||
{useChrome && <TitleBar />}
|
||||
<div style={useChrome ? { flexGrow: 1, minHeight: 0 } : { display: 'contents' }}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user