Skip to content

fix: reorder sidebar topic rows by hydrated last-message stamps - #903

Open
cassi-volkova wants to merge 1 commit into
masterfrom
cassi/sidebar-activity-order-861
Open

cassi-volkova wants to merge 1 commit into
masterfrom
cassi/sidebar-activity-order-861

Conversation

@cassi-volkova

@cassi-volkova cassi-volkova commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Closes #861
Part of #853

What

Topic rows in the sidebar kept their fallback updated_at rank after the preview pump
resolved a newer last-message stamp for them; only stream rows were re-keyed on the
activity ledger. This lanes topic rows through the same ledger key (topicNotificationRank
hoisted to file scope, orderedTopicPointers consumes it) and announces the reorder
narrowly via streamsChanged, mirroring the stream-row contract shipped in #866.

Tests

  • New case sidebarTopicHydrationReordersActivityOrder in native-controller-sidebar:
    a deferred uuid-lookup gate makes the fallback-sort baseline deterministic, releases the
    pump reply, then asserts (a) preview ledger write, (b) the resolved topic moves to the
    top of the topic projection, (c) the reorder travels as a topicsChanged announcement.
    RED witness: pre-fix the reorder assertion failed (row kept the fallback rank).
  • native-controller-sidebar full group: 151 passed, 0 failed (offscreen, lane build).

Design oracle

docs/NATIVE_DESKTOP_SIDEBAR_PREVIEWS.md section extended with the topic-row keying rule
(reference contract cited in #853/#860: workspace_ui messenger-last-messages-loader.lib.ts).

Live verification

PASS against workspace.exordos.com through the lane binary (head df4cff2), evidence
~/dev/qa/evidence/861/:

  • live_qa.py native-login rc=0 on the lane build (sign-in session restored, sidebar renders).
  • stage4_workspace.png + order_after_hydration.png (vision-gated): sidebar rows fully
    rendered with name + preview + timestamp; active block strictly newest-first
    (22:38 -> 19:56 -> 18:19 -> 18:19 -> Nov 24); expanded stream shows per-topic rows in
    the same activity order (#General Topic 18:19 above #sborka/#debaga Nov 24); completed
    topics grouped below the divider, each block descending; the transient bootstrap banner
    is gone in the settled shot.
  • live_qa.py health --repeat 10: p50 7.25 ms, p95 8.2 ms (< 500 ms target).

UX verification

  • No QML edits in this lane (controller ordering only; delegates re-read the existing
    projection). Window-layer witnesses: native-controller-sidebar 151/151 green incl.
    search/focus/hydration pins.
  • Live matrix (order_after_hydration.png, vision-gated PASS): no clipping/overlap in
    sidebar rows, intentional ellipsis only on one-line previews, selected-row highlight
    fits the row, timestamps right-aligned; main pane untouched by this change.

Perf check

Measured on the warm lane tree; base = merge-base rebuild, lane = head df4cff2, same harness
(perf_probe.py, --idle 20, private Xvnc). Verdict: PASS.

metric base lane
startup_ms 567 442
steady_rss_mb 481.6 469.5
peak_rss_mb 481.6 469.5
avg_cpu_pct 0.1 0.7
peak_cpu_pct 2.0 12.0
threads 38 38
fds 62 62

Evidence: ~/dev/qa/evidence/861/perf-base.json, ~/dev/qa/evidence/861/perf-compare.json.

Topic rows were keyed only by the catalog updated_at, so a topic whose
last-message pointer resolves later through the preview pump kept its
fallback rank. Route topic rows through the same activity-ledger key the
stream rows use (topicNotificationRank), announce the reorder narrowly via
streamsChanged, and pin the corridor with the hydration reorder case.

@exordy exordy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

exo-review: LGTM

Intent: Reorder sidebar topic rows when preview hydration resolves their last-message timestamps.

Verify before merge

  • Inspect the sidebar model and QML bindings to verify topicsChanged refreshes rendered topic order.
  • Complete the PR's stated live sidebar verification and base/lane performance comparison.
  • Trace hydration callers, cache leases and owner-change guards to verify stale or cross-session messages cannot reach the ledger.
  • Inspect noteActivityTimestamps and rowActivityMicros to verify ledger ownership, replacement and reuse behavior.
  • Inspect create/update authorization and project-scoped lookups if this change is intended to alter those boundaries.
  • Verify interface flows, forwarding and local-daemon OUTPUT against the relevant network configuration; none was supplied.
Coverage: 6 axes clean · 0 checks run · mode pre-prod

Threat model:

  • Tenants supplying create/update fields and manifests may target other tenants' resources, traffic, secrets or quota.
  • Guest frames and L2 peers may target the host, underlay, control-plane ports or other tenants' traffic.
  • A hostile realm root or unprivileged local user may attempt to cross host or tenant boundaries.
  • Message data and cached previews cross into the native sidebar's activity ledger and projection.

Clean axes: security pass: Hydrated message UUID and timestamp affect topic ordering only when a current row owns the pointer.; The changed code adds no privileged argv, paths, network rules, routes, sysctls or daemon binds.; Ordering: the extracted comparator preserves rank, unread and tie rules.; Hydration: the ledger write precedes the topic order comparison.; Scope: the code changes support topic hydration and notification.; Compatibility: the patch changes no persisted or serialized format.; Tests: the new case covers a deferred lookup and an activity reorder.

0 tool calls · 20s

This branch has not been deployed

No deployments
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.

Order sidebar streams and topics by actual last-message activity

2 participants