Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f4cfc01
wip: hydrate sidebar previews on catalog accept with bounded network …
cassi-volkova Nov 25, 2026
7f7cb19
fix: late disk writes outrank network negative memos; scope traffic pins
cassi-volkova Nov 25, 2026
70e5f4c
test: run the window harness in the disk-only preview shape
cassi-volkova Nov 25, 2026
ab4e730
fix: bound total in-flight preview lookups; keep exhausted transients…
cassi-volkova Nov 25, 2026
fdf8ad5
fix: preview lookups retire only their own in-flight slot; foreground…
cassi-volkova Nov 26, 2026
e47aac7
test: witness the foreground preview priority at the pump state seam …
cassi-volkova Nov 26, 2026
89d3a67
fix: announce sidebar preview content on a narrow previewRevision pro…
cassi-volkova Nov 26, 2026
eb6c78d
test: window acceptance for network preview hydration under an active…
cassi-volkova Nov 26, 2026
9711dcb
fix: let hydrated preview stamps re-sort the sidebar activity order
cassi-volkova Nov 26, 2026
824249f
fix: record hydrated activity stamps that equal the current fallback key
cassi-volkova Nov 26, 2026
b095150
fix: announce preview revisions for inbox-slot topics hydrated by the…
cassi-volkova Nov 26, 2026
781992d
fix: move sidebar rows in place on hydration re-rank instead of reset…
cassi-volkova Nov 26, 2026
3691943
fix: order sidebar survivors before inserting new rows
cassi-volkova Nov 26, 2026
1fdbce2
test: register new window case in bucket timings
cassi-volkova Nov 26, 2026
86fd97a
test: churn-settle sidebar pins after move-aware re-rank (#860 fix ro…
cassi-volkova Nov 26, 2026
3096971
test: harden mediaViewer entry clicks and search negative pins for gr…
cassi-volkova Nov 26, 2026
8fa7afd
fix: fence the delayed row-preview retries to their originating session
cassi-volkova Nov 26, 2026
1094d53
fix: expire the sidebar move focus carry after the relayout settles
cassi-volkova Nov 26, 2026
b0bf7a4
fix: cancel the sidebar move focus carry on user input in the settle …
cassi-volkova Nov 26, 2026
6e26adc
test: register the settle-window carry case in the window buckets
cassi-volkova Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 104 additions & 10 deletions packages/native/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5068,7 +5068,7 @@ component NativeMentionChip: Item {
for (let row = 0; row < streamList.count; ++row) {
const item = streamList.itemAtIndex(row)
if (item && item.y + item.height > cy + 1.0) {
const id = String(streamList.model[row] && streamList.model[row].id || "")
const id = String(streamList.model.streamIdAt(row) || "")
if (!id.length)
return
root.sidebarScrollAnchor = {id: id, offset: item.y - cy, contentHeight: streamList.contentHeight}
Expand All @@ -5092,7 +5092,7 @@ component NativeMentionChip: Item {
return
let row = -1
for (let i = 0; i < streamList.count; ++i) {
if (String(streamList.model[i] && streamList.model[i].id || "") === anchor.id) {
if (String(streamList.model.streamIdAt(i) || "") === anchor.id) {
row = i
break
}
Expand Down Expand Up @@ -5310,6 +5310,8 @@ component NativeMentionChip: Item {
const delegate = streamList.itemAtIndex(target.row)
const item = delegate ? root.findSidebarSearchRow(delegate, target.objectName) : null
if (item) {
// The ring moving is navigation intent (see the sidebar focus carry).
streamList.disarmFocusCarry()
root.scrollSidebarSearchRowIntoView(item, step)
item.forceActiveFocus(Qt.TabFocusReason)
return true
Expand Down Expand Up @@ -6304,7 +6306,10 @@ component NativeMentionChip: Item {
anchors.rightMargin: 8
spacing: 2
clip: true
model: root.controller.sidebarStreams
// Issue #866 (finding 2): stable move-aware model (see
// NativeSidebarStreamListModel) - a hydration re-rank moves the
// row instead of resetting the list and re-creating delegates.
model: root.controller.sidebarStreamListModel
MouseArea {
// Issue #142: sidebar wheel scroller (expanded topic rows
// included - they are delegate children) using the same
Expand All @@ -6325,11 +6330,62 @@ component NativeMentionChip: Item {
sidebarAnchorSettle.stop()
root.sidebarScrollAnchor = null
}
// Wheel is deliberate input too: a scroll during the settle
// window means the user navigated, not the move churn.
if (moved)
streamList.disarmFocusCarry()
}
}
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
property var sidebarFocusCarry: null
// Real user input inside the settle window is navigation intent: the
// next focus move belongs to the user, so the carry is cancelled
// outright (#866 round 2: focus must not be re-aimed after the user
// navigated). Row clicks, the search keyboard ring and wheel input
// call this before they move focus or selection.
function disarmFocusCarry() {
sidebarFocusCarryExpiry.stop()
streamList.sidebarFocusCarry = null
}
// exordy finding (#866): a completed move must not leave a live carry.
// The carry re-aims bubbled focus onto the pre-move item; left armed
// forever, the next focus navigation anywhere in the sidebar would be
// forced back to the old row. It expires after the move's relayout
// goes quiet: every bubbled restore re-arms it, so multi-pass churn
// keeps the item, and once the move has truly settled the carry dies.
Timer {
id: sidebarFocusCarryExpiry
interval: 500
onTriggered: streamList.sidebarFocusCarry = null
}
// Issue #866 (finding 2) companion: a model row move re-parents the
// delegate subtree; Qt's focus bubbling drops the moved row's active
// focus and lands it on the delegate root after the view relayout.
// The browser keeps focus on the moved DOM node, so carry it across:
// remember the focused item inside a stream row before the move, and
// hand focus back to it the moment the delegate root re-receives the
// bubbled focus (synchronous - no deferred closure races the relayout).
// streamLive flips false on delegate destruction (the #708 rule), so a
// carry can never reach a dead subtree.
Connections {
target: streamList.model
function onRowsAboutToBeMoved() {
const win = streamList.Window.window
const focused = win ? win.activeFocusItem : null
streamList.sidebarFocusCarry = null
if (!focused)
return
for (let node = focused; node && node !== streamList; node = node.parent) {
if (node.liveGuard !== undefined) {
streamList.sidebarFocusCarry = { item: focused, guard: node.liveGuard }
sidebarFocusCarryExpiry.restart()
return
}
}
}
}
delegate: Column {
id: streamDelegate
required property var modelData
Expand All @@ -6349,7 +6405,14 @@ component NativeMentionChip: Item {
// target; section 1.1/1.2 of the design doc holds the measurements.
readonly property bool compactDensity: root.preferences.chatListDensity === "compact"
readonly property bool opensLatestTopic: root.preferences.chatClickAction === "latestTopic"
readonly property string previewTopic: String(streamDelegate.modelData.previewTopic || "")
// #866 review (finding 3): preview fields derive from the uuid-keyed
// store; controller.previewRevision is the explicit binding dependency
// that re-evaluates them when a preview batch lands, WITHOUT the
// projection (and delegate) rebuild the old streamsChanged path forced.
readonly property var previewData:
root.controller.previewFields(String(streamDelegate.modelData.lastMessage || ""),
root.controller.previewRevision)
readonly property string previewTopic: String(streamDelegate.previewData.previewTopic || "")
// workspace_ui 61dacef sidebar-message-preview.ui.tsx: sender in the
// sidebar-sender token + ": " + body in text-secondary, one 20 px line.
property var sidebarTopicState: ({ known: false, count: 0, rows: [] })
Expand All @@ -6365,6 +6428,29 @@ component NativeMentionChip: Item {
}
onModelDataChanged: refreshTopics()
Component.onCompleted: refreshTopics()
// #866 companion: plain-JS liveGuard (the #708 rule) - the focus
// carry holds this object, never a QML wrapper, so a destroyed
// delegate is detectable without touching dead properties.
property var liveGuard: ({ live: true })
Component.onDestruction: liveGuard.live = false
onFocusChanged: {
if (!focus)
return
// #866 companion: a model row move re-parents the moved row's
// subtree and Qt's focus fallback lands active focus on some
// delegate root of the list - possibly across several relayout
// passes and not necessarily the moved row's own root. For as
// long as a move carry stands (re-armed and reset at every
// move), hand the bubbled focus to the item that held it
// before the move, so focus provably never left the moved row.
const carry = streamList.sidebarFocusCarry
if (carry && carry.guard.live) {
carry.item.forceActiveFocus()
// Each restore re-arms the settle window: churn keeps the
// carry alive, a settled move lets it expire.
sidebarFocusCarryExpiry.restart()
}
}
Connections {
target: root.controller
function onSidebarTopicsChanged(stream) {
Expand Down Expand Up @@ -6401,9 +6487,9 @@ component NativeMentionChip: Item {
}
return rows
}
readonly property string previewBody: root.sidebarPreviewBody(modelData)
readonly property string previewBody: root.sidebarPreviewBody(streamDelegate.previewData)
readonly property string previewSenderLabel: {
const sender = String(modelData.previewSender || "")
const sender = String(streamDelegate.previewData.previewSender || "")
return sender.length && previewBody.length ? sender + ": " : ""
}
width: streamList.width
Expand Down Expand Up @@ -6480,6 +6566,9 @@ component NativeMentionChip: Item {
horizontalPadding: streamDelegate.compactDensity ? 8 : 10
verticalPadding: streamDelegate.compactDensity ? 6 : 10
onClicked: {
// A row click is user navigation intent: cancel any move
// focus carry before the selection may move focus.
streamList.disarmFocusCarry();
root.controller.closeDrafts();
// Reference sidebar-workspace.ui.tsx:455: the latestTopic body
// link is `stream.preview?.route ?? stream.route`; the native
Expand Down Expand Up @@ -6862,7 +6951,7 @@ component NativeMentionChip: Item {
objectName: "streamTime-" + streamDelegate.modelData.id
Layout.alignment: Qt.AlignBottom | Qt.AlignRight
visible: text.length > 0 && !streamDelegate.compactDensity
text: String(streamDelegate.modelData.rowTime || "")
text: String(streamDelegate.previewData.rowTime || "")
textFormat: Text.PlainText
color: root.colors["text-muted"]
font.pixelSize: 12
Expand Down Expand Up @@ -6926,9 +7015,14 @@ component NativeMentionChip: Item {
readonly property var modelData: topicDelegate.modelData
visible: !topicDelegate.searchOtherTopicsSeparator
objectName: topicDelegate.searchOtherTopicsSeparator ? "" : "topic-" + modelData.id
readonly property string previewBody: root.sidebarPreviewBody(modelData)
// #866 review (finding 3): same preview-revision derivation as
// the stream row - text bindings re-evaluate, delegates survive.
readonly property var previewData:
root.controller.previewFields(String(modelData.lastMessage || ""),
root.controller.previewRevision)
readonly property string previewBody: root.sidebarPreviewBody(topicButton.previewData)
readonly property string previewSenderLabel: {
const sender = String(modelData.previewSender || "")
const sender = String(topicButton.previewData.previewSender || "")
return sender.length && previewBody.length ? sender + ": " : ""
}
colors: root.colors
Expand Down Expand Up @@ -7130,7 +7224,7 @@ component NativeMentionChip: Item {
y: 28
// showTime = !compact (sidebar-chat-row-meta.ui.tsx).
visible: text.length > 0 && !streamDelegate.compactDensity
text: String(topicButton.modelData.rowTime || "")
text: String(topicButton.previewData.rowTime || "")
textFormat: Text.PlainText
color: root.colors["text-muted"]
font.pixelSize: 12
Expand Down
Loading
Loading