Skip to content

fix(content): keep a long title or pick inside the New content dialog - #1318

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/content-dialog-overflow
Oct 21, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/content-dialog-overflow

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Found on production: Library → + New content → Create from scratch, then picking an opportunity with a long title (e.g. "Defend the coffee subscription comparison with up-to-date pricing and shipping details").

  • What went wrong: the dialog overflowed its right edge.
    • The picker grew wider than the dialog, and the "Optimize content" card and Continue were pushed outside it.
    • After Continue, Start's long title did the same to the page type chips, the "Who does it" cards and Open editor.
  • Cause: DialogContent is a CSS grid with one auto-sized column, and that column takes the width of its widest content.
    • The picked value is a bare text node inside the combobox trigger, so the trigger's truncate couldn't cut it.
    • Start's title is truncate too, but its single line still set the column's minimum width.
  • Also too tall: on a laptop-height window (650 px), Start was taller than the window. Its title and Back / Open editor fell outside it, out of reach.
  • Fix (new-content-dialog.tsx only):
    • the dialog's column is grid-cols-[minmax(0,1fr)], so content can't widen it and long text truncates;
    • the picked value sits in its own min-w-0 flex-1 truncate span beside the chevron;
    • the dialog is at most the window's height (max-h-[calc(100dvh-2rem)]) and scrolls, with its footer sticky so the buttons stay in view;
    • it is wider, 672 px (sm:max-w-2xl) instead of 576 px, so the page type chips and the options wrap less.

Related issue

None. Reported in the app.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Library → + New content → Create from scratch → pick the longest opportunity. The pick ends in "…" inside the field, and Continue stays inside the dialog.
  2. Continue. The title ends in "…", and the chips, cards and Open editor stay inside.
  3. Optimize content with a very long URL typed: nothing leaves the dialog either.

Checked with the longest titles and own pages with very long paths, in light and dark. The flows: Library (opportunity, prompt, topic → Continue) and the Plan's Optimize, Create and View. The sizes: 1366×650, 1280×800 and 1024×768. In every step, nothing went past the dialog's edges and the dialog stayed inside the window (measured in the page).

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): no errors; the 6 warnings are in files this PR does not touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run: yarn test (2,424 tests, including a new one for the column and the truncating pick) and yarn build. Web only, no migration, no new dependency.

🤖 Generated with Claude Code

The dialog is a CSS grid, and its one column sized to its widest content:
a long opportunity title picked in Create from scratch (the trigger's
value is a bare text node, so `truncate` couldn't cut it) or a long title
in Start widened the column past the dialog, pushing the cards, page type
chips and Continue / Open editor outside it. The column is now
minmax(0, 1fr), and the pick sits in its own truncating span beside the
chevron.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk A small production fix, reported in the app: with a long opportunity title, the New content dialog overflowed its edge, in the picker and again in Start. It's one file, web only; the cause and the checks are in the description. It touches new-content-dialog.tsx, as #1316 does (the Start option for the plan's page), on different lines. Whichever merges second rebases trivially.

… it wider

Start can be taller than a laptop window: at 650 px the dialog's title
and Back / Open editor fell outside it, out of reach. The dialog now caps
its height at the window's (less 2rem) and scrolls, with its footer kept
in view (sticky). It is also wider, 672 px instead of 576 px, so the page
type chips and the options wrap less.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk One more commit after testing every step (db010a4). Start was taller than a laptop-height window (650 px), with its title and Back / Open editor out of reach. The dialog now caps at the window's height and scrolls, with its footer sticky. At the user's request it's also wider: 672 px instead of 576 px. The description lists the flows and sizes checked.

@gkhngyk gkhngyk 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.

Looks good. With the grid column at minmax(0,1fr), a long pick or title truncates instead of widening the dialog. The dialog now fits the window, and the sticky footers keep the buttons in reach.

Tested on top of main together with #1316 (the two merge cleanly): web 2,482 tests, tsc, lint and Prettier pass.

@gkhngyk
gkhngyk merged commit 725f0da into ansvisor:main Oct 21, 2026
5 checks passed
gkhngyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 21, 2026
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.

2 participants