Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/annotate ranges #561

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

ShrimpCryptid
Copy link
Contributor

@ShrimpCryptid ShrimpCryptid commented Feb 7, 2025

Problem

Closes #514, "Annotation - select range of track with shortcut keys." (Also closes #531, "optimize track building in Dataset".)

When Shift is held, the time annotation mode can change a range of annotations within the same track. Click a track, go to a different timepoint, and click again with Shift held down to label (or unlabel) all of the objects in between.

Estimated review size: medium, 15-20 minutes

Solution

  • Moved annotation click handling behavior out of Viewer.tsx and into a new callback, handleAnnotationClick.
  • Added a new React hook, useShortcutKey, which tracks whether a given key is pressed down.
  • Added a new behavior to the time selection mode where, when annotation editing is enabled, clicking one an object in a track and then holding Shift while clicking another object will annotate the segments of the track in between those two points.
    • Shift clicking again on the same object will toggle the range.
  • Added a tag in the hover tooltip that appears when shift is pressed and a range of cells will be edited.

Misc:

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. A setup step / beginning state
  2. What to do next
  3. Any other instructions
  4. Expected behavior
  5. Suggestions for testing

Screenshots (optional):

Show-n-tell images/animations here

@ShrimpCryptid ShrimpCryptid added the new feature New feature or request label Feb 7, 2025
@ShrimpCryptid ShrimpCryptid self-assigned this Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

PR Preview Action v1.4.8
🚀 Deployed preview to https://allen-cell-animated.github.io/timelapse-colorizer/pr-preview/pr-561/
on branch gh-pages at 2025-02-07 21:28 UTC

Copy link

github-actions bot commented Feb 7, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 74.13% 6444 / 8692
🔵 Statements 74.13% 6444 / 8692
🔵 Functions 59.64% 170 / 285
🔵 Branches 80.97% 532 / 657
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/colorizer/AnnotationData.ts 95.98% 91.42% 88.23% 95.98% 183-185, 189-190, 199-200, 251-252, 320-323
src/colorizer/Dataset.ts 77.7% 74.35% 70.27% 77.7% 191, 227-228, 246-247, 259-260, 287-290, 312-313, 317-319, 323-324, 336-337, 340-341, 347-348, 351-366, 394-395, 399-400, 416-425, 440-441, 460-462, 472-478, 496-499, 516-522, 526-527, 531-532, 538-545, 548-552, 555-586, 593-600
src/colorizer/utils/react_utils.ts 35.23% 100% 0% 35.23% 42-53, 69-74, 78-85, 144-206, 227-255, 269-310, 334-491
src/colorizer/utils/hooks/index.ts 100% 100% 100% 100%
src/colorizer/utils/hooks/useShortcutKey.ts 14.28% 100% 0% 14.28% 5-28
Generated in workflow #1430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize track building in Dataset Annotation - select range of track with shortcut keys
1 participant