[PR #717] [MERGED] feat(game-setup): allow removing learned chips in Game Setup wizard #4742

Closed
opened 2026-10-22 04:10:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/717
Author: @Romuromylus
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/11/2026
Merged by: @Romuromylus

Base: main ← Head: fix/game-setup-forget-learned-options


📝 Commits (1)

  • eb988fa feat(game-setup): allow removing learned chips

📊 Changes

2 files changed (+46 additions, -6 deletions)

View changed files

📝 packages/client/src/components/game/GameSetupWizard.tsx (+32 -6)
📝 packages/client/src/stores/ui.store.ts (+14 -0)

📄 Description

Linked issue

Closes #716

Why this change

  • The Game Setup wizard auto-saves anything typed into the custom Genre / Setting / Tone / Player Goals / Additional Preferences fields and surfaces it as a chip the next time the wizard opens.
  • Today there is no UI affordance to remove an individual learned entry, so typos and one-off experiments accumulate up to the 60-per-group cap and there is no way to prune them without nuking localStorage.

What changed

  • packages/client/src/stores/ui.store.ts: new forgetGameSetupOption(group, value) action that filters the named learned array by normalized key and persists via the existing Zustand persist middleware.
  • packages/client/src/components/game/GameSetupWizard.tsx: LearnedOptionChips now renders each chip as a wrapper containing two buttons — the existing select-on-click body plus a small forget × on the right (lucide X, aria-label="Forget <value>"). The × is opacity-40 by default and opacity-100 on hover/focus, matching the visual weight of the chips around it without grabbing attention.
  • onForget is wired into all five callsites (genres / tones / settings / goals / preferences). Built-in suggestion chips (e.g. "A neon-lit city of hackers and megacorps") and the currently-selected custom-genre/tone chips at the top are unchanged — only the learned list gets the × forget button.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify in the wizard's Setting section: type a one-off value like Skyrim, complete the wizard, reopen → Skyrim shows as a learned chip with a faint × on the right.
  • Manually verify clicking the × removes the chip from the visible list and any +N more collapses by one. Click the chip body itself (not the ×) and confirm it still applies the value to the Setting input.
  • Manually verify the forget persists across a full page reload (Zustand persist writes to localStorage).
  • Repeat for custom Genres, Tones, Player Goals, and Additional Preferences.
  • Mobile/touch: confirm the × is tappable at default 40% opacity (it is always rendered, not hover-gated, so touch reaches it).
  • Edge cases checked: forgetting a value that matches a built-in suggestion is a no-op (built-ins are not in the learned arrays); forgetting the same value twice is idempotent (case-insensitive normalized-key match).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Tested live on a self-hosted EasyPanel deployment of the fork. Before: every learned chip is select-only. After: each learned chip gets a faint × on the right that brightens on hover/focus; clicking it removes that single entry from the persisted list while leaving every other chip and the built-in suggestions untouched.

Summary by CodeRabbit

  • New Features
    • Added the ability to forget individual game setup options. Learned option chips for genres, settings, tones, goals, and preferences now display an inline forget button. Users can easily remove specific selections without affecting other learned options, providing more granular control over their game setup preferences and choices.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/717 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `main` ← **Head:** `fix/game-setup-forget-learned-options` --- ### 📝 Commits (1) - [`eb988fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb988faf7dfff66dca31040d601546a7b54e48de) feat(game-setup): allow removing learned chips ### 📊 Changes **2 files changed** (+46 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+32 -6) 📝 `packages/client/src/stores/ui.store.ts` (+14 -0) </details> ### 📄 Description ## Linked issue Closes #716 ## Why this change - The Game Setup wizard auto-saves anything typed into the custom Genre / Setting / Tone / Player Goals / Additional Preferences fields and surfaces it as a chip the next time the wizard opens. - Today there is no UI affordance to remove an individual learned entry, so typos and one-off experiments accumulate up to the 60-per-group cap and there is no way to prune them without nuking `localStorage`. ## What changed - `packages/client/src/stores/ui.store.ts`: new `forgetGameSetupOption(group, value)` action that filters the named learned array by normalized key and persists via the existing Zustand `persist` middleware. - `packages/client/src/components/game/GameSetupWizard.tsx`: `LearnedOptionChips` now renders each chip as a wrapper containing two buttons — the existing select-on-click body plus a small forget × on the right (lucide `X`, `aria-label="Forget <value>"`). The × is `opacity-40` by default and `opacity-100` on hover/focus, matching the visual weight of the chips around it without grabbing attention. - `onForget` is wired into all five callsites (genres / tones / settings / goals / preferences). Built-in suggestion chips (e.g. "A neon-lit city of hackers and megacorps") and the currently-selected custom-genre/tone chips at the top are unchanged — only the *learned* list gets the × forget button. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify in the wizard's **Setting** section: type a one-off value like `Skyrim`, complete the wizard, reopen → `Skyrim` shows as a learned chip with a faint × on the right. - Manually verify clicking the × removes the chip from the visible list and any `+N more` collapses by one. Click the chip body itself (not the ×) and confirm it still applies the value to the Setting input. - Manually verify the forget persists across a full page reload (Zustand `persist` writes to `localStorage`). - Repeat for **custom Genres**, **Tones**, **Player Goals**, and **Additional Preferences**. - Mobile/touch: confirm the × is tappable at default 40% opacity (it is always rendered, not hover-gated, so touch reaches it). - Edge cases checked: forgetting a value that matches a built-in suggestion is a no-op (built-ins are not in the learned arrays); forgetting the same value twice is idempotent (case-insensitive normalized-key match). ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Tested live on a self-hosted EasyPanel deployment of the fork. Before: every learned chip is select-only. After: each learned chip gets a faint × on the right that brightens on hover/focus; clicking it removes that single entry from the persisted list while leaving every other chip and the built-in suggestions untouched. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to forget individual game setup options. Learned option chips for genres, settings, tones, goals, and preferences now display an inline forget button. Users can easily remove specific selections without affecting other learned options, providing more granular control over their game setup preferences and choices. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/717) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4742
No description provided.