fix(Tokenizer): suppress Create when the typed label matches a selected token by ManoharPaturi · Pull Request #6367 · facebook/astryx · GitHub
Skip to content

fix(Tokenizer): suppress Create when the typed label matches a selected token - #6367

Merged
cixzhang merged 2 commits into
facebook:mainfrom
ManoharPaturi:fix/tokenizer-create-dedupe-by-label
Oct 14, 2026
Merged

cixzhang merged 2 commits into
facebook:mainfrom
ManoharPaturi:fix/tokenizer-create-dedupe-by-label

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Fixes #6366.

the duplicate check now also matches selected labels (case-insensitive) in both the create-entry builder and the stale-entry guard on commit, so typing an already-selected label no longer offers or commits a duplicate. label-equals-id behavior is unchanged.

2 new tests (duplicate offered, stale entry committed) fail on main and pass here. full tokenizer suite (75) green.

…just ids

The hasCreate duplicate check compared the typed text against selected
ids. Real selections usually carry an opaque id (u1 under the label
"Alice"), and the search results cannot catch the match because
filteredSource pre-filters selected items out of them. Typing an
existing token's label therefore offered 'Create "Alice"', which
committed a second, duplicate token under a new id. Compare the trimmed
query against selected labels (case-insensitive) too, in both
createEntries and the stale-entry commit guard in handleAdd.
Copilot AI lite review requested due to automatic review settings September 18, 2026 12:59
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Sep 18, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 18, 2026
github-actions Bot added a commit that referenced this pull request Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 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

1 of 420 shot(s) changed. View the report

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
SideNav Resizable in AppShell probe dark 3,208
SideNav — Resizable in AppShell — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

@astracat-bot

astracat-bot Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 26, 2026, 8:58 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This fix looks good — the duplicate check now covers selected labels (case-insensitive) both when the Create entry is offered and when a stale entry is committed, so typing the label of a token that carries a different opaque id no longer creates a duplicate. The two new regression tests cover both paths, the Tokenizer suite passes (75 tests), and the patch changeset is included. No public API or behaviour beyond suppressing that duplicate changes.

[Automated review]

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Oct 14, 2026
@cixzhang
cixzhang merged commit b29bc2a into facebook:main Oct 14, 2026
39 checks passed

This branch was successfully deployed

1 active deployment
Preview — 5efbfcc0 Deployed Sep 26, 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. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tokenizer offers Create for a label that is already selected when the token id differs from the label

3 participants