Skip to content

feat(ui): a person pins a note where they click, and can always read it (T-106/T-107/T-108) - #98

Merged
CLYEH merged 6 commits into
developfrom
feat/ui-note-human-fixes
Sep 2, 2026
Merged

CLYEH merged 6 commits into
developfrom
feat/ui-note-human-fixes

Conversation

@CLYEH

@CLYEH CLYEH commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

Three owner-reported problems with the human side of notes, agent side untouched:

  • T-106 — with the Note popover open, a click on the map places a draft pin and the note is pinned there; with no click it falls back to the map centre as before. New UI-only note-store.ts (draft + open), a .note-draft-pin marker in MapCanvas, and handOwnsClick so feature / bead / drawing taps do not fire while the popover owns the click. Escape closes the popover.
  • T-107 — tapping a pin's bubble folds it to a chip (data-folded, annotation-chip); tapping the chip unfolds it; tapping the stem/anchor opens the card. Previously the bubble got .hidden with no way back.
  • T-108 — the "On the map" card shows the whole note (no 72-char truncation), wrapped, capped at 40vh with scroll for pathological newline-heavy input.

The <form toolname="add_note"> attributes are byte-identical; an agentInvoked submit still lands at the map centre, ignores any human draft, and no longer clears it. Nothing under src/lib/** changed.

How verified

  • pnpm check green; pnpm build green.
  • e2e: new 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); full pnpm test:e2e green.
  • Adversarial review (reviewer): S1 agent submit wiped the human draft, S2 unbounded card height, S4 no Escape, N1/N3/N4 — all fixed in the follow-up commit.

Task: T-106, T-107, T-108

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
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
glassmap Ready Ready Preview Sep 2, 2026 5:32am UTC

@CLYEH
CLYEH merged commit 890b74e into develop Sep 2, 2026
3 checks passed
@CLYEH
CLYEH deleted the feat/ui-note-human-fixes branch September 2, 2026 05:37

This branch was successfully deployed

1 active deployment
Preview — 80f434db Deployed Sep 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant