Skip to content

Fix sort oscillation, skip redundant tree rebuilds, PEP 8 renames#411

Merged
realcarbonneau merged 1 commit intomasterfrom
fix-sort-idempotent-skip-rebuild
Mar 14, 2026
Merged

Fix sort oscillation, skip redundant tree rebuilds, PEP 8 renames#411
realcarbonneau merged 1 commit intomasterfrom
fix-sort-idempotent-skip-rebuild

Conversation

@realcarbonneau
Copy link
Copy Markdown
Contributor

Sort idempotency: add UUID as first (least significant) sort pass to guarantee deterministic ordering for items with equal sort keys. Without this, pairs with identical subjects flip-flop on every re-sort due to the missing statusSortFunction silently falling back to subject (creating conflicting forward/reversed subject passes). Log the silent fallback so missing sort functions are visible.

Skip redundant rebuilds: before deleting and recreating all tree nodes, snapshot the current tree structure (object IDs in depth-first order) and compare against what the presentation would produce. If identical, refresh items in place (text, colors, font) without rebuilding.

Remove save freeze/rebuild: viewers no longer subscribe to aboutToSave/justSaved - saving to disk does not change the presentation.

Narrow EventFilter to motion events only: clicks, keyboard, and scroll pass through so the app stays responsive during rebuilds.

PEP 8 renames across sorter, viewer, container, frame, itemctrl, and all callers: snake_case for methods, locals, and parameters. Renamed ~80 identifiers across 22 files including sort_by, sort_keys, sort_ascending, sort_case_sensitive, sort_event_type, is_ascending, create_sort_key_function, add_pane, set_pane_title, docked_panes, is_center_pane, bind_events, active_viewer, activate_viewer, add_viewer, close_viewer, advance_selection, components_created, is_showing_tasks/effort/notes/attachments/categories, on_begin_io, on_end_io, register_presentation_observers, send_viewer_status_event, on_presentation_changed, init_layout, set_title, show_sort_column, show_sort_order, expand_all, collapse_all, hide_column, check_all_categories, get_is_item_checked, on_item_popup_menu, on_drop_url/files/mail, on_column_click, on_end_column_resize.

Sort idempotency: add UUID as first (least significant) sort pass to
guarantee deterministic ordering for items with equal sort keys.
Without this, pairs with identical subjects flip-flop on every re-sort
due to the missing statusSortFunction silently falling back to subject
(creating conflicting forward/reversed subject passes).  Log the
silent fallback so missing sort functions are visible.

Skip redundant rebuilds: before deleting and recreating all tree nodes,
snapshot the current tree structure (object IDs in depth-first order)
and compare against what the presentation would produce.  If identical,
refresh items in place (text, colors, font) without rebuilding.

Remove save freeze/rebuild: viewers no longer subscribe to
aboutToSave/justSaved - saving to disk does not change the
presentation.

Narrow EventFilter to motion events only: clicks, keyboard, and scroll
pass through so the app stays responsive during rebuilds.

PEP 8 renames across sorter, viewer, container, frame, itemctrl, and
all callers: snake_case for methods, locals, and parameters.  Renamed
~80 identifiers across 22 files including sort_by, sort_keys,
sort_ascending, sort_case_sensitive, sort_event_type, is_ascending,
create_sort_key_function, add_pane, set_pane_title, docked_panes,
is_center_pane, bind_events, active_viewer, activate_viewer,
add_viewer, close_viewer, advance_selection, components_created,
is_showing_tasks/effort/notes/attachments/categories, on_begin_io,
on_end_io, register_presentation_observers, send_viewer_status_event,
on_presentation_changed, init_layout, set_title, show_sort_column,
show_sort_order, expand_all, collapse_all, hide_column,
check_all_categories, get_is_item_checked, on_item_popup_menu,
on_drop_url/files/mail, on_column_click, on_end_column_resize.
@realcarbonneau realcarbonneau merged commit 6f5fae7 into master Mar 14, 2026
25 checks passed
@realcarbonneau realcarbonneau deleted the fix-sort-idempotent-skip-rebuild branch March 14, 2026 04:54
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