mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #326] [MERGED] feat(game): middle-mouse + click navigation through chat history for game mode #4562
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#4562
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/326
Author: @LukaTheHero
Created: 4/30/2026
Status: ✅ Merged
Merged: 4/30/2026
Merged by: @LukaTheHero
Base:
main← Head:feat/game-middle-mouse-nav📝 Commits (1)
c04b418feat(game): middle-mouse + click navigation through chat history📊 Changes
6 files changed (+374 additions, -27 deletions)
View changed files
📝
packages/client/src/components/game/GameMap.tsx(+1 -0)📝
packages/client/src/components/game/GameNarration.tsx(+246 -27)📝
packages/client/src/components/game/GameSurface.tsx(+104 -0)📝
packages/client/src/components/game/GameWidgetPanel.tsx(+2 -0)📝
packages/client/src/components/panels/SettingsPanel.tsx(+9 -0)📝
packages/client/src/stores/ui.store.ts(+12 -0)📄 Description
Summary
Adds an opt-in "Mouse-wheel + click navigation" setting under Settings → General (right below "Instantly reveal game text"). When enabled, the player can scroll back through past chat entries with the mouse wheel and step forward with click — without leaving the game scene.
Behavior
UI immunity
Events that originate inside any of the following are skipped — the offset doesn't move and native UI behavior is unaffected:
button, a, input, textarea, select, label.button, link, dialog, menu, menuitem, tab, tablist, slider, checkbox, switch, combobox, listbox, option.[data-radix-popper-content-wrapper].[data-game-skip-bg-nav="true"]was added to:role="dialog").So clicking inside any of those, or wheeling inside the Logs modal, does what you'd expect (scroll, button click, dismiss) without bumping the offset.
Implementation
useUIStore.gameMiddleMouseNav— new persisted boolean.GameSurfaceownsmessageOffset/nextActionToken/wheelNavMaxOffsetstate and a window-level wheel + click listener attached when the toggle is on. Capture phase so nothing can stopPropagation us out of the loop.GameNarrationbuilds aflatLogEntrieslist (chronological, one entry per visible segment) and resolves the current review entry viaflatLogEntries[length - 1 - offset]. Reports the clamp upward viaonMaxNavOffsetChange.onStepForward) decrements the offset by one; jump-home (onJumpToLatest) zeroes it. Both wired through GameSurface.DirectionEngineis unmodified — no DOM-stacking gymnastics.Test plan
pnpm checkpasses.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.