feat(ui): expose desktop session actions in header
Add a dedicated desktop header menu for the active session while keeping recent-session switching available when the sidebar is closed. Match inline rename behavior with the sidebar and expose rename, copy ID, share, export, archive, and delete actions with localized feedback. Automatically copy newly created share links, keep share/unshare state synchronized across live and global stores, and normalize stale upstream unshare responses so the UI immediately reflects successful unsharing. Require Markdown exports to load every available message page before formatting the conversation. Abort incomplete root exports, retain explicit child-session skip warnings, and guard complete-history pagination against failures and cursor cycles.
This commit is contained in:
@@ -242,6 +242,27 @@ export class SessionMessageLoader {
|
||||
})
|
||||
}
|
||||
|
||||
async loadComplete(target: SessionMessageTarget): Promise<void> {
|
||||
const normalized = this.normalizeTarget(target)
|
||||
if (!normalized || this.disposed) throw new Error("Session message loader is unavailable")
|
||||
const initial = this.getSnapshot(normalized)
|
||||
await this.ensure(normalized, { force: !initial.resolved })
|
||||
|
||||
const visitedCursors = new Set<string>()
|
||||
while (true) {
|
||||
const snapshot = this.getSnapshot(normalized)
|
||||
if (snapshot.status === "error") throw snapshot.error ?? new Error("Session history could not be loaded")
|
||||
if (snapshot.complete) return
|
||||
if (!snapshot.cursor) throw new Error("Session history coverage is unresolved")
|
||||
if (visitedCursors.has(snapshot.cursor)) {
|
||||
throw new Error("Session history pagination made no progress")
|
||||
}
|
||||
visitedCursors.add(snapshot.cursor)
|
||||
|
||||
await this.loadOlder(normalized)
|
||||
}
|
||||
}
|
||||
|
||||
refreshTail(target: SessionMessageTarget, limit: number): Promise<void> {
|
||||
const normalized = this.normalizeTarget(target)
|
||||
if (!normalized || this.disposed) return Promise.resolve()
|
||||
|
||||
Reference in New Issue
Block a user