Export reviewed object and flat reading to Remote

This commit is contained in:
ak47 committed 2026-11-05 16:50:52 -05:00
1 parent 49be8309fe
commit c03ffa7409
11 files changed
+425 -10

No files matched your search

+8 -1
View File
@@ -30,6 +30,9 @@ var ErrNoReviewWindow = errors.New("focused object has no review window")
type ReviewSnapshot struct {
Nodes []TreeNode
References map[ObjectID]ObjectReference
// Context includes the window root and its ancestors. Nil context keeps
// review local when any captured snapshot's privacy metadata is dirty.
Context []Snapshot
}
// ReviewWindow copies the focused menu, dialog, or window in tree order under
@@ -60,6 +63,7 @@ func (tree *AccessibleTree) ReviewWindow(ctx context.Context, focus ObjectID) (R
entry = tree.nodes[root]
}
found:
context, _ := tree.ancestryLocked(newObjectReference(root, entry))
var nodes []TreeNode
references := make(map[ObjectID]ObjectReference)
pending := []ObjectID{root}
@@ -73,6 +77,9 @@ found:
if !ok {
return ReviewSnapshot{}, ErrStaleObject
}
if entry.snapshotInvalid {
context = nil
}
if entry.childrenInvalid {
return ReviewSnapshot{}, ErrIncompleteTree
}
@@ -91,5 +98,5 @@ found:
pending = append(pending, entry.children[i])
}
}
return ReviewSnapshot{Nodes: nodes, References: references}, nil
return ReviewSnapshot{Nodes: nodes, References: references, Context: context}, nil
}