Skip to content

fix(webapp): avoid mutating render inputs - #4716

Open
carderne wants to merge 1 commit into
fix/react-compiler-hooksfrom
fix/react-compiler-immutability
Open

fix(webapp): avoid mutating render inputs#4716
carderne wants to merge 1 commit into
fix/react-compiler-hooksfrom
fix/react-compiler-immutability

Conversation

@carderne

@carderne carderne commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keeps render inputs and shared regular expressions immutable. Grouped selects now compute each section's shortcut offset directly from preceding sections, which also makes numeric shortcuts follow the displayed item order reliably.

@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: beba646

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27f66ff8-4cfc-420d-91fa-62ca0fed66bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +419 to +429
const startIndex = items
.slice(0, index)
.reduce((count, previousSection) => count + previousSection.items.length, 0);

return (
<Fragment key={index}>
{children(section.items as ItemFromSection<TItem>[], {
shortcutsEnabled: enableItemShortcuts,
section: {
title: section.title,
startIndex: count - 1,
startIndex,

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.

🔍 Section startIndex changes keyboard shortcut numbering for grouped selects

This is not just a purity refactor — it changes user-visible behavior. Previously the accumulator started at items.at(index - 1), which for index === 0 resolves to the last section (negative index wrap), and startIndex was then count - 1. For a single-section list of N items the old start index was N - 1, so the first item's shortcut was String(N + 1) instead of 1, and items pushing adjustedIndex > 9 got no shortcut at all (apps/webapp/app/components/primitives/Select.tsx:615-622). The new reduce yields the true count of preceding items (0 for the first section), so grouped/sectioned selects now get shortcuts starting at 1 and more items receive shortcuts. That looks like the intended correction, but reviewers relying on the old numbering (docs, tests, muscle memory) should be aware the visible shortcut keys shift.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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