feat(desktop): Tauri desktop UI/UX foundation + audit catalog (D0)#183
Conversation
Phase D0 of the Tauri desktop UI/UX remediation β the scoping hook + audit catalog, no visual change. - services/tauriRuntime.ts: getDesktopOs() (UA-based) + applyDesktopRuntimeFlags() which tags document.body with `is-desktop` + `data-os` (windows/macos/linux). Idempotent; no-op on the web. - App.tsx: call applyDesktopRuntimeFlags() once on mount. - index.css: scaffold the `.is-desktop` CSS layer (empty placeholder) so every desktop-specific override is scoped and the PWA stays untouched. - docs/DESKTOP-UI-AUDIT.md: code-derived finding catalog (C-1β¦C-10) + the screenshot-matrix template for the human visual pass that grounds D1βD4. Verified: typecheck, lint (0 warnings), 11 tauriRuntime tests (new getDesktopOs + applyDesktopRuntimeFlags coverage). Web build unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
|
@CodeAnt-AI review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
Sequence DiagramThis PR makes the root app tag the document body with desktop-specific flags in Tauri so future desktop-only CSS can be scoped without affecting the PWA. sequenceDiagram
participant User
participant DesktopApp
participant TauriRuntime
participant DOM
participant CSSLayer
User->>DesktopApp: Launch Tauri desktop app
DesktopApp->>DesktopApp: Mount App component
DesktopApp->>TauriRuntime: applyDesktopRuntimeFlags()
TauriRuntime->>TauriRuntime: Detect Tauri runtime and desktop OS from user agent
TauriRuntime->>DOM: Add is-desktop class and data-os to body
DOM->>CSSLayer: Enable desktop scoped styles under body.is-desktop
Generated by CodeAnt AI |
β¦aulting to linux (CodeAnt #183) An unrecognized/empty user agent silently classified the runtime as 'linux', applying the wrong per-OS desktop CSS quirks. Now detects linux explicitly (linux|x11|cros) and returns null otherwise; applyDesktopRuntimeFlags already skips data-os when null. 3 new test cases cover empty/unknown/SunOS UAs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
1 similar comment
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
Sequence DiagramThis PR adds a Tauri-only startup flow where the app detects the desktop OS from the user agent and tags the document body with desktop-specific flags for future scoped styling, while remaining a no-op in the web/PWA build. sequenceDiagram
participant App
participant DesktopRuntime
participant DOM
App->>DesktopRuntime: applyDesktopRuntimeFlags on mount
DesktopRuntime->>DesktopRuntime: Check if Tauri runtime
alt Running in Tauri
DesktopRuntime->>DesktopRuntime: getDesktopOs from user agent
DesktopRuntime->>DOM: Add is-desktop class to body
alt OS detected
DesktopRuntime->>DOM: Set body data-os attribute
else Unknown OS
DesktopRuntime->>DOM: Leave data-os unset
end
else Running on web
DesktopRuntime->>DOM: No changes to body
end
Generated by CodeAnt AI |
β¦wave-2) Tauri v2 commonly runs with withGlobalTauri disabled, exposing only __TAURI_INTERNALS__ (not __TAURI__). Checking only __TAURI__ short-circuited every desktop-gated path (menus, tray, OS class) to false in real desktop builds. Now accepts either global. New test covers the internals-only case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
1 similar comment
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
Sequence DiagramThis PR adds a desktop-only runtime hook so that when running under Tauri, the app tags the document body with a desktop flag and OS hint, enabling future desktop-scoped CSS without affecting the PWA. sequenceDiagram
participant User
participant DesktopApp
participant App
participant Runtime
participant DOM
User->>DesktopApp: Launch desktop application
DesktopApp->>App: Mount React root component
App->>Runtime: applyDesktopRuntimeFlags()
Runtime->>Runtime: Detect Tauri runtime and desktop OS
alt Running under Tauri
Runtime->>DOM: Add is-desktop class and os data attribute to body
else Running in browser or unknown
Runtime-->>App: No desktop flags applied
end
Generated by CodeAnt AI |
β¦ation # Conflicts: # App.tsx # graphify-out/GRAPH_REPORT.md # services/tauriRuntime.ts # tests/unit/tauriRuntime.test.ts
Thanks for using CodeAnt! πWe're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X Β· |
| isIdbEncryptionReady, | ||
| } from './services/storage/storageEncryptionService'; | ||
| import { initTauriDeepLink } from './services/tauriDeepLink'; | ||
| import { applyDesktopRuntimeFlags } from './services/tauriRuntime'; |
There was a problem hiding this comment.
Suggestion: The new import targets a symbol that is not exported by services/tauriRuntime.ts in this codebase, which breaks the module contract and will fail at build/runtime import resolution. Either add and export applyDesktopRuntimeFlags from tauriRuntime.ts in this batch, or remove this import/call until that export exists. [import error]
Severity Level: Critical π¨
- β pnpm run typecheck fails on missing export symbol.
- β pnpm run build fails, preventing application bundles.
- β οΈ Desktop runtime flags feature unusable until export added.Steps of Reproduction β
1. Open `/workspace/WorldScript-Studio/App.tsx` and note that at line 73 it imports `{
applyDesktopRuntimeFlags }` from `'./services/tauriRuntime'` (seen in the file header
section around lines 60β75).
2. Open `/workspace/WorldScript-Studio/services/tauriRuntime.ts` and observe that it only
exports `isTauriRuntime` (lines 3β12), `getTauriAppVersion` (lines 14β21), and
`openTauriDataDirectory` (lines 24β37), with no `applyDesktopRuntimeFlags` export defined
anywhere in the file.
3. Run `pnpm run typecheck` as defined in `package.json` scripts (lines 21β55), which
invokes `tsgo` to type-check the entire TypeScript project including `App.tsx`.
4. During typechecking, the compiler resolves `./services/tauriRuntime` for the named
import at `App.tsx:73`, fails to find an exported member `applyDesktopRuntimeFlags` in
`services/tauriRuntime.ts`, and emits an error like "Module './services/tauriRuntime' has
no exported member 'applyDesktopRuntimeFlags'", causing the command to exit with a
non-zero status and blocking builds/CI.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent π€
This is a comment left during a code review.
**Path:** App.tsx
**Line:** 73:73
**Comment:**
*Import Error: The new import targets a symbol that is not exported by `services/tauriRuntime.ts` in this codebase, which breaks the module contract and will fail at build/runtime import resolution. Either add and export `applyDesktopRuntimeFlags` from `tauriRuntime.ts` in this batch, or remove this import/call until that export exists.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fixsquash-merge The #183 squash-merge resolution took main's services/tauriRuntime.ts (which lacked these helpers) while App.tsx β now on main β imports and calls applyDesktopRuntimeFlags, breaking the typecheck. Restored DesktopOs/getDesktopOs (null for unknown UA, no silent linux default) + applyDesktopRuntimeFlags and their unit tests. Typecheck clean; tauriRuntime suite green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
User description
Context
Phase D0 of the Tauri desktop UI/UX remediation. The app was tuned as a PWA; the desktop (WebView2/WebKit/WebKitGTK) presentation has deficits. This PR lands the scoping foundation so every later desktop fix is additive and PWA-safe, plus the grounded audit catalog. No visual change.
What changed
services/tauriRuntime.tsβgetDesktopOs()(UA-based: windows/macos/linux) +applyDesktopRuntimeFlags()which tagsdocument.bodywithis-desktop+data-os. Idempotent; no-op on the web.App.tsxβ callsapplyDesktopRuntimeFlags()once on mount (alongside the theme/appearance body-class effects).index.cssβ scaffolds the.is-desktopCSS layer (empty placeholder) so desktop overrides are scoped underbody.is-desktop(+data-osfor per-engine quirks) and the PWA stays untouched.docs/DESKTOP-UI-AUDIT.mdβ code-derived finding catalog (C-1β¦C-10: content max-width, Help measure, fluid-type ceiling, touch-target chunkiness, glass perf, native menu, per-OS quirks, HiDPIβ¦) + the screenshot-matrix template for the human visual pass that grounds D1βD4.Why no visual change
body.is-desktopis only added inside the Tauri WebView (__TAURI__present), and the.is-desktopCSS layer is an empty placeholder. The web build is byte-equivalent.Verification
pnpm run typecheckβpnpm run lint(--error-on-warnings) βpnpm exec vitest run tests/unit/tauriRuntime.test.tsβ β 11 tests (newgetDesktopOs+applyDesktopRuntimeFlagscoverage)docs/DESKTOP-UI-AUDIT.md.π€ Generated with Claude Code
CodeAnt-AI Description
Set up desktop-scoped styling and fix desktop runtime detection
What Changed
Impact
β Desktop-only changes stay out of the web appβ Fewer wrong per-OS desktop tweaksβ Clearer path for desktop UI fixesπ‘ Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.