Skip to content

Fix change signaling when tool session path changes - #21

Open
BrennanTM wants to merge 1 commit into
PrecisionNeuroLab:mainfrom
BrennanTM:fix/tool-sessionpath-signaling
Open

Fix change signaling when tool session path changes#21
BrennanTM wants to merge 1 commit into
PrecisionNeuroLab:mainfrom
BrennanTM:fix/tool-sessionpath-signaling

Conversation

@BrennanTM

Copy link
Copy Markdown

What broke — two defects in the sessionPath setters (Navigator/Model/Tools.py):

  • Tool.sessionPath: a missing comma merged 'trackerStlFilepath' and 'sessionPath' into one bogus attrib name (implicit string concatenation), so those attribs were never signaled as changed.
  • Tools.sessionPath: compared the resolved filepathsRelTo path against the token '<session>' (never true), so session-relative tools were always left out of changingKeys.

Fix — compare filepathsRelToKey; pass the changed attrib names as the second emit arg (as everywhere else in GenericCollection); hoist the attrib list to one module constant so the two setters can't drift again.

Side effect (improvement) — the old empty-keys emit made CollectionTableModel treat every session move as a full layout reset and made ToolsPanel spawn a throwaway ToolPositionsClient; both stop happening. All existing subscribers already accept the two-arg form.

Teststests/test_Model/test_toolsSessionPath.py (2).

Two defects in the sessionPath setters:
- Tool.sessionPath: a missing comma merged 'trackerStlFilepath' and
  'sessionPath' into one bogus attrib name via implicit string
  concatenation, so those attribs were never announced as changed.
- Tools.sessionPath: compared the resolved filepathsRelTo path against
  the literal token '<session>' (never true), so session-relative tools
  were always excluded from the emitted changingKeys. Use
  filepathsRelToKey instead, and pass the changed attrib names in the
  emit as done everywhere else in GenericCollection.

The attrib list is hoisted to a single module-level constant so the two
setters can't drift apart again.

Side effects of the collection-level change worth noting: the old emit
(empty keys, implicit attribs=None) made CollectionTableModel classify
every session move as a 'full' layout change with a spurious
selection-cleared signal, and made ToolsPanel spawn a throwaway
ToolPositionsClient; the new emit is classified as 'modifyExisting'
and neither side effect occurs.
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.

1 participant