Skip to content

feat(desktop): Tauri desktop UI/UX foundation + audit catalog (D0)#183

Merged
qnbs merged 5 commits into
mainfrom
feat/desktop-ui-foundation
Jun 20, 2026
Merged

feat(desktop): Tauri desktop UI/UX foundation + audit catalog (D0)#183
qnbs merged 5 commits into
mainfrom
feat/desktop-ui-foundation

Conversation

@qnbs

@qnbs qnbs commented Jun 17, 2026

Copy link
Copy Markdown
Owner

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 tags document.body with is-desktop + data-os. Idempotent; no-op on the web.
  • App.tsx β€” calls applyDesktopRuntimeFlags() once on mount (alongside the theme/appearance body-class effects).
  • index.css β€” scaffolds the .is-desktop CSS layer (empty placeholder) so desktop overrides are scoped under body.is-desktop (+ data-os for 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-desktop is only added inside the Tauri WebView (__TAURI__ present), and the .is-desktop CSS 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 (new getDesktopOs + applyDesktopRuntimeFlags coverage)
  • Visual pass (screenshot matrix across Win/mac/Linux Γ— widths Γ— themes Γ— DPI) is the human step seeded in docs/DESKTOP-UI-AUDIT.md.

CodeAnt review deferred β€” processed later in the combined loop per docs/CODEANT-LOOP-RUNBOOK.md.

πŸ€– Generated with Claude Code


CodeAnt-AI Description

Set up desktop-scoped styling and fix desktop runtime detection

What Changed

  • Desktop app screens now get a dedicated styling scope, so later desktop-only changes can be applied without affecting the web/PWA version.
  • The app now marks Tauri desktop sessions with OS-specific desktop context on launch, enabling per-OS desktop behavior.
  • Added a desktop UI/UX audit tracker with the main layout, readability, and desktop-specific issues to verify in follow-up phases.
  • Fixed desktop runtime detection so unknown or empty browser data no longer gets treated as Linux, and Tauri sessions are recognized in more desktop setups.

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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>
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldscript-studio Error Error Jun 20, 2026 11:10am

@codeant-ai

codeant-ai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 17, 2026
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 20, 2026
@qnbs

qnbs commented Jun 20, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 20, 2026
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

Comment thread services/tauriRuntime.ts Outdated
…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>
@qnbs

qnbs commented Jun 20, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

1 similar comment
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 20, 2026
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

Comment thread services/tauriRuntime.ts Outdated
…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>
@qnbs

qnbs commented Jun 20, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

1 similar comment
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@codeant-ai codeant-ai Bot removed the size:L This PR changes 100-499 lines, ignoring generated files label Jun 20, 2026
@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 20, 2026
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

…ation

# Conflicts:
#	App.tsx
#	graphify-out/GRAPH_REPORT.md
#	services/tauriRuntime.ts
#	tests/unit/tauriRuntime.test.ts
@codeant-ai

codeant-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! πŸŽ‰

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X Β·
Reddit Β·
LinkedIn

@qnbs
qnbs merged commit 68cefd2 into main Jun 20, 2026
6 of 8 checks passed
@qnbs
qnbs deleted the feat/desktop-ui-foundation branch June 20, 2026 11:09
@codeant-ai codeant-ai Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 20, 2026
Comment thread App.tsx
isIdbEncryptionReady,
} from './services/storage/storageEncryptionService';
import { initTauriDeepLink } from './services/tauriDeepLink';
import { applyDesktopRuntimeFlags } from './services/tauriRuntime';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in VSCode Claude

(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 fix
πŸ‘ | πŸ‘Ž

qnbs added a commit that referenced this pull request Jun 20, 2026
 squash-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant