mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #102] [MERGED] feat(game): movable lockable HUD panels + layout/drag fixes #4467
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#4467
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/102
Author: @LukaTheHero
Created: 4/19/2026
Status: ✅ Merged
Merged: 4/19/2026
Merged by: @SpicyMarinara
Base:
main← Head:feat/game-movable-hud-panels📝 Commits (1)
e12f501feat(game): movable lockable HUD panels + fix column reshuffle📊 Changes
4 files changed (+225 additions, -28 deletions)
View changed files
➕
packages/client/src/components/game/DraggablePanel.tsx(+115 -0)📝
packages/client/src/components/game/GameMap.tsx(+42 -8)📝
packages/client/src/components/game/GameSurface.tsx(+18 -8)📝
packages/client/src/components/game/GameWidgetPanel.tsx(+50 -12)📄 Description
Summary
Adds a small lock icon next to the collapse toggle on every Game Mode HUD panel (map, Bonds, Leads, Mana Stability, Exposure Risk). Panels are locked by default; clicking the lock swaps it to an open padlock, draws a faint ring around the card, and makes it free-draggable within the game surface. Lock state and position persist per chat so layouts don't leak between games.
What's in the box
New:
packages/client/src/components/game/DraggablePanel.tsxuseDraggablePanel(chatId, panelId)hook — returns{ locked, toggleLocked, x, y, handleDragEnd }. Storage key ismarinara-game-panel:<chatId>:<panelId>, so every game gets its own HUD layout.useRefseed on first render, so moved panels paint at their saved position with no origin-flash flicker.PanelLockButton— lucideLock/Unlocktoggle styled to match the existing chevron/collapse indicators (text-white/30 hover:text-white/70), withstopPropagationso it doesn't fire the header's collapse click.Updated:
GameWidgetPanel.tsx,GameMap.tsxmotion.divwithdrag={!locked},dragMomentum={false},dragElastic={0}, anddragConstraintspointed at the game surface — panels can't be dragged off-screen.WidgetCardkeyed by${chatId}:${widget.id}so switching games remounts with fresh motion values.w-52, border, bg, shadow, blur) moved from theGameSurfacewrapper ontoGameMapPanel's draggable root, so the whole visual card translates together.data-tour="game-map"moved from the static wrapper onto the draggable map root, so the onboarding tutorial highlight tracks it wherever it's dragged.Updated:
GameSurface.tsxhudSurfaceRefon the main game content<div>, passed asconstraintsRefto both map and widget panels.activeChatIdthreaded down aschatIdto both panels for storage scoping.items-start→items-end(fix below).Pre-existing bugs fixed along the way
items-startbut anchored atbottom-24with no fixed height, so growing the left column pushed the container top upward and dragged the top-aligned right column with it. Switched toitems-endso both columns bottom-anchor and grow independently upward.WidgetCardhadtransition-all, which made the browser tween every transform update framer-motion pushed during drag. Narrowed totransition-colorsso only color state animates; transform updates are immediate.Test plan
pnpm checkpasses (client build + typecheck clean)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.