[GH-ISSUE #8904] [Tracking]: Make Marinara feel fast: instant clicks, no freezes, smooth animations #8546

Closed
opened 2026-11-07 16:43:41 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Gunterlie on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8904

Originally assigned to: @Gunterlie on GitHub.

Tracking issue for a series of small PRs that make Marinara Engine feel fast: instant feedback on clicks, no freezes, smooth streaming and tidy, non-stuttery motion. One branch per slice, landed against staging one after another.

Targets

Measured on a seeded instance (3,000 cards, 300-card folder, 500-entry lorebook, two 1,000-message chats, fake streaming model), at CPU 1× and 4× throttle:

  • Feedback within 50 ms of a click or tap; INP under 100 ms
  • Chat switch and panel open under 100 ms after first load
  • Tag filter on 3,000 cards under 150 ms
  • No long task over 50 ms while a reply streams

Slices

  • 1. Freezes — #8903. Accent Pulse (desktop default) restarted ~2,800 colour transitions every tick. Characters panel scroll: style 5,030 → 303 ms/s; at 4× CPU, clicks work again. Found by kolacheee.
  • 2. Large libraries — server-side tag/exclude-tag/folder filters with totals and folder counts, so chips and folders cover all cards (not only loaded pages); load on scroll; "N of total"; fixes folders showing only loaded members. Same fix for Personas. From a Discord report about 100-card pages and incomplete filters.
  • 3. No waiting on clicks — #8910. open chats from the list cache, prefetch messages on pointer down, preload panels/editors on idle, lazy Spotify.
  • 4. Optimistic actions — #8912. delete message (single and bulk), chat rename, character folder rename/move/delete; roll back on error. Swipe delete stays server-first (the server picks the next shown swipe); the character favourite has no quick toggle today, it saves with the editor.
  • 5. Virtualized card lists, no pagination — Characters loads every card in one request and draws only the visible cards, so open and scroll stay fast at any library size; the scrollbar shows the whole library and Load more goes away. Measured: a full card is 5–20 KB, so all 2,700 cards would be 20–50 MB. Step 1 (Characters panel, #8920, merged) keeps pages hidden under the virtual list (next page loads near the end of the list; Load more stays only as an error fallback). Step 2 (#8923, merged): a slim list request (summary snippet and preview metadata only, ~1 MB for 2,700 cards) with full text loaded on demand, then the pages go away. Then Lorebooks and Personas. Chat messages keep their pages. Motion input from interior.dev: skeleton-swap and blur-up-image, so rows mounted during fast scroll do not flicker.
  • 6. Smooth streaming — re-render only live rows, no scroll jump at stream end, keep action-bar space, save partial reply before Stop clears state, drop the roleplay chat-open stagger. Input from interior.dev: streaming-text (frame loop that counts real time, clamped frame step, aria-busy, one announcement at the end) and new-items-pill ("new messages" pill instead of moving your scroll).
  • 7. Weak devices — reduced effects "auto" default on weak devices (decision pending), lighter accent animation there.
  • 8. Motion pass — press scale, no overshooting springs on everyday UI, popLayout panel swaps, shared popover motion, no transition-all on hot controls (values pending). Input from interior.dev: press-depth, tooltip-group (instant tooltips after the first), loading-button (progress without a width change).
  • 9. Mobile — dvh, overscroll containment on sheets, 44 px top-bar hit areas.

Later

  • Server time to first token, paging for /chats and /lorebooks, panel scroll memory.
  • Slice 3 left the first Roleplay open ~120 ms slower (chunk waterfall plus an idle gap); look at it again.
  • interior.dev ideas to consider later: hold-to-confirm for deletes, typing-indicator, filter-grid, task-steps, live-activity.

interior.dev components are MIT; we copy techniques into our own code (no new dependency) and credit interior.dev in each PR that uses one.

Learnings so far

  • Measure at 4× CPU too: the 1× baseline looked fine while the app did not respond at 4×.
  • At 4× the 2 Hz root accent writes are still the biggest idle cost (~800 ms style/s) — input for slice 6.
  • Chat-open timings vary a lot between runs; report medians.

Consistency: one shared set

Fast and pretty must look the same everywhere. Every slice uses one shared set instead of one-off animations, built once (inspired by interior.dev, MIT, credited) and themed with Marinara tokens and reduced-motion support:

  • Motion values — one module for durations, ease curves, press scale and the shared popover motion (rules 1, 2, 4, 10–15).
  • Skeleton — the same placeholder shape for every list and panel that loads (skeleton-swap).
  • Avatar image — blur-up from a small placeholder, no flicker in virtual lists (blur-up-image).
  • Press feedback — one press style for buttons and icons (press-depth).
  • Loading button — shows progress without changing width (loading-button).
  • Tooltip group — instant tooltips after the first one (tooltip-group).

The set lands with its first user (slice 5: Skeleton and avatar image in Lorebooks/Personas), then slices 6–9 only use it.

Motion quality bar (the 20 animation rules, mapped)

Source: an animation-rules post the maintainer shared (Instagram screenshot). Checklist for slice 8 and every motion change; values marked "pending" need a decision.

# Rule What we do
1 Ease-out for entrances Already true for fade-in-up / scale-in / message-in; use one shared ease-out curve.
2 Dropdowns 150–250 ms 150–200 ms in one shared popover motion constant (today each menu has its own).
3 Stagger rows by 30 ms Only on the first time content shows, with a cap on total time. Never on "load more" or chat open.
4 Scale 0.97 on press active:scale-95 → 0.97 on controls > 24 px; keep 0.90 on small icons (pending).
5 Stretch moving knobs 12% Toggle switches only; optional polish.
6 Stagger as details settle Leave out.
7 Arcs for object movement Leave out.
8 Pulse to confirm success Leave out — optimistic updates already confirm the action.
9 Ease-in-out for moves Mobile panel slides.
10 Popovers start at 0.95 Part of the shared popover motion.
11, 12 Enter from / exit to the trigger transform-origin from the trigger side.
13 No bounce on everyday UI Mobile panels (11 px past the edge) and toasts (11% overshoot) → tweens.
14 Do not tween while held Pull-to-omnibar and sheet drags follow the finger directly.
15 Exits 20% shorter Part of the shared motion values.
16 Overlap old and new states popLayout for panel swaps; chat header from cache so a chat switch never shows a blank pane.
17 Masks for reveals Leave out.
18 Crossfade icons + blur Only on small icons (Send/Stop). Never blur large surfaces.
19 Rubber band past bounds Drag sheets only; optional.
20 Reuse the same layoutId Only for one or two elements (e.g. active tab indicator). Never in lists.

Rules the post leaves out that matter most for stutter:

  • Animate only transform and opacity; no transition-all on hot controls (shadows, borders, gradients, blur stutter).
  • No animation on frequent or keyboard actions (omnibar, quick switcher, row selection).
  • No animation while the main thread is busy; endless glow/gradient animations stop while a reply streams and with reduced effects.
  • Obey reduced motion, including Framer Motion calls.

How we check: for each changed animation, a 60 fps screen recording on desktop and at 4× CPU; a Playwright trace with no frame over 16 ms and no long task; a before/after video in each motion PR.

Originally created by @Gunterlie on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8904 Originally assigned to: @Gunterlie on GitHub. Tracking issue for a series of small PRs that make Marinara Engine feel fast: instant feedback on clicks, no freezes, smooth streaming and tidy, non-stuttery motion. One branch per slice, landed against `staging` one after another. ## Targets Measured on a seeded instance (3,000 cards, 300-card folder, 500-entry lorebook, two 1,000-message chats, fake streaming model), at CPU 1× and 4× throttle: - Feedback within 50 ms of a click or tap; INP under 100 ms - Chat switch and panel open under 100 ms after first load - Tag filter on 3,000 cards under 150 ms - No long task over 50 ms while a reply streams ## Slices - [x] **1. Freezes** — #8903. Accent Pulse (desktop default) restarted ~2,800 colour transitions every tick. Characters panel scroll: style 5,030 → 303 ms/s; at 4× CPU, clicks work again. Found by kolacheee. - [x] **2. Large libraries** — server-side tag/exclude-tag/folder filters with totals and folder counts, so chips and folders cover all cards (not only loaded pages); load on scroll; "N of total"; fixes folders showing only loaded members. Same fix for Personas. From a Discord report about 100-card pages and incomplete filters. - [x] **3. No waiting on clicks** — #8910. open chats from the list cache, prefetch messages on pointer down, preload panels/editors on idle, lazy Spotify. - [x] **4. Optimistic actions** — #8912. delete message (single and bulk), chat rename, character folder rename/move/delete; roll back on error. Swipe delete stays server-first (the server picks the next shown swipe); the character favourite has no quick toggle today, it saves with the editor. - [ ] **5. Virtualized card lists, no pagination** — Characters loads every card in one request and draws only the visible cards, so open and scroll stay fast at any library size; the scrollbar shows the whole library and Load more goes away. Measured: a full card is 5–20 KB, so all 2,700 cards would be 20–50 MB. Step 1 (Characters panel, #8920, merged) keeps pages hidden under the virtual list (next page loads near the end of the list; Load more stays only as an error fallback). Step 2 (#8923, merged): a slim list request (summary snippet and preview metadata only, ~1 MB for 2,700 cards) with full text loaded on demand, then the pages go away. Then Lorebooks and Personas. Chat messages keep their pages. Motion input from [interior.dev](https://www.interior.dev): `skeleton-swap` and `blur-up-image`, so rows mounted during fast scroll do not flicker. - [ ] **6. Smooth streaming** — re-render only live rows, no scroll jump at stream end, keep action-bar space, save partial reply before Stop clears state, drop the roleplay chat-open stagger. Input from interior.dev: `streaming-text` (frame loop that counts real time, clamped frame step, `aria-busy`, one announcement at the end) and `new-items-pill` ("new messages" pill instead of moving your scroll). - [ ] **7. Weak devices** — reduced effects "auto" default on weak devices (decision pending), lighter accent animation there. - [ ] **8. Motion pass** — press scale, no overshooting springs on everyday UI, `popLayout` panel swaps, shared popover motion, no `transition-all` on hot controls (values pending). Input from interior.dev: `press-depth`, `tooltip-group` (instant tooltips after the first), `loading-button` (progress without a width change). - [ ] **9. Mobile** — `dvh`, overscroll containment on sheets, 44 px top-bar hit areas. ## Later - Server time to first token, paging for `/chats` and `/lorebooks`, panel scroll memory. - Slice 3 left the first Roleplay open ~120 ms slower (chunk waterfall plus an idle gap); look at it again. - interior.dev ideas to consider later: `hold-to-confirm` for deletes, `typing-indicator`, `filter-grid`, `task-steps`, `live-activity`. interior.dev components are MIT; we copy techniques into our own code (no new dependency) and credit interior.dev in each PR that uses one. ## Learnings so far - Measure at 4× CPU too: the 1× baseline looked fine while the app did not respond at 4×. - At 4× the 2 Hz root accent writes are still the biggest idle cost (~800 ms style/s) — input for slice 6. - Chat-open timings vary a lot between runs; report medians. ## Consistency: one shared set Fast and pretty must look the same everywhere. Every slice uses one shared set instead of one-off animations, built once (inspired by interior.dev, MIT, credited) and themed with Marinara tokens and reduced-motion support: - **Motion values** — one module for durations, ease curves, press scale and the shared popover motion (rules 1, 2, 4, 10–15). - **`Skeleton`** — the same placeholder shape for every list and panel that loads (`skeleton-swap`). - **Avatar image** — blur-up from a small placeholder, no flicker in virtual lists (`blur-up-image`). - **Press feedback** — one press style for buttons and icons (`press-depth`). - **Loading button** — shows progress without changing width (`loading-button`). - **Tooltip group** — instant tooltips after the first one (`tooltip-group`). The set lands with its first user (slice 5: `Skeleton` and avatar image in Lorebooks/Personas), then slices 6–9 only use it. ## Motion quality bar (the 20 animation rules, mapped) Source: an animation-rules post the maintainer shared (Instagram screenshot). Checklist for slice 8 and every motion change; values marked "pending" need a decision. | # | Rule | What we do | |---|---|---| | 1 | Ease-out for entrances | Already true for fade-in-up / scale-in / message-in; use one shared ease-out curve. | | 2 | Dropdowns 150–250 ms | 150–200 ms in one shared popover motion constant (today each menu has its own). | | 3 | Stagger rows by 30 ms | Only on the first time content shows, with a cap on total time. Never on "load more" or chat open. | | 4 | Scale 0.97 on press | `active:scale-95` → 0.97 on controls > 24 px; keep 0.90 on small icons (pending). | | 5 | Stretch moving knobs 12% | Toggle switches only; optional polish. | | 6 | Stagger as details settle | Leave out. | | 7 | Arcs for object movement | Leave out. | | 8 | Pulse to confirm success | Leave out — optimistic updates already confirm the action. | | 9 | Ease-in-out for moves | Mobile panel slides. | | 10 | Popovers start at 0.95 | Part of the shared popover motion. | | 11, 12 | Enter from / exit to the trigger | `transform-origin` from the trigger side. | | 13 | No bounce on everyday UI | Mobile panels (11 px past the edge) and toasts (11% overshoot) → tweens. | | 14 | Do not tween while held | Pull-to-omnibar and sheet drags follow the finger directly. | | 15 | Exits 20% shorter | Part of the shared motion values. | | 16 | Overlap old and new states | `popLayout` for panel swaps; chat header from cache so a chat switch never shows a blank pane. | | 17 | Masks for reveals | Leave out. | | 18 | Crossfade icons + blur | Only on small icons (Send/Stop). Never blur large surfaces. | | 19 | Rubber band past bounds | Drag sheets only; optional. | | 20 | Reuse the same `layoutId` | Only for one or two elements (e.g. active tab indicator). Never in lists. | Rules the post leaves out that matter most for stutter: - Animate only `transform` and `opacity`; no `transition-all` on hot controls (shadows, borders, gradients, blur stutter). - No animation on frequent or keyboard actions (omnibar, quick switcher, row selection). - No animation while the main thread is busy; endless glow/gradient animations stop while a reply streams and with reduced effects. - Obey reduced motion, including Framer Motion calls. How we check: for each changed animation, a 60 fps screen recording on desktop and at 4× CPU; a Playwright trace with no frame over 16 ms and no long task; a before/after video in each motion PR.
Author
Owner

@Gunterlie commented on GitHub (Nov 7, 2026):

closing till Monday

<!-- gh-comment-id:6703803369 --> @Gunterlie commented on GitHub (Nov 7, 2026): closing till Monday
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#8546
No description provided.