fix(xref): carry stable row identity in row messages

XrefManagerSelect/RightClick/RowOp/PathPick/FindReplace carried positional display indices that rescans could retarget. New XrefRowId{key,saved_path} (the identity refresh uses) in all 5 variants, resolved via row_index at dispatch with graceful no-op; panel selection stays index-based. display.index remains for view-time styling/lookup only. Tests: xref_rowop_unknown_id_is_noop (RED first); existing dialog/simulator/click tests migrated to ids. Full suite: 2044 passed / 0 failed / 25 ignored.
This commit is contained in:
Karim Jerbi committed 2026-10-11 02:17:18 +01:00
1 parent 7bbc5b0319
commit 6fa11887c7
4 files changed
+185 -89

No files matched your search

+13 -10
View File
@@ -2671,11 +2671,11 @@ pub enum Message {
ToggleXrefManager,
/// Rescan the active drawing's references into the palette.
XrefManagerRefresh,
/// Toggle one palette row (entry index) in the multi-selection set.
XrefManagerSelect(usize),
/// Toggle one palette row (stable row id) in the multi-selection set.
XrefManagerSelect(crate::ui::window::xref_manager::XrefRowId),
/// Right-click on a palette row: single-select it when outside the
/// selection (the context menu then acts on the selection).
XrefRowRightClick(usize),
XrefRowRightClick(crate::ui::window::xref_manager::XrefRowId),
/// Flip the palette's list/tree presentation.
XrefManagerToggleTree,
/// Start a reference-table column divider drag (column index).
@@ -2712,16 +2712,19 @@ pub enum Message {
XrefManagerToggleExpand(u64),
/// Selection-scoped palette operation (detach/unload/reload/overlay/pathtype).
XrefManagerOp(crate::ui::window::xref_manager::XrefPaletteOp),
/// Row-scoped palette operation: selects row `index`, then applies the
/// operation to it.
XrefRowOp(usize, crate::ui::window::xref_manager::XrefPaletteOp),
/// Row-scoped palette operation: selects the row by stable id, then
/// applies the operation to it.
XrefRowOp(
crate::ui::window::xref_manager::XrefRowId,
crate::ui::window::xref_manager::XrefPaletteOp,
),
/// Prefill the command line for Find & Replace across references
/// (`XREF Path Find <old> <new>`); the CLI parses and runs it.
XrefFindReplacePrompt,
/// Pick a new path for a specific row index.
XrefRowPathPick(usize),
/// Prefill the command line for Find & Replace for a specific row index.
XrefRowFindReplacePrompt(usize),
/// Pick a new path for a specific row (stable id).
XrefRowPathPick(crate::ui::window::xref_manager::XrefRowId),
/// Prefill the command line for Find & Replace for a specific row id.
XrefRowFindReplacePrompt(crate::ui::window::xref_manager::XrefRowId),
XrefRowChangePathEnter,
XrefRowChangePathLeave,
LayerToggleVisible(String),