Skip to content

Make track review in the session view clearer and faster, from partner feedback - #1441

Draft
mihow wants to merge 12 commits into
feat/tracking-uifrom
feat/tracking-ui-feedback
Draft

mihow wants to merge 12 commits into
feat/tracking-uifrom
feat/tracking-ui-feedback

Conversation

@mihow

@mihow mihow commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

A partner's evaluation of the tracking tools produced a list of interface requests from people reviewing tracks frame by frame. This PR works through the ones that need only frontend changes. The session view is less cluttered: path crops are hidden until asked for, and the track panel no longer scales with the zoom or gets cut off at the image's edge. Reviewers can see the names the classifier gave each frame, jump to a track's first or last frame, open the original photo behind a crop, and sort merge candidates by one column and then another.

This PR is stacked on #1432 and should be reviewed and merged after it.

List of Changes

# Change (user effect) How Notes
1 Along a track's path, only the outlines of other frames are drawn by default. The existing "Show crops in path" toggle turns the crops on, and the browser remembers the choice. showPathCrops moves into the user preferences store (default off). That store's localStorage reads and writes are now wrapped in try/catch. Storing it follows the same cookie-consent rule as the other preferences. Without functional-cookie consent, the toggle lasts only for the visit.
2 The panel on a capture's box stays at normal size at any zoom level. It flips or shifts to stay in the window, scrolls when it is taller than the space available, and disappears when its box is panned out of view. Box panels and tooltips render through a Radix portal (hideWhenDetached, viewport collision, max-h from --radix-popover-content-available-height). A zoom or pan sends a scroll event so the panel repositions. A faded panel does not catch clicks. Before this change, zooming in scaled the panel with the image and cut it off.
3 The merge picker is sortable by several columns: click Frames, then Species, to get species A to Z with frame counts breaking ties. The header numbers the tie-breaking columns, and the order control shows the full order ("Species, then frames"). addSortColumn builds a list of up to 3 keys, and sortMergeCandidates applies them in order. The server ranking remains the default.
4 The track panel in the session view lists the names the classifier gave the frames, e.g. "Species A ×7, No classification ×2". formatFrameNames over the existing frameNames from occurrence details. Uses the existing per-frame label rule: a terminal classification wins over a moth/non-moth filter.
5 Once the path is shown, the track panel has "First frame" and "Last frame" buttons. Each frame in an occurrence's frame list has an icon that opens the full capture it was cropped from. getPathEnds in track-navigation.ts. The frame caption links to detection.capture.url, which the occurrence detail already returns. Buttons are disabled when the viewer is already on that frame.

Selecting several merge candidates and merging them in one action was also requested. #1432 already supports this, and it was confirmed in the browser ("Merge 2 occurrences"), so this PR does not change it.

Detailed Description

How this was tested

  • tsc --noEmit, yarn lint and yarn test all pass (39 suites, 240 tests). There are new unit tests for the preference store (default value, persistence, storage that throws), the multi-column sort, the frame-name formatter, the path ends and the frame's capture link.
  • Checked in a browser against a local copy of the evaluation data, using a Vite dev server:
    • Path crops are off on first load. After turning them on, they are still on after a reload.
    • Zoomed to 60%: before this change, the panel was drawn at 3x size and clipped. After it, the panel stays normal size and hides while its box is off screen. It returns after Reset.
    • Clicking "Last frame" on a 14-frame track stepped the viewer from capture 169 to capture 180, and the button then became disabled.
    • Clicking Frames and then Species ordered the candidates by species, with frames breaking ties. The Frames header showed a "2".
    • A two-frame track with two different frame names listed both on its panel.

The screenshots from the browser check (before and after zoom, default path view, panel with names and first/last buttons, frame capture link, multi-column sort) are held locally and not uploaded, because PR images cannot be attached from the CLI.

Not covered here

  • The comparison preview in the merge picker is still positioned with a fixed height estimate. In the checks it measured exactly that height, but a longer verdict text could push it a few pixels past the bottom of the window.
  • The panel is now portalled, so near the bottom of the window it can overlap the capture navigation bar. It scrolls instead of being cut off.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8

mihow and others added 6 commits September 28, 2026 14:46
…or them

A long track that barely moves stacks its crops on top of each other and hides
the capture underneath. The path now draws outlines only by default, and the
existing toggle is remembered per browser through the user preferences store,
whose reads and writes now tolerate storage that throws.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
The panels on a capture's boxes rendered inside the zoomable image, so they
grew with the zoom and were clipped by the image's edges. They now render in a
portal at their normal size, flip or shift to stay within the viewport, and
fade out without catching clicks when their box is panned out of view.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
…ndidate sort

Reviewers asked to order candidates by species and then by frames, the way a
spreadsheet sorts one column at a time. Clicking a column header now keeps the
previous one or two columns as tie-breakers, numbers them in the header, and
names the whole order in the order control. The server ranking stays the
default until a header is clicked.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
…session panel

Reviewers wanted to see what each detection was called before it joined a
track, for example to spot a frame first labelled as another species. The
panel on a track's box in the session view now lists those names with a count
of frames each, such as "Species A ×7, Species B ×2", from the frame labels
the occurrence details already carry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
…its box

When a box sits mid-image and the track panel is taller than the room above or
below it, the panel now takes the available height and scrolls, so its top and
its actions stay on screen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
…ll capture

Reviewers checking a long track wanted to see what happened just before it
started or after it ended, and to look at the original photo behind a crop.
The track panel in the session view gains first and last frame buttons once
its path is shown, and each frame in an occurrence's frame list links to the
full capture it was cropped from.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 0eada49
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6abd5de11732da00084edd89

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

mihow and others added 2 commits September 28, 2026 15:19
Capture panels are portalled out of the zoomed image, so they no longer
inherit the page's stacking order. At z-40 a panel that reached the top of
the window painted over the app header. They now sit on layer 1, above the
page content and below the header (layer 2) and dialogs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
mihow and others added 4 commits September 29, 2026 18:36
The tracking UI branch replaced the occurrence page's frame list with a paged
frame strip and moved the per-label frame counts to the server. The link from
each frame to its full capture, added on this branch, is carried over to the
paged frames: the frame payload's capture URL becomes the frame's captureUrl
and the frame strip passes it to the caption. The frame-name formatting used
by the session panel stays, tested against server-shaped frame names.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7Xf6VPbwWtTumhjjF15g8
@mihow

mihow commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Claude says: The merge order and plan for tracking, agreed with the owner today, are on #1412: #1412 (comment)

This PR's place: its review improvements feed the smaller review PRs that follow #1469 (#1431, #1433).

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