Repository navigation
Keep a bar's width when it is clicked in edit mode - #1
Open
alex-andreyev wants to merge 1 commit into
Open
alex-andreyev wants to merge 1 commit into
alex-andreyev wants to merge 1 commit into
Conversation
In edit mode a press on a bar, an era's edge or a card is claimed for a drag. Letting go cleared the element's inline width even when nothing had moved, so a clicked period's bar shrank to the width of its name until the next zoom or pan drew it again. A press let go where it began now leaves the element as it was built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What goes wrong
In edit mode, clicking a period's bar to select it shrinks the bar to the width of its name, while the details open on the right. The next zoom or pan draws it right again. An era pressed at its edge and an event card do the same.
Why
In edit mode
claimPointer(src/app/editing.ts) takes every press on a bar, an era's edge or a card, so that it can be dragged. On release,up()cleared the element'sstyle.transform,style.widthandstyle.boxShadowwhether or not anything had moved.The strip sets each bar's width inline (
buildBarsinview.ts), and nothing in a drag sets it. Clearing it left the button only as wide as its label until the next build.Fix
A press let go where it began is a click:
up()now returns before touching the element. After a real drag it resets what the drag set (transform, box shadow), as before. The straywidthreset is gone.Test
tests/app.mjsadds a check in edit mode: a click on Apollo's bar selects it and leaves its inline width and the view unchanged. The bar is placed wholly in the part of the strip the details panel leaves free, so selecting it does not move the strip.The check fails without the fix (
"200.875px"→"") and passes with it.npm run checkpasses: all unit tests, 193 browser checks and 22 PWA checks.The suite was run with
TZ=UTC. Two date tests intests/model.mjsfail in America/Los_Angeles onmainas well; that is unrelated to this change.🤖 Generated with Claude Code