mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7803] soup/ [Feature]: Shared character picker to replace duplicated pickers #4309
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4309
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gunterlie on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7803
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Picking characters looks and behaves differently depending on where you are. There is no shared character picker in the client: an inventory of
packages/client/srcfound about 18 separate pickers, each with its own markup and logic. The only shared piece is the genericPickerDropdown(features/chat-settings/PickerDropdown.tsx), and only Chat Settings uses it for characters.For users this means search, avatars, paging and folder handling exist in some pickers and are missing in others. For contributors it means the same fix has to land in several copies, and the copies drift. The clearest case:
ChatSetupWizard.tsxcarries the participants picker twice (Conversation step at ~L1690, Roleplay at ~L3107), each with its own search state,characterPickerLimitandCHARACTER_PICKER_PAGE_SIZEpaging.Inventory
A. Search + avatar list, single or multi select. Best fit for a shared component.
components/chat/ChatSetupWizard.tsx~L1690, participants (Conversation)components/chat/ChatSetupWizard.tsx~L3107, participants (Roleplay), copy of the abovecomponents/chat/ChatSettingsDrawer.tsx~L6322, "Add character" (usesPickerDropdown)components/game/GameSetupWizard.tsx~L2517, GMcomponents/game/GameSetupWizard.tsx~L2620, party (same markup as GM)components/chat/CharacterScheduleManagerModal.tsx~L473 (plus per-row auto-renew)components/chat/ChatSetupWizard.tsx~L623PersonaPicker(persona or character identity)B. Native
<select>, one character.ChatGallery.tsx~L595,MultiplayerParticipantControls.tsx~L91,AvatarAgentSetup.tsx~L104,TrackerCardColorSettings.tsx~L443.C. Chips/popover, multi, no avatars.
RegexScriptEditor.tsx~L170ScopeTargetPicker,LorebookEditor.tsx~L177LinkedResourcePicker,LorebookEntryRow.tsx~L1373FilterPills.D. Special-purpose.
ChatInput.tsx~L2240 (who replies),TTSConfigCard.tsx~L809 (searchable per voice row),ChatSettingsDrawer.tsx~L6404 (add a folder),AgentSuiteModal.tsx~L852 (mixed context sources).Line numbers are approximate as of
stagingon 2026-10-19.Proposed solution
Add one shared
CharacterPickerfor group A: search, avatars, paging, folder add and a single/multi mode. It can render insidePickerDropdownwhen used as a popover. Migrate in this order, one small PR each:ChatSetupWizardparticipant pickers. Exact duplicates, highest drift risk, lowest behavior risk.GameSetupWizardGM + party pickers. Same markup, only single vs multi differs.After that, consider
CharacterScheduleManagerModalandPersonaPicker. They need per-row extras and persona mixing, so move them only once the shared picker is proven.Out of scope for now:
Each migration must keep current behavior (search matching via
characterMatchesSearch, paging, folder add, keyboard/focus) and show the same result at mobile and desktop widths.Where shared components live, and rules for them
No new folder or schema is needed. The structure exists; what is missing are rules for using it.
Current state
components/ui/(51 files): documented inpackages/client/.instructions.mdas "Reusable UI primitives". It holds real primitives (Modal,Drawer,ColorPicker,EmojiPicker,ContextMenu) but also single-feature parts (SpriteGenerationModal,ChibiProfessorMariEasterEgg,WorldStateInstruments,TrackerCardColorControls). 15 of the 51 files import hooks, stores or the API client.components/<entity>/(characters/,personas/,lorebooks/, ...): per-domain folders. The right home for shared parts that read entity data.features/: meant to be self-contained modules, yetcomponents/imports fromfeatures/in 14 files. The genericPickerDropdownlives infeatures/chat-settings/, where other areas do not look for it.Proposed rules
components/ui/: no domain knowledge. Data in via props only; no entity hooks, stores or API calls.components/<entity>/: shared parts for one entity, e.g.components/characters/CharacterPicker.tsx. May use that entity's hook (useCharacters) and builds onui/primitives.components/ui/and the entity folder.features/stays self-contained. If code outside a feature imports a part from it, move that part toui/or the entity folder. First move:PickerDropdown→components/ui/.children, render slots) over a growing list of boolean props. Onemodeprop (e.g.single | multi) beats several flags.Enforcement
packages/client/.instructions.mdunder "Component Pattern" and update its directory map (it lists only 6 of the 51ui/files and 2 of the 4features/modules).no-restricted-importsrule can stopui/from importing hooks, stores or the API. 15 files would break it today, so start with documentation and add the lint rule after a cleanup.Suggested PR order
.instructions.md+ movePickerDropdowntocomponents/ui/.CharacterPickerincomponents/characters/+ migrate the twoChatSetupWizardparticipant pickers.GameSetupWizardGM + party pickers.Alternatives considered
PickerDropdownitself with character rows. Rejected: it is a generic popover also used for lorebooks and functions. Keep it generic and compose the character list on top.ChatSetupWizardcode will keep drifting.Additional context
The inventory comes from a read-only scan of
packages/client/src. TheChatSetupWizardduplication and thePickerDropdownAPI were checked by hand.@SpicyMarinara
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Oct 19, 2026):
Closing this for now to clear the board for the next release. It isn't a rejection: reopen it after the release when you pick it up again.