feat(stage): add character-owned Live2D controls - #2458
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.
Hey, maintainers, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e53a8a6db0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // TODO: Remove this bridge after Character creation and import paths write | ||
| // the Avatar Model reference and default ID without modules.displayModelId. | ||
| async function ensureCharacterDefaultAvatarModelFromDisplayModel(characterId: string) { |
There was a problem hiding this comment.
Remove the temporary display-model compatibility bridge
This function is explicitly a backward-compatibility bridge from modules.displayModelId, which keeps the old and new ownership models active at the same time and violates the repository rule against adding compatibility guards. Update the creation and import paths to write the avatar-model reference directly, and use the required documented refactor process if old stored data must remain supported.
AGENTS.md reference: AGENTS.md:L109-L110
Useful? React with 👍 / 👎.
| // The active Character owns the durable Avatar Model references. This store | ||
| // only replicates the current runtime selection between renderer windows. | ||
| const selected = shallowRef('') |
There was a problem hiding this comment.
Repoint character state when deleting models
When the active Character uses an imported model, deleteAllModels() in use-data-maintenance.ts deletes that resource and writes only settingsStore.stageModelSelected = 'preset-live2d-1'. Now that this selection store is runtime-only, the durable defaultAvatarModelId still points to the deleted model; activating the Character again or restarting selects the missing resource and disables the renderer. The deletion flow must update or clear the Character-owned reference, which is now the persistence owner.
AGENTS.md reference: AGENTS.md:L234-L235
Useful? React with 👍 / 👎.
|
|
||
| const nextAppliedExpressionNames = new Set<string>() | ||
| for (const name of desiredExpressionNames) { | ||
| if (appliedExpressionNames.has(name) || live2d.expressions.setActive(name, true).success) |
There was a problem hiding this comment.
Reapply remaining previews after removing an expression
When two previewed expressions modify the same Live2D parameter, removing either one resets its parameters to model defaults in the preceding loop. This short-circuit then treats the other expression as already applied, so it is not re-applied and remains checked in the UI while its shared parameter is visually inactive. Recompute the parameter state from all desired expressions, or reapply every remaining expression after removals.
Useful? React with 👍 / 👎.
Summary
Testing
pnpm typecheckpnpm lint(passes with 10 existing warnings)pnpm -F @proj-airi/stage-ui-live2d exec vitest runpnpm -F @proj-airi/stage-ui exec vitest run src/stores/modules/airi-card.test.ts src/stores/modules/airi-card.browser.test.ts src/stores/live2d.browser.test.ts src/constants/prompts/live2d-act.test.tspnpm -F @proj-airi/pipelines-audio exec vitest run src/llm-streaming-control/payloads.test.tspnpm -F @proj-airi/scenarios-stage-tamagotchi-electron exec vitest run src/scenarios/display-model-from-file.test.tspnpm build:tamagotchi