feat: UX/a11y polish + right-click quit + open-source onboarding#9
Merged
Conversation
Closes BACKLOG #16, #17, #19, #20 from the 2026-05-03 review:
- #19: hungry/bored/lonely now have distinguishing glyphs (🍡/…/♡) so
desaturated mood tints stop reading identically. Each is suppressed
during the conflicting action animation (eat/blush/yawn/celebrate).
- #20: applyAction("pet") prepends a yawn beat when the pet was sleeping,
replacing the old sleep→celebrate snap. Test added.
- #16: <img alt=""> on the sprite — the parent button already names the
control via aria-label="Mochi", so the image is decorative.
- #17: Settings loading state now uses role="status" aria-live="polite".
#15 (per-event-kind cooldowns) and #18 (ChatInput) intentionally skipped
— see DECISIONS.md for the rationale.
The desktop overlay window is frameless, so users had no way to close the app short of Task Manager. Adds a small right-click context menu with a "Close Mochi" item that invokes a new `quit_app` command on the Rust side (`app.exit(0)`). While here, fix two related save-path symptoms: - "(couldn't save state)" bubble repeated every ~4 s. The simulator accumulates fractional decay each tick (e.g. relationshipLevel drifts by 0.0023/s after 30 min idle), but the backend models every stat as i32 — so save_pet_state was failing with serde "invalid type: floating point" on every cycle. New `roundStats()` helper in sim/state.ts canonicalizes the conversion at the persistence boundary; Pet.svelte:scheduleSave wraps with it. - Heart bond badge displaying "♥0.999754". PetStatus.svelte was the one remaining gauge that didn't apply Math.round at render. Fixed. The save-failure UX itself is also less noisy now: only the FIRST failure in a streak shows a bubble (with the actual error reason truncated to 60 chars), subsequent failures log only.
Reorients the project for public release:
- README.md: tighter hero, sprite gallery (12 poses), clearer install
flow, badges, install/usage above architecture.
- LICENSE: MIT (the README was already claiming it; now it's real).
- CONTRIBUTING.md: human contributor guide — quick start, the four
required checks before opening a PR, simulation-first principles,
what kinds of PRs are welcome and what needs an issue first.
- AGENTS.md: brief for AI coding agents (Claude Code, Codex, Cursor,
Aider…). Encodes the architectural invariants — pure simulation in
src/lib/sim, integer-at-boundaries stat handling, salience-gated LLM
calls, sandbox path-jail — so an AI agent can produce a PR a human
reviewer will accept.
- .github/PULL_REQUEST_TEMPLATE.md + ISSUE_TEMPLATE/{bug,feature}.md.
- .github/workflows/ci.yml: vitest + svelte-check + cargo test --lib +
cargo build on every push/PR. Linux runner with full Tauri webkit2gtk
build deps.
- docs/ARCHITECTURE.md: deeper-than-README design walkthrough — 4-layer
stack, 3-second tick anatomy, why values are floats internally and
ints at boundaries, salience gate, memory ranking, sandbox model,
event flow on a typical interaction, testing strategy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three focused commits that prepare the repo for public release:
feat(ux): mood glyphs, a11y polish, sleep wake-up— closes BACKLOG #16/#17/#19/#20.feat: right-click quit menu + robust save persistence— adds the missing close affordance for the frameless overlay window, and fixes the repeating "(couldn't save state)" bubble.docs: README polish, contributor + AI agent guides, CI workflow— LICENSE, CONTRIBUTING.md, AGENTS.md, .github/ templates + CI, docs/ARCHITECTURE.md, README rewrite.What changed
UX & a11y (commit 1)
yawn → blush → celebrateinstead of snapping to celebrate.<img>no longer announces "Mochi pet" on top of the button's "Mochi" aria-label.role="status" aria-live="polite".Desktop functional (commit 2)
quit_appTauri command on the Rust side.roundStats()helper at the persistence boundary. Backend models stats asi32; the simulator accumulated fractional decay each tick so saves were silently failing every cycle withserde "invalid type: floating point".Math.round'd at display (was rendering♥0.999754).Open-source onboarding (commit 3)
LICENSE(MIT) — README was claiming MIT but the file was missing.CONTRIBUTING.md— required checks, what kinds of PRs are welcome, what needs an issue first.AGENTS.md— project brief for AI coding agents (Claude Code, Codex, Cursor…) so AI-assisted PRs match the simulation-first invariants..github/PULL_REQUEST_TEMPLATE.md+ bug/feature issue templates..github/workflows/ci.yml— vitest + svelte-check + cargo test --lib + cargo build on every push/PR (Linux runner with full webkit2gtk deps).docs/ARCHITECTURE.md— deeper-than-README walkthrough of the 4-layer stack, why values are floats internally and ints at the boundaries, salience gate, sandbox model.README.mdrewrite: tighter hero, sprite gallery (12 poses), badges, install above architecture.Why
Test plan
npm test— 99/99 passing (3 new:roundStatsboundary tests + sleep-wake-up sequence)npm run check— 0 errors / 0 warningscd src-tauri && cargo test --lib— 41/41 passingcd src-tauri && cargo check— cleannpm run tauri:dev— manually verified app launches, vite ready in ~1s, cargo dev profile finished, pet-mochi.exe runs without panic(couldn't save state)bubble and bond♥shows an integerhungry/bored/lonelymood and confirm the new glyph appears (and is suppressed during the conflicting action animation)Reviews
Both
typescript-reviewerandcode-reviewersubagents reviewed commit 1 in parallel:Notes
This branch was created because direct push to
mainwas blocked by the contributor's tooling. The CONTRIBUTING.md file in this PR codifies the PR-first workflow it accidentally enforced. 🙂