Skip to content

web: add multi-selection and inspector cycling with pulse animation#10601

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-multi-select
Jun 8, 2026
Merged

web: add multi-selection and inspector cycling with pulse animation#10601
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-multi-select

Conversation

@maliberty

Copy link
Copy Markdown
Member

Summary

  • Shift+click adds objects to a SelectionSet (mirroring the Qt GUI), with all selected objects highlighted simultaneously on the layout tiles
  • Inspector shows Previous/Next buttons and a "2 / 5" position label when multiple objects are selected, cycling through the set
  • Each selection change triggers a brief pulse animation on the object's bounding box so the user can see which object the inspector is now showing

Details

Backend: SessionState gains a gui::SelectionSet and iterator. handleSelect reads an optional add_to_selection flag. New select_next/select_prev request types advance the iterator with wrap-around. All inspect responses include selection_count and selection_index metadata.

Frontend: main.js detects shiftKey and sets add_to_selection. inspector.js adds cycleSelection(), the nav bar UI, and pulseHighlight(). style.css adds the selection-pulse keyframe animation.

Test plan

  • C++ tests: 14 new tests in TestRequestHandler.cpp covering selection set population, next/prev cycling, wrap-around, empty set, navigation history clearing, and metadata in inspect/inspect_back responses
  • JS tests: 6 new tests in test-inspector.js covering nav bar visibility, label formatting, and button request wiring
  • All existing web tests pass (ctest -R web, bun test)
  • Manual: load a design, click an object, Shift+click another, verify both highlighted and Next/Prev cycle works

@maliberty maliberty self-assigned this Jun 7, 2026
@github-actions github-actions Bot added the size/L label Jun 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces multi-selection capabilities to the web inspector, allowing users to Shift+click to add items to a selection set and cycle through them using a new navigation bar. It also adds a visual pulsing animation to highlight the selected object's bounding box. The backend changes support tracking the selection set and handling next/prev requests, accompanied by comprehensive unit tests. Feedback on the pull request highlights a logical bug where Shift+clicking on an empty area clears the selection instead of preserving it, along with a corresponding test update. Additionally, several defensive programming improvements are suggested in the JavaScript code, such as validating the selection index type, checking if app.map is still valid before removing layers or closing popups, and restoring the inspector's state if a selection cycle request fails.

Comment thread src/web/src/request_handler.cpp Outdated
Comment thread src/web/test/cpp/TestRequestHandler.cpp Outdated
Comment thread src/web/src/inspector.js
Comment thread src/web/src/inspector.js
Comment thread src/web/src/inspector.js
Shift+click adds objects to a SelectionSet (mirroring the Qt GUI),
with all selected objects highlighted simultaneously on the layout
tiles.  The inspector shows Previous/Next buttons and a position
label ("2 / 5") when multiple objects are selected, cycling through
the set.  Each selection change triggers a brief pulse animation on
the object's bounding box so the user can see which object the
inspector is now showing.

Backend: SessionState gains a gui::SelectionSet and iterator.
handleSelect reads an optional add_to_selection flag from the
request JSON.  New select_next / select_prev request types advance
the iterator with wrap-around.  All inspect/inspect_back responses
now include selection_count and selection_index metadata.

Frontend: main.js detects shiftKey and sets add_to_selection.
inspector.js adds cycleSelection(), the nav bar UI, and
pulseHighlight().  style.css adds the selection-pulse keyframe
animation and nav bar layout.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty marked this pull request as ready for review June 7, 2026 03:08
@maliberty maliberty requested a review from a team as a code owner June 7, 2026 03:08
@maliberty maliberty requested a review from gadfort June 7, 2026 03:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4de04f43fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/web/src/request_handler.cpp
Comment thread src/web/src/request_handler.cpp
Comment thread src/web/src/main.js

@gadfort gadfort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, but certainly exposes the latency in drawing, switching selections seems to retrigger a whole host of drawing.

@maliberty

Copy link
Copy Markdown
Member Author

Ok but that is separate issue.

@maliberty maliberty enabled auto-merge June 8, 2026 02:20
Address codex feedback on the multi-selection feature:
- handleSelectionCycle: clear hover_rects/timing_rects/timing_lines so
  stale hover/timing overlays don't bleed through after Next/Previous.
- handleInspect: realign selection_itr with the linked target so
  selection_index matches the rendered payload and the next cycle
  starts from the correct object (or end() to suppress nav when the
  link leaves the selection set).
- main.js: skip the empty-hit inspector/highlight clear when
  add_to_selection is set, since the server preserves the
  multi-selection on shift-click misses.

Also add <iterator> include for std::distance (clang-tidy
misc-include-cleaner).

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty merged commit e281635 into The-OpenROAD-Project:master Jun 8, 2026
15 of 16 checks passed
@maliberty maliberty deleted the web-multi-select branch June 8, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants