Repository navigation
feat(ui): a person pins a note where they click, and can always read it (T-106/T-107/T-108) - #98
Merged
Merged
Conversation
Two things a person could not do on their own map. A note always landed at `view.center`, so choosing a place meant panning until the place sat under an invisible crosshair; and folding a pin's bubble left a 9px anchor whose only answer was "open the card about me", which read as a note that had vanished. The place a human's note goes now comes from a click on the map while the note popover is open, held in `note-store.ts` beside the drawing draft — UI state, so no tool can see or steer an unfinished note. The agent side is untouched by construction: `add_note` keeps its toolname, description and autosubmit, and an `agentInvoked` submit still pins at `view.center` whatever a human has half-placed. A folded pin keeps a chip on screen (its source colour and the note's first word) and any click on it unfolds it and does nothing else, so the fold has a way back. `data-folded` says which state it is in. Task: T-106, T-107
The "On the map" card was the only surface a note is fully readable on — the pin's bubble is 210px wide and a person can fold it away — and it clipped the note to 72 characters. A 200-character note therefore had an end that nothing on the page could show: fold the pin, tap it, and the answer was an ellipsis. The headline for a note is now the note, wrapped; the card already measures its own height and flips above or below the tap, so a long note makes a taller card rather than a lost one. Feature and shape headlines are unchanged. Task: T-108
S1 — an agent's `add_note` no longer clears the draft pin a person is still placing. The draft is the human's answer to "where"; an agent never reads it (it pins at the centre) and must not spend it either. S2 — the note headline on the "On the map" card is bounded. `annotate` accepts 500 characters and every one of them may be a newline, which was 250 lines of card: unscrollable, and below 641px the card is fixed against the bottom bar so it grew off the top of the screen with no way back. 25vh and a scrollbar, not 40vh: measured at 1440x900, a 40vh card is 475px, fits on neither side of a tap in the middle of the map, and hangs its Remove/Keep buttons 41px below the fold. At 25vh the same worst-case card is 340px and lands wholly on screen at every tap height on both tiers. S4 — Esc leaves note mode. While the popover is open the map is a place-picker and taps on places, beads and shapes are suppressed, so a second press on the Note chip was the only way out — and the person's focus is usually out on the map by then, hence a window-level listener bound only while it is open. Focus goes back to the chip. A map click stays the placing gesture and is deliberately not also a way out. N1/N3/N6 — the CJK test literal is a place name rather than a sentence, the draw-only guard on `tapAnnotation` says why it is draw-only, and the note store test asserts whole-state identity of the map store rather than two fields. Task: T-106 Task: T-107 Task: T-108
Draft placement, submit-at-draft, the fallback centre, popover suppression of a feature tap, draft-clears-on-close-or-draw, the fold/unfold cycle, and the card showing a note uncut all lacked end-to-end coverage against a real MapLibre canvas and a real form submit. Also covers the review-fix commit's own three changes: an agent's add_note no longer spends a human's half-placed draft (a later human submit still uses it), Escape leaves note mode from anywhere (including the caret) and returns focus to the Note chip, and a worst-case 500-character/250-newline note keeps its card's edges on screen and its text scrollable at both a desktop and a mobile viewport. Task: T-106, T-107, T-108
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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
Three owner-reported problems with the human side of notes, agent side untouched:
note-store.ts(draft + open), a.note-draft-pinmarker inMapCanvas, andhandOwnsClickso feature / bead / drawing taps do not fire while the popover owns the click.Escapecloses the popover.data-folded,annotation-chip); tapping the chip unfolds it; tapping the stem/anchor opens the card. Previously the bubble got.hiddenwith no way back.40vhwith scroll for pathological newline-heavy input.The
<form toolname="add_note">attributes are byte-identical; anagentInvokedsubmit still lands at the map centre, ignores any human draft, and no longer clears it. Nothing undersrc/lib/**changed.How verified
pnpm checkgreen;pnpm buildgreen.e2e/note-human-gestures.spec.ts(click-to-place vs centre fallback, agent submit lands at centre despite a draft, popover close / draw start clears the draft, fold / unfold, 200-char note fully on the card); fullpnpm test:e2egreen.Task: T-106, T-107, T-108