Skip to content

feat(ui): readability + body font + phase auto-collapse polish bundle#24

Merged
Nkburdick merged 1 commit intomainfrom
feat/tasks-readability-polish
May 1, 2026
Merged

feat(ui): readability + body font + phase auto-collapse polish bundle#24
Nkburdick merged 1 commit intomainfrom
feat/tasks-readability-polish

Conversation

@Nkburdick
Copy link
Copy Markdown
Owner

@Nkburdick Nkburdick commented May 1, 2026

Summary

Phase 2 polish round for Oracle App — six surgical UI changes Nick + Alfred iterated on during a Cloudflare-tunnel session 2026-04-30.

# Change File
1 Task description font: text-xs (12px) → text-sm (14px), mt-0.5mt-1 TaskRow.svelte
2 Task title weight: default → font-semibold (clearer hierarchy vs description) TaskRow.svelte
3 Body font: Geist Mono → SF / system-ui sans, 14px → 15px app.css
4 Light mode --muted-foreground: 55% → 44% lightness (more contrast) app.css
5 Dark mode --muted-foreground: 68% → 78% lightness (more contrast) app.css
6 Phase sections auto-collapse when all tasks done, expand when anything pending TaskBoard.svelte
(dev only) server.allowedHosts for Cloudflare quick tunnels vite.config.ts

Why

Nick during 2026-04-27 EOD soak: "hard to read; dark mode better than light, but Tasks area description font needs to be bigger; eyes-at-47 want more contrast in BOTH modes and a slightly easier-to-read body font."

Plus 2026-04-30: "I would like the phases to be collapsed if everything is clicked off ... default to being expanded if there's something that still needs to be checked off."

Phase auto-collapse behavior

  • Section with every task done → defaults collapsed
  • Section with anything pending → defaults expanded
  • Section with no tasks → defaults expanded (so empty-state is visible)
  • User toggle always wins — clicking the chevron inverts whatever's currently showing and snapshots it (no "user clicks expand but nothing happens" bug)
  • When the last pending task in a section is marked done, that section auto-collapses on the spot

Discovery during the scan

  • GH #35 (auto-scroll chat + new-message pill) is already implemented in both project + area +page.svelte chat thread files (AC-15/16/17 referenced in code). Stale task entry — will be marked done in tasks.json separately.

Test plan

  • Dev-server preview tested on iPhone via Cloudflare Tunnel (https://reserves-pump-action-patents.trycloudflare.com)
  • Light mode: task descriptions + phase labels noticeably more readable
  • Dark mode: muted text contrast improved without losing hierarchy
  • Title vs description distinction reads cleanly at a glance
  • Phase auto-collapse: Phase 0/1 tucked away on load, Phase 2/3 expanded, manual toggle works in both directions
  • Production smoke test on oracle.aptoworks.cloud after merge

Closes

  • pai-p2-ux-readability-polish (PAI Orch v1 Phase 2)
  • pai-p2-ux-collapse-phases (PAI Orch v1 Phase 2)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style

    • Updated muted text colors in both light and dark themes for improved visual hierarchy.
    • Improved base typography with a cleaner system sans-serif font and optimized sizing.
    • Enhanced task display typography for better readability.
  • Improvements

    • Task board sections now intelligently collapse when all tasks are marked complete, while respecting manual toggles.

PAI Orch v1 Phase 2 polish round — surfaced 2026-04-27 EOD by Nick during
soak ("hard to read; dark mode better than light, but Tasks area description
font needs to be bigger; eyes-at-47 want more contrast in BOTH modes and a
slightly easier-to-read body font") + 2026-04-30 ("collapse phase sections
when everything is checked off").

WHAT CHANGED

Body typography (app.css)
  - Added --font-sans token: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', Roboto, system-ui, sans-serif. Uses iOS native San Francisco
    on Nick's primary device (PWA on iPhone).
  - html/body font-family: var(--font-mono) -> var(--font-sans).
  - html/body font-size: 14px -> 15px.
  - Code/pre/kbd remain on var(--font-code) (JetBrains Mono Variable).

Task row hierarchy (TaskRow.svelte)
  - Title: added font-semibold (600) for clearer separation from description.
  - Description: text-xs (12px) -> text-sm (14px); mt-0.5 -> mt-1 for breathing
    room.

Muted-foreground contrast (app.css)
  - Light mode lightness 55.1% -> 44% (deeper gray, same hue/chroma — more
    legible against white).
  - Dark mode lightness 68.3% -> 78% (lighter gray — more legible against
    near-black background).
  - Affects all secondary text app-wide: task descriptions, phase labels,
    timestamps, blockquote text, scrollbar hover, etc.

Phase auto-collapse (TaskBoard.svelte) — closes pai-p2-ux-collapse-phases
  - isCollapsed() now takes section.tasks and returns:
      * user-toggled value if explicit (always wins)
      * else: true when every task in section is status=done
      * else: false (default expanded)
  - toggleSection() inverts the *currently visible* state (whether explicit
    or auto-default) so a user can always expand a fully-done section even
    if they have no prior toggle.
  - Result: page loads with completed phases tucked away (Phase 0/1) and
    in-flight phases expanded (Phase 2/3). When the last pending task in a
    phase is marked done, that phase auto-collapses on the spot.

Dev tooling (vite.config.ts)
  - server.allowedHosts: ['.trycloudflare.com', 'localhost', '127.0.0.1']
    so Cloudflare quick tunnels (used during this polish iteration) reach
    the dev server. Dev-only — has zero effect on production builds.

NOT IN BUNDLE (already shipped, discovered during scan)
  - Auto-scroll chat + new-message pill (was tracked as GH#35) — implemented
    in both project & area chat thread +page.svelte files with AC-15/16/17
    references. Stale-task entry; will be marked done in tasks.json.

TEST PLAN

- [x] Dev-server preview verified on iPhone via Cloudflare Tunnel
- [x] Light mode: task description and phase labels noticeably more readable
- [x] Dark mode: muted text contrast improved without losing hierarchy
- [x] Title/description hierarchy: bold title + larger sub-text reads cleanly
- [x] Phase auto-collapse: completed phases tucked away on load, pending
      phases expanded, manual toggle still works in both directions
- [ ] Production deploy — visual regression sweep on the live oracle.aptoworks.cloud

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

Updated theme tokens with new sans-serif font family and adjusted muted text colors. Refactored TaskBoard section collapse logic to compute state from user preferences or task completion status. Enhanced TaskRow typography styling. Added Cloudflare tunnel and localhost to Vite server allowed hosts.

Changes

Cohort / File(s) Summary
Theme & Typography
src/app.css
Added --font-sans theme token with system UI sans-serif stack. Adjusted --muted-foreground color values in light and dark modes. Changed base html, body typography from monospace 14px to sans-serif 15px.
Component Logic & Styling
src/lib/components/TaskBoard.svelte, src/lib/components/TaskRow.svelte
Introduced isCollapsed(name, sectionTasks) function in TaskBoard to compute effective collapse state: uses explicit collapsed toggle if set, otherwise defaults to collapsed only when section has tasks with all statuses 'done'. Enhanced TaskRow typography with font-semibold on task content and increased description text size from text-xs to text-sm.
Server Configuration
vite.config.ts
Extended Vite dev server configuration to add server.allowedHosts permitting .trycloudflare.com, localhost, and 127.0.0.1 while retaining existing server.fs.allow setting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through sans-serif halls,
collapsing done tasks like stored acorn balls,
muted hues guide the way,
Cloudflare tunnels let friends play,
typography dances—the UI enthralls!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title comprehensively covers all major changes: readability improvements (muted-foreground contrast), body font switch (sans-serif), phase auto-collapse behavior, and the dev config polish.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tasks-readability-polish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/components/TaskBoard.svelte`:
- Around line 68-83: The auto-collapse logic in isCollapsed/toggleSection causes
sections to unmount while a task's 5s undo toast is live; modify isCollapsed
(and the related collapse behavior used at lines referenced 174-194) to treat
any task with an active undo as "not done" by checking a shared undo state
(e.g., a task.undoActive flag or a central pendingUndo map) and returning false
if any task in section has undoActive, and ensure toggleSection does not invert
to a collapsed state when an undo is active for the section; this keeps TaskRow
mounted until the undo window closes (or alternatively hoist the toast out of
TaskRow and use the same shared undo state).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 94691a17-3ded-4082-a87e-c84be643409f

📥 Commits

Reviewing files that changed from the base of the PR and between 47a7dbd and 4786e4d.

📒 Files selected for processing (4)
  • src/app.css
  • src/lib/components/TaskBoard.svelte
  • src/lib/components/TaskRow.svelte
  • vite.config.ts

Comment on lines +68 to 83
function isCollapsed(name: string | null, sectionTasks: Task[]): boolean {
const key = collapseKey(name);
collapsed[key] = !collapsed[key];
// User-toggled state always wins.
if (key in collapsed) return collapsed[key];
// Default: collapse the section when every task is done — keeps "live"
// sections (anything still pending) visible by default and tucks away
// fully-completed phases automatically.
if (sectionTasks.length === 0) return false;
return sectionTasks.every((t) => t.status === 'done');
}

function isCollapsed(name: string | null): boolean {
return collapsed[collapseKey(name)] ?? false;
function toggleSection(name: string | null, sectionTasks: Task[]) {
const key = collapseKey(name);
// Invert the *currently visible* state (whether explicit or default).
collapsed[key] = !isCollapsed(name, sectionTasks);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Do not auto-collapse a section while its undo toast is still live.

When the last pending task flips to done, this logic hides the entire list immediately. That unmounts TaskRow.svelte and drops the 5s undo toast before the user can revert the completion, so the new collapse behavior breaks an existing recovery path.

Please keep the section mounted until the undo window closes, or hoist the toast out of the row component.

Also applies to: 174-194

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/components/TaskBoard.svelte` around lines 68 - 83, The auto-collapse
logic in isCollapsed/toggleSection causes sections to unmount while a task's 5s
undo toast is live; modify isCollapsed (and the related collapse behavior used
at lines referenced 174-194) to treat any task with an active undo as "not done"
by checking a shared undo state (e.g., a task.undoActive flag or a central
pendingUndo map) and returning false if any task in section has undoActive, and
ensure toggleSection does not invert to a collapsed state when an undo is active
for the section; this keeps TaskRow mounted until the undo window closes (or
alternatively hoist the toast out of TaskRow and use the same shared undo
state).

@Nkburdick Nkburdick merged commit 14789cd into main May 1, 2026
2 checks passed
@Nkburdick Nkburdick deleted the feat/tasks-readability-polish branch May 1, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant