Skip to content

fix(Tokenizer): avoid blank trailing input row - #6057

Merged
imdreamrunner merged 14 commits into
mainfrom
investigate/powersearch-empty-line
Oct 1, 2026
Merged

imdreamrunner merged 14 commits into
mainfrom
investigate/powersearch-empty-line

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove Tokenizer's empty trailing combobox from flex layout so it cannot create a blank final row
  • bound the empty search hit surface before the measured end-control lane, including the Clear all button's 2px coarse-pointer hit outset
  • keep pills and controls above the background input, while restoring the normal in-flow editing width as soon as a query is entered
  • add deterministic real-Chromium guards for LTR and RTL layout, hit testing, focus, and coarse-pointer behavior

Why

In a nearly full PowerSearch row, the mounted combobox still participated in flex layout. Its minimum editing width could wrap by itself and make the field 55px tall even though no content appeared on the second row.

The empty input is now an absolutely positioned first-row background hit surface. It does not consume flex space, so it cannot create a row, and the pills and controls remain the foreground hit targets. Its inline end stops 3px before the measured end lane: 2px for InputClearButton's invisible 24px coarse-pointer target plus 1px separation. Typing restores the ordinary in-flow input.

Apples-to-apples visual verification

Both images below were captured in the same Linux Chromium run with identical data, neutral/light theme, 600 CSS-pixel fixture, 629 × 100 viewport, 2× device scale, and settled fonts. The before capture restores only the PR base's input-layout rules; the after capture uses this branch.

Before — the tokens fit row one, but the empty combobox creates a blank second row (55px field):

Before: empty combobox creates a blank second row

After — the identical fixture stays one row (32px field):

After: identical PowerSearch fixture stays on one row

The earlier screenshots were removed because they mixed the original deployed story with the PR-preview story and therefore had different token styling; they were not a valid visual comparison.

Verification

The browser guard requires all pills to remain on row one, the empty combobox to share that row, a positive exposed input hit target, no overlap with the full Clear all touch target, correct token/Clear all hit testing, and focus after clicking the input.

Open the LTR regression story or the RTL variant.

@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 1, 2026 5:07pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 4, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Sep 4, 2026

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

Thanks, the row now stays compact. One blocker: the empty search target sits under Clear all, so clicking it removes filters instead of focusing search in LTR and RTL. Please preserve a non-overlapping input hit target while keeping the compact row.

[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

15 of 420 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Chat Full AI Chat probe light 155,733
Chat Full AI Chat probe dark 155,005
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,229
Chat With Attachments probe dark 11,065
SideNav Resizable in AppShell probe dark 3,208
Markdown Default probe dark 897
Markdown Default probe light 897
Markdown Default neutral dark 882
Markdown Default neutral light 858

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@xinzi-bot

Copy link
Copy Markdown

Addressed in dc1e1d0. The empty compact input now keeps the measured end-lane reserve as logical outer spacing, so its flex base remains compact while its hit rectangle stops before Clear all. I added real-browser geometry guards for both LTR and RTL that require the input to stay on the token row, retain positive width, and not overlap the clear button. Both new guards pass in CI: https://github.com/facebook/astryx/actions/runs/33931922038/job/101212993760

Could you take another look?

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

Thanks, this fixes the Clear all overlap, but the exact-head story now fails its original compact-row assertion in both LTR and RTL: input top 47px, final token bottom 44px. The field is 55px tall again, so users still see the blank second row this PR is meant to remove. Please keep a positive, non-overlapping input hit target without restoring the extra row.

[Reviewed by Robohands]

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

People clicking the empty search area can still remove a filter instead of focusing search. This exact head restores the compact row, but real Chromium renders the 4px input overlapping Clear all by 3.7px in both LTR and RTL; its center hit-tests as Clear all. The added story throws that same error locally while CI passes, so the regression fixture is not portable enough to gate this. Please keep the compact row while preserving a non-overlapping search target in both directions, and make the browser guard deterministic across supported environments.

[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Sep 5, 2026
@xinzi-bot

Copy link
Copy Markdown

You were right—the previous guard raced the ResizeObserver and could measure before the end-lane reserve was applied. Addressed in 3705ac0:

  • the empty input is now a minimal, non-growing flex item; the wrapper remains the larger click-to-focus surface
  • the guard waits for the measured lane before asserting
  • LTR and RTL each require one-row alignment, positive input width, no Clear all overlap, a successful center-point browser hit test, and focus after click

Both hardened guards pass in Chromium: https://github.com/facebook/astryx/actions/runs/33933639943/job/101217896127

I also replaced the PR evidence with apples-to-apples captures using the same three filters, 600 CSS-pixel fixture width, and 2x output as the original report. Could you take another look?

@github-actions
github-actions Bot requested a review from cixzhang September 5, 2026 01:16
@imdreamrunner
imdreamrunner force-pushed the investigate/powersearch-empty-line branch from 9f41204 to a0f64a2 Compare September 5, 2026 01:16
github-actions Bot added a commit that referenced this pull request Sep 5, 2026
@xinzi-bot

Copy link
Copy Markdown

Agreed—the 4px in-flow target still had an impossible boundary case: at some widths it had to overlap the clear lane or wrap. I replaced that approach in a0f64a2.

While empty, the combobox is now an absolutely positioned first-row background hit surface bounded one pixel before the measured end lane. It consumes no flex width, and pills plus end controls are layered above it. Typing restores the normal in-flow input.

The guard now waits for ResizeObserver before measuring, then verifies in both LTR and RTL: one-row alignment, positive input width, no Clear all overlap, correct hit-testing at the final pill and clear-button centers, an exposed point that hit-tests to the input, and focus after clicking that point. Both variants pass in Chromium: https://github.com/facebook/astryx/actions/runs/33935679227/job/101223840998

I also replaced the PR explanation and confirmed the before/after captures are apples-to-apples: identical filters, 600 CSS-pixel fixture width, 2x output, and the after capture was taken only after the served iframe hash matched a0f64a2. Please take another look.

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

People tapping the exposed search area can still remove a filter instead of focusing search. In coarse-pointer Chromium, Clear all’s 24px hit area extends 2px beyond its visible box while the input leaves only a 1px gap; 1–1.5px inside the input resolves to Clear all in both LTR and RTL, and clicking there removes a filter. The new browser stories pass because they run with a fine pointer and compare only the visible button rectangle. Please reserve the full effective Clear all hit area and run this guard with pointer: coarse in both directions.

[Reviewed by Robohands]

@xinzi-bot

Copy link
Copy Markdown

Addressed on 00ebfea84.

I first tightened the guard and reproduced the reported failure in Linux Chromium with pointer: coarse: the empty combobox overlapped the effective Clear all hit target by exactly 1.00px in both LTR and RTL (failing run).

The empty input now reserves the clear button's full 2px coarse-pointer outset plus the existing 1px separation. The durable browser guard runs both directions with touch enabled, reads the ::after hit-area geometry, verifies all pills stay on row one, verifies the input stays on that row, checks non-overlap and hit-testing, and clicks an exposed input point to confirm focus. The final clean-head run passes.

I also replaced the mismatched screenshots in the PR description with an A/B captured in the same Chromium run using identical data, theme, viewport, scale, and fonts.

github-actions Bot added a commit that referenced this pull request Sep 5, 2026

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

Thanks, this now keeps the row compact without letting the search or Clear all targets steal each other’s clicks in LTR/RTL and fine/coarse modes.

[Reviewed by Robohands]

@astracat-bot

astracat-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 1, 2026, 5:10 PM UTC

@astracat-bot astracat-bot Bot 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.

The blank trailing row fix looks ready. Taking the empty combobox out of flex layout only while it is empty — and restoring the normal in-flow input as soon as typing starts — removes the extra row without changing the public API, the mounted input, or focus behavior. The empty surface now stops before the measured end lane plus the full coarse-pointer Clear all hit area, and the new LTR/RTL browser guard verifies same-row placement, non-overlap, hit testing, and focus; unit tests, typecheck, and the full CI suite (including RTL, accessibility, and visual jobs) pass on this revision.

Two non-blocking notes: the 2px coarse-pointer outset is duplicated as a private constant between Tokenizer and InputClearButton (the guard reads the real hit-area geometry, so drift would fail CI — worth a shared constant someday), and the story-play-guard file carries unrelated formatting churn alongside its functional changes.

[Automated review]

@astracat-bot astracat-bot Bot 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.

Thanks for the careful iterations on this — the production approach looks sound: the empty combobox leaves flex layout only while empty, stops before the measured end lane and the full Clear all touch target, and typing restores the normal input, with no public API change. Unit tests and typecheck pass, and locally the empty input stays on the first row with clear-target separation in both directions.

One change is needed before this can land: the newest fixture retune overshoots its own row. At the 600px fixture width the three tokens together are wider than the row, so the third token wraps and both Near-full Token Row plays (LTR and RTL) fail at the "fixture tokens wrapped" precondition — this is failing now in the pr-a11y story-play guard on this head, and it reproduces locally with the same measurements. Please shorten the fixture's title value so the tokens fit on row one again while the ordinary in-flow input still cannot fit beside the final token, and rerun both guarded plays to green. No production-code change is being requested.

Two small non-blocking notes for someday: the 2px coarse-pointer outset is duplicated as a private constant between Tokenizer and InputClearButton (the guard reads the real hit-area geometry, so drift would fail CI), and the guard script file carries some unrelated formatting churn.

[Automated review]

… full

The fixture's near-full condition depends on platform font metrics. With the
same 600px field and 18-character title token, CI's Linux Chromium leaves too
little room for the in-flow input (the reported blank row), while other Linux
font stacks fit it and would pass the blank-row assertion vacuously. Assert
that the ordinary in-flow editing input really cannot fit beside the final
token before checking the empty-query layout, so a font or metric drift fails
loudly instead of silently weakening the guard.

@astracat-bot astracat-bot Bot 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.

Thanks for the careful iterations on this — the production approach looks sound: the empty combobox leaves flex layout only while empty, stops before the measured end lane and the full Clear all touch target, and typing restores the normal input, with no public API change. Unit tests (106) and the core typecheck pass, the exact-head story-play guard passes both Near-full Token Row plays (LTR and RTL, coarse pointer), and the field now stays on one row with the Clear all target kept separate.

Two small non-blocking notes for someday: the 2px coarse-pointer outset is duplicated as a private constant between Tokenizer and InputClearButton (the guard reads the real hit-area geometry, so drift would fail CI), and the new fail-closed fixture precondition is font-metric sensitive — on narrower font stacks than CI's it reports the fixture as no longer near-full rather than passing, which is worth keeping in mind if the guard is ever run outside CI.

[Automated review]

@imdreamrunner
imdreamrunner merged commit abbb293 into main Oct 1, 2026
43 checks passed
@github-actions
github-actions Bot deleted the investigate/powersearch-empty-line branch October 2, 2026 06:24

This branch was successfully deployed

1 active deployment
Preview — b6b409fe Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants