Fix omnibar input text pushed off-screen by long suggestion suffixes#2562
Fix omnibar input text pushed off-screen by long suggestion suffixes#2562noisysocks merged 3 commits intomainfrom
Conversation
When a suggestion with a long title was selected, the suffix text width (measured via canvas) was used to set the input's padding-right, consuming nearly the entire input width and hiding the user's typed text. Replaced JS-based text measurement with CSS-only flex layout: - Input padding-right now only reserves space for the close button - suffixSpacer (flex: none) positions the suffix after the completion text - suffix truncates with ellipsis when space is limited Also updated suggestion list items to match native macOS address bar layout: - Removed hard 60% max-width cap on title - Title and suffix share space proportionally (title flex-shrink: 1.5) - Suffix fills remaining space to the right edge (flex: 1 1 auto) - Added text-align: left to override button default center alignment Added component showcase examples and screenshot test for long suggestions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
[Beta] Generated file diffTime updated: Fri, 20 Mar 2026 00:29:20 GMT Apple
File has changed Integration
File has changed Windows
File has changed |
Build Branch
Static preview entry points
QR codes (mobile preview)
Integration commandsnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/randerson/fix-omnibar-long-suggestions")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/randerson/fix-omnibar-long-suggestions
git -C submodules/content-scope-scripts checkout origin/pr-releases/randerson/fix-omnibar-long-suggestionsPin to exact commitnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "7d82eb5c6c85b3917b7fabae878f9289913376f3")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/randerson/fix-omnibar-long-suggestions
git -C submodules/content-scope-scripts checkout 7d82eb5c6c85b3917b7fabae878f9289913376f3 |
|
This PR requires a manual review and approval from a member of one of the following teams:
|
There was a problem hiding this comment.
Stale comment
Web Compatibility Assessment
- No findings (no
error/warning) in hostile-page API override categories. This PR does not touch injected runtime surfaces (wrapper-utils,DDGProxy,captured-globals, message bridge) and stays withinspecial-pages/pages/new-tabomnibar UI/layout and test data.special-pages/pages/new-tab/app/omnibar/components/SearchForm.js(removed canvasmeasureTextpath): change reduces potential runtime throw paths (getContext('2d')null handling) and avoids text-width precomputation sensitivity.special-pages/pages/new-tab/app/omnibar/components/SearchForm.module.cssandSuggestionsList.module.css: flex/ellipsis-based truncation is consistent with native-like behavior and avoids previously fixed-width suffix reservation pushing input text off-screen.Security Assessment
- No findings (
critical/error/warning).- No changes to privileged messaging transport, origin checks, event secrets, or config gating.
- No new dynamic code execution (
eval/Function), no new network requests, nopostMessagechanges, and no unsafe HTML injection patterns.- Added mock/example data is static and rendered as text nodes in Preact; no new data-exfiltration vector introduced.
Risk Level
Low Risk — scope is limited to omnibar presentation logic, mock data, examples, and screenshot/integration expectations, with no modifications to injected security-sensitive infrastructure.
Recommendations
- Run
special-pagesscreenshot tests on at least macOS + Windows projects to confirm truncation behavior remains stable across font metrics.- Add a focused integration assertion that the typed input remains visible when selected suggestion has a very long suffix (guard against regression of this exact bug class).
- Keep the new omnibar examples as golden cases and include one RTL locale screenshot in follow-up coverage to validate truncation/alignment invariants.
Sent by Cursor Automation: Web compat and sec
There was a problem hiding this comment.
Web Compatibility Assessment
- No blocking findings.
special-pages/pages/new-tab/app/omnibar/components/SearchForm.js(~62-63,~116-123,~184-223),info: Replacing dynamic canvas text measurement with CSS truncation reduces layout fragility and removes a runtime throw path fromcanvas.getContext('2d')failure. This aligns with compatibility-safe behavior for long suffixes and keeps input interaction contract unchanged.special-pages/pages/new-tab/app/omnibar/components/SearchForm.module.css(~13-44,~49-57),info: The new flex/ellipsis handling for.suffixSpacerand.suffixis consistent with the intended UI contract (input text remains visible; long suffixes truncate) and avoids prior right-padding over-allocation.
Security Assessment
- No findings.
- Scope is limited to
special-pages/pages/new-tabUI/styles/mocks/tests; there are no changes to injected hostile-page runtime surfaces (captured-globals, wrapper utilities, DDGProxy, message bridge, platform transports, or config patching logic).
Risk Level
Low Risk: Changes are confined to NTP omnibar presentation and test fixtures/snapshots, with no modifications to security-critical injection or messaging paths.
Recommendations
- Add one assertion in omnibar integration tests to verify typed text/caret remains visible with long selected suffix on narrow viewport widths (not just screenshot baselines).
- Extend screenshot coverage to at least one non-darwin rendering target to catch font-metric/flex truncation differences across platforms.
Sent by Cursor Automation: Web compat and sec


Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1209121419454298/task/1213440750515602
Description
When a history entry with a long title (e.g., "Tripadvisor: Over a billion reviews & contributions for Hotels, Attractions, Restaurants, and more") was selected in the omnibar, the suffix text pushed the user's typed text off-screen.
Root cause: The input's
padding-rightwas set from a JS-measured suffix text width via canvasmeasureText(). For long titles, this consumed nearly the entire input width.Fix: Replaced JS text measurement with CSS-only flex layout:
padding-rightnow only reserves space for the close button.suffixSpacer(flex: none) positions the suffix after the completion text.suffixtruncates with ellipsis when space is limitedmeasureTextcanvas function entirelyAlso updated suggestion list items to better match native macOS address bar:
max-width: 60%cap on titleflex: 0 1.5 auto) matching native's lower title compression resistanceflex: 1 1 auto)text-align: leftto override<button>default center alignmentTesting Steps
Checklist
🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes omnibar input/suggestions layout and relies on CSS overflow/flex behavior that can differ across browsers, plus updates test expectations.
Overview
Fixes an omnibar rendering bug where long selected-suggestion suffixes could consume the input width and hide the user’s typed text by removing JS canvas text measurement and switching to a CSS-only flex/ellipsis layout (input only reserves space for the close button).
Tweaks suggestion row layout to better balance title vs suffix truncation (
flexadjustments andtext-align: left). Adds a component showcase for omnibar states (with mock provider/data), extends mocks to include a long history entry, and updates/expands Playwright coverage (suggestion count + new long-suggestion screenshot test).Written by Cursor Bugbot for commit 3f4324e. This will update automatically on new commits. Configure here.