Skip to content

fix(app): preserve session tab titles with horizontal scrolling on mobile - #39299

Closed
DevDengChao wants to merge 5 commits into
anomalyco:devfrom
DevDengChao:tab-horizontal-scroll
Closed

fix(app): preserve session tab titles with horizontal scrolling on mobile#39299
DevDengChao wants to merge 5 commits into
anomalyco:devfrom
DevDengChao:tab-horizontal-scroll

Conversation

@DevDengChao

@DevDengChao DevDengChao commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #39302, #38974

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When many session tabs are open on a mobile browser, each tab slot shrinks from 224px to 28px via flex-shrink. A CSS @container (max-width: 64px) query then hides the title and centers the close button, making sessions unidentifiable.

This PR fixes the issue by:

  1. Changing flex-shrink to shrink-0 on tab slot wrappers so each tab maintains its full 224px width
  2. Removing the @container (max-width: 64px) block that hid titles on narrow tabs

The existing overflow-x-auto scroll container already supports horizontal scrolling natively, so mobile users can swipe left/right to see additional tabs.

How did you verify your code works?

image
  • Confirmed tabs maintain 224px width when many are open (no longer shrink to icon-only)
  • Verified the scroll container enables horizontal swipe scrolling on mobile
  • Checked that left/right fade indicators still appear when content overflows
  • Verified desktop drag-and-drop and keyboard shortcuts remain functional

Screenshots / recordings

d73f25770707582c0ef5d3d5e77d3ead 1bd3d0147878b912bcd2374fd054b0a9

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…bile

- Change tab slot flex-shrink to shrink-0 so tabs maintain full 224px width
- Remove @container (max-width: 64px) query that hid titles on narrow tabs
- Existing overflow-x-auto scroll container handles swipe scrolling natively
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue and removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

- Add TitlebarTabStrip story for visual verification of tab scrolling
- Add context mocks for global, tabs, server, and session-tab-avatar
- Register new mocks in storybook main.ts aliases
- Add createTabPromptState export to prompt mock

Note: storybook/play assertions require @storybook/test which has
pre-existing resolution issues in this monorepo setup. Assertions
should be added once the storybook environment is fixed.
- Add self-contained story testing shrink-0 CSS fix (no workspace deps)
- Add Playwright smoke test verifying: 8 tab titles visible, scroll
  overflow, tab slots >= 200px width
- Fix preview.tsx to use relative imports for workspace CSS
- Update main.ts with direct alias mutation pattern (storybook docs)
- Add context mocks and session-tab-avatar stub for future stories
- Test passes: 1/1 assertions verified against storybook dev server
- Add mobile-tab-scroll.spec.ts testing real component behavior
- Mock server with 8 sessions, seed localStorage, mobile viewport
- Assert: 8 tab slots rendered, titles visible, slots >= 200px,
  scroll container overflows horizontally
- Remove storybook story, mocks, and test config (not viable)
- Restore storybook main.ts, preview.tsx, prompt.ts to originals
- Test passes: 1/1 (28.1s)
@DevDengChao
DevDengChao marked this pull request as ready for review July 28, 2026 14:04
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(app): session tab titles hidden on mobile with many open tabs

1 participant