Skip to content

fix(ros2,webrtc): restore picker-table selection by text, not row index#197

Merged
pabloinigoblasco merged 2 commits into
mainfrom
fix/picker-selection-by-text
Jul 13, 2026
Merged

fix(ros2,webrtc): restore picker-table selection by text, not row index#197
pabloinigoblasco merged 2 commits into
mainfrom
fix/picker-selection-by-text

Conversation

@Alvvalencia

Copy link
Copy Markdown
Contributor

Problem

ros2_dialog.hpp and webrtc_dialog.cpp restore their picker-table selection with setSelectedRows, computing indices against their own delivery order. listRosTopics is sortingEnabled=true on main, so after the user sorts the topic column the next discovery re-delivery highlights the wrong topics (reproduced live; the emit round-trip then corrupts the plugin's selected set). camerasList has the same shape and goes live the moment #188 enables sorting on it.

Both sites also carry a comment claiming the host only honors selected_rows for tables — stale since PJ4#349 added text-keyed selected_items restore for QTableWidget.

Fix

Send setSelectedItems keyed by the first-column text (topic name / unique camera label), exactly like data_load_mcap already does. Text matching is sort-agnostic, and it deletes the index-computation loops. Defense-in-depth with PJ4#370 (host-side index translation): with both in place neither side depends on view order.

Verification

  • webrtc: webrtc_source_plugin builds clean.
  • ros2: ros2_dialog.hpp verified with a full-TU compile check against the pinned SDK 0.15.0 + rclcpp jazzy. Note the ros2_stream_plugin_distro inner target does not build on main today for unrelated pre-existing reasons: feat(foxglove,ros2): demand-driven per-topic subscriptions (pj.topic_subscription.v1) #190 uses PJ::AvailableTopic / kCapabilityPerTopicPause / PJ_TOPIC_SUBSCRIPTION_EXTENSION_V1, which don't exist in the pinned plotjuggler_sdk/0.15.0 (they're in the unreleased 0.16.0).
  • Selection-restore behavior itself verified end-to-end in PJ4 (sorted topic table + topic churn → selection sticks), as part of the PJ4#370 work.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RP8RosW9FCsePNUttEYAXk

Both dialogs sent setSelectedRows computed against their own row order.
With sortingEnabled (ros2 today; webrtc once #188 lands) index-keyed
restore lands on the wrong rows after a user sort. setSelectedItems is
honored for QTableWidget since PJ4#349 and matches rows by text, which is
sort-agnostic — same pattern mcap already uses. Both code comments also
claimed the host ignores selected_items, which is stale since PJ4#349.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RP8RosW9FCsePNUttEYAXk
@pabloinigoblasco pabloinigoblasco merged commit f303c14 into main Jul 13, 2026
11 checks passed
@pabloinigoblasco pabloinigoblasco deleted the fix/picker-selection-by-text branch July 13, 2026 11:08
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.

2 participants