-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/annotation list #236
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
58c3d7e
first stab at annotation list
469f69c
start idx at 0
TrevorBurgoyne 0d36385
sync hover of annotation -> anno list
TrevorBurgoyne 1341b0d
fix edit suggest on list hover, and support showing edits on fly to
TrevorBurgoyne 3bc71da
use spatial type svg instead of square
TrevorBurgoyne ff3683f
popup toast with current idx / total
TrevorBurgoyne 50925c7
move toast to index.js and trigger on each fly_to
TrevorBurgoyne 68fb55d
remove broken labels on canvas
TrevorBurgoyne bc01ec7
Bump version and update api spec
TrevorBurgoyne fb926a5
better spot for default annotation list
TrevorBurgoyne f8839c6
highlight in list when flying to annotation
TrevorBurgoyne 731f228
Add automated building/publishing to npm, and rm tracked build files
TrevorBurgoyne 5211e42
update changelog
TrevorBurgoyne f8ae961
add tests
TrevorBurgoyne c0f83db
cleanup
TrevorBurgoyne 42e972f
fix tests
TrevorBurgoyne a59c2c4
Update CHANGELOG.md
TrevorBurgoyne f72d5ff
allow hover in list to work with delete keybind
TrevorBurgoyne e00f521
Merge branch 'feature/annotation-list' of github.com:SenteraLLC/ulabe…
TrevorBurgoyne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,36 @@ | ||
| ## Tasks | ||
| - [x] Read the description in [#164](https://github.com/SenteraLLC/ulabel/issues/164) | ||
| - [x] Read the description in [#234](https://github.com/SenteraLLC/ulabel/issues/234) | ||
| - [x] Write a clear summary of the requested change | ||
| - [x] Propose some options of how to proceed. Wait for user input to decide which to try first. | ||
| - [x] Break the requested feature down into concrete steps. Add the steps to the tasks list, and then start working on then one by one. | ||
|
|
||
| ### Decision: Proceeding with Option 3 (Webpack modernization + dependency cleanup) | ||
| ### Summary | ||
| Create an annotation list toolbox item that displays all annotations in a list format, similar to other annotation tools. The list should: | ||
| - Display each annotation (by ID or index) | ||
| - Allow show/hide of deprecated annotations (default: hide) | ||
| - Support grouping by class | ||
| - Enable clicking to "fly to" the annotation | ||
| - Show annotation labels/IDs (on hover or drawn on canvas) | ||
| - Display "current idx / total" when navigating through annotations | ||
| - Highlight annotations when hovering in the list | ||
|
|
||
| #### Step 1: Move dependencies to devDependencies | ||
| - [x] Move `@turf/turf` from dependencies to devDependencies | ||
| - [x] Move `jquery` from dependencies to devDependencies | ||
| - [x] Move `polygon-clipping` from dependencies to devDependencies | ||
| - [x] Move `uuidv4` from dependencies to devDependencies | ||
| - [x] Test: Run `npm install` and verify it works | ||
| - [x] Test: Run `npm run build` and verify output is identical (both files 1039.6 KB) | ||
|
|
||
| #### Step 2: Enable and modernize webpack minification ✅ COMPLETE | ||
| - [x] Remove commented-out UglifyJsPlugin code (deprecated) | ||
| - [x] Enable webpack 5's built-in TerserPlugin for minification | ||
| - [x] Configure it to only minify `ulabel.min.js`, not `ulabel.js` | ||
| - [x] Test: Run `npm run build` and verify both files are created | ||
| - [x] Test: Verify `ulabel.js` is NOT minified (readable) - 2.33 MB with webpack runtime and formatted code | ||
| - [x] Test: Verify `ulabel.min.js` IS minified (smaller size) - 1.02 MB minified | ||
| - [x] Test: Run `npm run lint` - No errors | ||
| - [x] Note: File size difference (2.33 MB vs 1.02 MB) is expected - readable version includes webpack runtime overhead | ||
|
|
||
| #### Step 3: Verify and document ✅ COMPLETE | ||
| - [x] Compare file sizes before/after | ||
| - Before: Both files 1039 KB (both minified, minification was disabled) | ||
| - After: ulabel.js 2.33 MB (readable), ulabel.min.js 1.02 MB (minified) | ||
| - Result: Minification now working correctly, file size increase for non-min version is expected | ||
| - [x] Update CHANGELOG.md with changes | ||
| - [x] Document any findings or recommendations | ||
|
|
||
| #### Step 4: Security and dependency updates ✅ COMPLETE | ||
| - [x] Run `npm audit` to identify vulnerabilities | ||
| - [x] Fix 12 vulnerabilities using `npm audit fix` | ||
| - [x] Apply breaking changes for remaining issues with `npm audit fix --force` | ||
| - [x] Update `typescript-eslint` packages to be compatible with ESLint 9.37.0 | ||
| - [x] Fix linting issues in `tests/e2e/fixtures.js` | ||
| - [x] Verify all tests still pass (28 unit tests + 36 e2e tests) | ||
| - [x] Final audit: 0 vulnerabilities | ||
|
|
||
| #### Step 5: Configure package exports for minified by default ✅ COMPLETE | ||
| - [x] Update `main` and `module` fields to point to `dist/ulabel.min.js` | ||
| - [x] Add `exports` field with options: `.` (minified), `./min` (minified), `./debug` (unminified) | ||
| - [x] Update `unpkg` field to serve minified version by default | ||
| - [x] Update README.md with usage examples for both minified and unminified versions | ||
| - [x] Document clear import patterns for users | ||
| ### Implementation Steps | ||
| - [x] 1. Research existing toolbox items and understand the toolbox structure | ||
| - [x] Read `src/toolbox.ts` to understand how toolbox items work | ||
| - [x] Review existing toolbox items in `src/toolbox_items/` | ||
| - [x] Understand how annotation data is accessed and structured | ||
| - [x] 2. Create the basic annotation list toolbox item | ||
| - [x] Create new file `src/toolbox_items/annotation_list.ts` | ||
| - [x] Implement basic UI structure (container, list elements) | ||
| - [x] Register the toolbox item in the main toolbox | ||
| - [x] 3. Implement core list functionality | ||
| - [x] Display all annotations with their ID/index | ||
| - [x] Add show/hide toggle for deprecated annotations (default: hide) | ||
| - [x] Add option to group by class | ||
| - [x] 4. Implement click-to-fly functionality | ||
| - [x] Integrate with existing "fly to" functionality from PR #230 | ||
| - [x] Add click handlers to list items | ||
| - [x] Display "current idx / total" indicator | ||
| - [x] 5. Implement hover highlighting | ||
| - [x] Add hover handlers to list items | ||
| - [x] Integrate with existing annotation highlighting system | ||
| - [x] Ensure bidirectional highlighting (list hover → canvas, canvas hover → list) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Publish to npm | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - closed | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| # Only run if PR was merged (or manual dispatch) | ||
| if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,5 @@ build | |
| build/* | ||
| output.txt | ||
| test-results/ | ||
| playwright-report/ | ||
| playwright-report/ | ||
| dist | ||
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.