Skip to content

fix: check first string in common word prefix and suffix - #10706

Merged
zspriggs merged 1 commit into
RaspberryPiFoundation:mainfrom
matthewalberto:fix/common-word-prefix-order
Nov 20, 2026
Merged

zspriggs merged 1 commit into
RaspberryPiFoundation:mainfrom
matthewalberto:fix/common-word-prefix-order

Conversation

@matthewalberto

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10705

Proposed Changes

Change the two post-loop checks in commonWordPrefix and commonWordSuffix to include the first string.

Reason for Changes

The result currently depends on option order. This can prevent dropdown labels from being trimmed even when they share a complete word.

Test Coverage

One new dropdown test and two additional checks in the existing prefix and suffix tests. All three fail against the original implementation and pass with the fix. npm test passes (8 of 8 Nx tasks), and Prettier and ESLint are clean.

dropdown-trim-before-fix dropdown-trim-after-fix

Documentation

No documentation changes needed.

Additional Information

Claude Code (Claude Opus 5.5) identified and fixed the bug, added three tests, and ran the build. I wrote the issue and PR descriptions and did Playground validation.

@matthewalberto
matthewalberto requested a review from a team as a code owner November 20, 2026 04:12
@github-actions github-actions Bot added the PR: fix Fixes a bug label Nov 20, 2026

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

This looks good to me, thanks for finding and fixing this!

@zspriggs
zspriggs merged commit 3aa514f into RaspberryPiFoundation:main Nov 20, 2026
11 checks passed
matthewalberto added a commit to matthewalberto/matthewalberto that referenced this pull request Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A dropdown with "10 minutes" before "10 min" isn't trimmed

2 participants