Skip to content

fix(web): Enter saves monogram or pasted emoji in project icon picker - #42703

Closed
only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-project-icon-picker-enter-save
Closed

only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-project-icon-picker-enter-save

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

In apps/web/src/components/settings/ProjectIconPickerDialog.tsx, the Monogram tab's Letters input and the Emoji tab's "Or paste any emoji" input have no form and no Enter handler. Typing AB or pasting an emoji and pressing Enter does nothing, so the user has to click "Save icon". This is the same pattern fixed for the text generator wizard in #42449.

Change

  • apps/web/src/components/settings/ProjectIconPickerDialog.tsx: add a shared saveOnEnter keydown handler on the Monogram Letters input and the Emoji "Or paste any emoji" input that calls event.preventDefault() and the existing save(). It ignores composing Enter (isComposing or keyCode === 229), held Enter (repeat), and Enter with Alt, Ctrl, Meta, or Shift. An invalid monogram still does not save because save() already returns early. The Icons tab search input is deliberately not wired: typing a search does not select an icon, so Enter there would save the previously selected one.
  • apps/web/src/components/settings/ProjectIconPickerDialog.browser.test.tsx: add a browser test (saves on plain Enter in monogram and custom emoji inputs, not icon search). It checks that Enter in icon search (rocket), Enter on an invalid monogram (ABC), and composing, keyCode: 229, repeat, or Shift Enter do not save. Plain Enter on AB saves { kind: "monogram", text: "AB" } and closes; plain Enter on 🦊 saves { kind: "emoji", emoji: "🦊" } and closes.

Verification

An AI agent (Gemini 4 Neon and Claude Opus 5.5, T3 Code) ran the test runs, vp run check:changed, and the before/after captures.

  • On base (024da4f7), the new browser test fails at expect(onSelect).toHaveBeenCalledTimes(1) with 0 calls.
  • On head (deb54cae), ProjectIconPickerDialog.browser.test.tsx passes 2/2 tests across 3 runs, and vp run check:changed passes (format, lint, knip, typecheck, tests, React Compiler).

Setup: Web dev build in a browser at a 1280x800 viewport, fresh isolated data on each commit, one synthetic project named "sample-app".

Steps: Settings → Projects → sample-app → Choose icon → Monogram → type "AB" → Enter; then Choose icon → Emoji → type 🦊 in "Or paste any emoji" → Enter (same on both commits).

Before (024da4f7) After (deb54cae)
Web, 024da4f7: Monogram tab, Letters "AB" typed and Enter pressed; the dialog stays open, the project icon remains automatic "SA", and nothing is saved
Web, 024da4f: Monogram tab, Letters "AB" typed and Enter pressed; the dialog stays open, the project icon remains automatic "SA", and nothing is saved
Web, deb54cae: Monogram tab, Letters "AB" typed and Enter pressed; the dialog closes and Project icon reads "AB · green"
Web, deb54ca: Monogram tab, Letters "AB" typed and Enter pressed; the dialog closes and Project icon reads "AB · green"
Web, 024da4f7: Emoji tab, 🦊 typed in "Or paste any emoji" and Enter pressed; the dialog stays open and nothing is saved
Web, 024da4f: Emoji tab, 🦊 typed in "Or paste any emoji" and Enter pressed; the dialog stays open and nothing is saved
Web, deb54cae: Emoji tab, 🦊 typed in "Or paste any emoji" and Enter pressed; the dialog closes and Project icon shows 🦊
Web, deb54ca: Emoji tab, 🦊 typed in "Or paste any emoji" and Enter pressed; the dialog closes and Project icon shows 🦊

Also checked live on head (deb54cae, not captured): typing "rocket" and pressing Enter in the Icons search keeps the dialog open and leaves the icon unchanged.

Not shown: Mobile has no project icon picker (it only renders icons), so it is unchanged. Desktop bundles the same web UI and was not captured separately. macOS and Windows hosts were not captured.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The project icon picker now saves monograms and custom emoji on eligible Enter keydowns. Browser tests check ignored key events and successful submissions.

Changes: Project icon picker Enter handling

Layer / File(s) Summary
Guarded Enter submission
apps/web/src/components/settings/ProjectIconPickerDialog.tsx, apps/web/src/components/settings/ProjectIconPickerDialog.browser.test.tsx
The monogram and custom-emoji inputs use a shared handler that ignores modified, repeated, and composing Enter keydowns. Tests cover ignored events and successful submissions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: Minimal · up to deb54

Pressing Enter in the monogram or custom emoji field now saves the icon, and invalid or composing input is ignored. The change is small, the tests cover the behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Enter in the project icon picker now saves the monogram or pasted emoji. It follows the conventional commit format with a clear scope. The raw summary and objectives b…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the reproduction steps and expected behavior. The Change section lists the han…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Enter in the project icon picker now saves the monogram or pasted emoji. It follows the conventional commit format with a clear scope. The raw summary and objectives both describe a shared Enter handler for the Monogram Letters and Emoji inputs, so the title matches the changeset.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the reproduction steps and expected behavior. The Change section lists the handler and the modifier-key and composition guards, and it explains why the Icons search input is left unwired. Scope cites the related pattern in #42449 but does not link a bug issue or explain why the fix needs no issue. Verification gives test results on base and head, the commands run, the setup, and before/after screenshots. It also states what was not checked, which are macOS, Windows, and desktop captures.

Resolution

Optional: link the bug issue in the Scope section, or state why no issue is needed. The template asks for this, and the description cites only #42449, which is a related pattern rather than the bug report. The template also asks for the model and harness at the end. The description mentions Gemini 4 Neon and T3 Code, so this item is already covered.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 07276c4 and deb54ca.

Files selected for processing: 2

  • apps/web/src/components/settings/ProjectIconPickerDialog.browser.test.tsx
  • apps/web/src/components/settings/ProjectIconPickerDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@only21mil only21mil closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant