mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #101] [CLOSED] feat(game): lockable draggable HUD panels + layout/drag-lag fixes #4464
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#4464
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/101
Author: @LukaTheHero
Created: 4/19/2026
Status: ❌ Closed
Base:
main← Head:feat/game-hud-lock-drag📝 Commits (1)
5514533feat(game): lockable draggable HUD panels + fix column reshuffle/drag lag📊 Changes
4 files changed (+160 additions, -18 deletions)
View changed files
➕
packages/client/src/components/game/DraggablePanel.tsx(+104 -0)📝
packages/client/src/components/game/GameMap.tsx(+28 -6)📝
packages/client/src/components/game/GameSurface.tsx(+2 -5)📝
packages/client/src/components/game/GameWidgetPanel.tsx(+26 -7)📄 Description
Summary
framer-motion. Lock state and{x, y}position persist per panel inlocalStorageundermarinara-game-panel:*.What changed
New:
packages/client/src/components/game/DraggablePanel.tsxuseDraggablePanel(id)hook — returns{ locked, toggleLocked, x, y, handleDragEnd }backed by motion values and localStorage.PanelLockButton— lucideLock/Unlocktoggle styled to match the existingtext-white/30 hover:text-white/70chevron/collapse indicators, withstopPropagationso it doesn't fire the header's collapse click.Updated:
GameWidgetPanel.tsx,GameMap.tsxWidgetCardandGameMapPanelrender asmotion.divwithdrag={!locked},dragMomentum={false},dragElastic={0}.<button>s becamerole="button"divs so the lock toggle can nest without invalid HTML, while preserving keyboard (Enter/Space) toggle behavior.w-52, border, bg, shadow, blur) moved from theGameSurfacewrapper ontoGameMapPanel's draggable root, so the whole visual card translates together when dragged.Updated:
GameSurface.tsxitems-start→items-end. The container is anchored atbottom-24with no fixed height, so underitems-start, growing the left column pushed the container's top upward and carried the top-aligned right column up with it. Withitems-endboth columns bottom-align and grow independently upward.GameMapPanelowns them now.Drag lag fix:
WidgetCardpreviously usedtransition-all, which made the browser tween every transform updateframer-motionpushed 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.