Skip to content

feat(desktop): content max-width primitive + Help reading cap (D1)#184

Merged
qnbs merged 7 commits into
mainfrom
feat/desktop-content-width
Jun 20, 2026
Merged

feat(desktop): content max-width primitive + Help reading cap (D1)#184
qnbs merged 7 commits into
mainfrom
feat/desktop-content-width

Conversation

@qnbs

@qnbs qnbs commented Jun 18, 2026

Copy link
Copy Markdown
Owner

User description

Phase D1 — Critical & high-impact quick wins

Stacked on D0 (#183, base feat/desktop-ui-foundation). Part of the Tauri Desktop UI/UX remediation. CodeAnt review is deferred to the combined final pass over all open PRs per docs/CODEANT-LOOP-RUNBOOK.md.

What

  • Content-width primitivecomponents/ui/PageContainer.tsx renders .view-shell w-full. The cap lives in CSS (index.css: body.is-desktop .view-shell { max-width: var(--width-content); margin-inline: auto }, --width-content: 72rem), so it only applies inside the Tauri WebView (body.is-desktop). The PWA stays full-width/byte-equivalent.
  • Wrapped content-light views: Dashboard, Settings, Help, Character, World, Export. Editor / Plot Board / Mind Map are intentionally not wrapped — they own their width.
  • HelpView: prose max-w-noneprose max-w-[var(--sc-prose-measure)] (65ch reading cap) — a readability win on web + desktop.

Audit catalog

Resolves C-1, C-2, and the width half of C-3 in docs/DESKTOP-UI-AUDIT.md. Fluid-type tuning (rest of C-3) is deferred to D2.

Tests / gates

  • tests/unit/PageContainer.test.tsx (4) + stories/PageContainer.stories.tsx.
  • Green locally: typecheck, lint, token:audit (160 ≤ 165 baseline — no new violations), 40 touched-view tests.

Scope guarantees

  • No dark: prefix; new --width-content token only. PWA DOM unchanged (wrapper is an inert div on the web; the cap is .is-desktop-scoped).

🤖 Generated with Claude Code


CodeAnt-AI Description

Center key desktop views and cap Help article width

What Changed

  • Dashboard, Settings, Help, World, and Export now open inside a centered content area on desktop, while staying full-width on the web.
  • Export keeps its full-height layout while using the new centered wrapper.
  • Help articles now use a shorter reading width, making long pages easier to scan and read.
  • Added coverage for the shared wrapper and a Storybook example to show how it behaves.

Impact

✅ Cleaner desktop reading layout
✅ Less wide, harder-to-scan help pages
✅ Same full-width web experience

💡 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.

qnbs and others added 2 commits June 18, 2026 00:04
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>
Add the PageContainer/.view-shell width primitive: content-light views
(Dashboard, Settings, Help, Character, World, Export) centre at the desktop
work-width (--width-content: 72rem) inside the Tauri WebView (body.is-desktop)
and stay full-width on the PWA. Editor / Plot Board / Mind Map keep their own
width and are intentionally not wrapped.

Cap HelpView long-form prose to the 65ch reading measure
(prose max-w-[var(--sc-prose-measure)]) — a readability win on web + desktop.

Resolves C-1/C-2 and the width half of C-3 in docs/DESKTOP-UI-AUDIT.md.
Adds PageContainer unit test (4) + Storybook story; typecheck/lint/token-audit
green; 40 touched-view tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Jun 18, 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

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
worldscript-studio Ready Ready Preview, Comment Jun 20, 2026 11:40am

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 18, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread components/ExportView.tsx Outdated
@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

…ut survives (CodeAnt #184)

ExportViewUI's root is a full-height grid (h-full + inner overflow-y-auto columns),
but the new width-capping PageContainer wrapper only set w-full, collapsing the
height chain. Pass className="h-full" so the contract is preserved.

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 introduces a shared page container that caps desktop content width for wrapped views and adds a reading-width cap to Help articles while keeping the PWA full-width.

sequenceDiagram
    participant User
    participant App
    participant PageContainer
    participant Styles

    User->>App: Open Help view
    App->>App: Detect desktop shell and tag body as desktop
    App->>PageContainer: Render HelpView UI inside page container
    Styles-->>PageContainer: Apply desktop content max width and centering
    App->>App: Render help article with prose reading width cap
    PageContainer-->>User: Show centered help content with limited line length
Loading

Generated by CodeAnt AI

Base automatically changed from feat/desktop-ui-foundation to main June 20, 2026 11:09
…width

# Conflicts:
#	App.tsx
#	docs/DESKTOP-UI-AUDIT.md
#	graphify-out/GRAPH_REPORT.md
#	index.css
#	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 53fe7c6 into main Jun 20, 2026
6 of 8 checks passed
@qnbs
qnbs deleted the feat/desktop-content-width branch June 20, 2026 11:39
@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 the size:L This PR changes 100-499 lines, ignoring generated files label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant