Skip to content

fix(web): update .present-exit styles for improved accessibility and …#4132

Open
jzhishu wants to merge 2 commits into
nexu-io:mainfrom
jzhishu:fix/issue-4118-close-button-better-visibility
Open

fix(web): update .present-exit styles for improved accessibility and …#4132
jzhishu wants to merge 2 commits into
nexu-io:mainfrom
jzhishu:fix/issue-4118-close-button-better-visibility

Conversation

@jzhishu

@jzhishu jzhishu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #4118

Why

The HTML In this tab preview close button used a hardcoded light background, so it did not adapt when the app switched to dark mode. That made it look like a bright chip floating over the preview content instead of part of the viewer chrome.

This also made the control feel heavier than necessary and more likely to visually compete with page content underneath.

What users will see

In dark mode, the close button now uses theme colors, has clearer hover/focus/pressed states, and appears as a smaller, less intrusive control in the top-right corner.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates, or craft/
  • i18n keys — added new translation keys
  • New top-level dependency — adding any new root dependency
  • Default behavior change — changes what existing users experience without opting in
  • None — internal refactor, docs, tests, or translation update only

Screenshots

before
image

after
image

Bug fix verification

No red spec; this is a visual styling bug. Verified that the existing preview DOM/layout is unchanged and the close control now uses theme tokens instead of hardcoded light colors.

Validation

  • pnpm --filter @open-design/web test -- FileViewer.test.tsx
  • pnpm --filter @open-design/web typecheck
  • pnpm guard

@lefarcen lefarcen requested a review from PerishCode June 11, 2026 05:40
@lefarcen lefarcen added size/S PR changes 20-100 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels Jun 11, 2026

@PerishCode PerishCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found one blocking issue: the CSS offset change leaves an existing web test asserting the previous geometry, so the package test suite is now out of sync with the intended behavior.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

position: absolute;
top: calc(env(safe-area-inset-top, 0px) + 20px);
right: calc(env(safe-area-inset-right, 0px) + 20px);
top: calc(env(safe-area-inset-top, 0px) + 12px);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This offset change needs the existing web test updated in the same PR. apps/web/tests/components/FileViewer.test.tsx has a keeps the presentation exit button aligned with preview chrome spacing assertion that still expects right: calc(env(safe-area-inset-right, 0px) + 20px);, while this diff now ships + 12px. Once dependencies are installed, that focused web test will fail even though the CSS change may be intentional. Please update the test to assert the new geometry, or preserve the old 20px spacing if the test is still the intended invariant.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks. I updated the existing FileViewer assertion to match the new 12px inset and added coverage for the compact pill treatment so the test reflects the intended smaller close-control geometry.

@github-actions

Copy link
Copy Markdown
Contributor

Visual regression review

Head: 4e9f6b5 · Base: 1eac8fc

11 changed · 24 unchanged · 0 missing baseline · 0 failed

Changed cases

Case Main PR Diff
visual-design-system-detail main pr diff
visual-home-plugin-use-with-query main pr diff
visual-new-project-modal main pr diff
visual-project-avatar-model-dropdown main pr diff
visual-project-workspace main pr diff
visual-settings-byok main pr diff
visual-settings-byok-model-dropdown main pr diff
visual-settings-byok-openai main pr diff
visual-settings-execution main pr diff
visual-settings-local-cli main pr diff
visual-workspace-staged-contexts main pr diff
Unchanged cases
Case Main PR Diff
visual-avatar-local-agent-list main pr diff
visual-avatar-menu main pr diff
visual-design-systems main pr diff
visual-home main pr diff
visual-home-catalog main pr diff
visual-home-context-picker main pr diff
visual-home-plugin-filter main pr diff
visual-home-plugin-use-staged main pr diff
visual-home-staged-attachment main pr diff
visual-integrations main pr diff
visual-integrations-mcp main pr diff
visual-integrations-use-everywhere main pr diff
visual-onboarding-runtime main pr diff
visual-plugin-details main pr diff
visual-plugin-share-menu main pr diff
visual-plugins main pr diff
visual-projects main pr diff
visual-projects-kanban main pr diff
visual-settings-local-cli-model-dropdown main pr diff
visual-tasks main pr diff

Visual diff is advisory only and does not block merging.

@lefarcen

Copy link
Copy Markdown
Contributor

Hey @jzhishu@PerishCode’s blocker looks like the right next step here: the spacing change in apps/web/src/styles/viewer/composio.css now ships + 12px, so the existing apps/web/tests/components/FileViewer.test.tsx geometry assertion needs to move with it in the same PR.

Once that test expectation is updated and pushed, this should be back in a much healthier review state.

💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …):
Take over nexu-io/open-design#4132 until it merges — read https://raw.githubusercontent.com/nexu-io/looper/main/skills/pr-takeover/SKILL.md and follow it.

@PerishCode PerishCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jzhishu I reviewed the updated .present-exit styling and the matching FileViewer.test.tsx assertion on the current head. The prior blocker about the stale 20px geometry expectation is addressed, and the CSS stays within the existing viewer stylesheet and theme-token pattern. Nice follow-through on keeping the visual fix and regression coverage aligned.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen lefarcen added needs-validation Runtime change detected; needs human or /explore agent validation. and removed needs-validation Runtime change detected; needs human or /explore agent validation. labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk: regular code changes size/S PR changes 20-100 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark mode in-tab preview close button needs better visibility and placement

3 participants