Skip to content

Add a prototype implementation of the History panel - #4894

Merged
TrueDoctor merged 5 commits into
masterfrom
graph-storage-24-history-panel
Nov 6, 2026
Merged

TrueDoctor merged 5 commits into
masterfrom
graph-storage-24-history-panel

Conversation

@TrueDoctor

Copy link
Copy Markdown
Member

No description provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 25 files

Confidence score: 3/5

  • In document/format/src/persist.rs, head movement can change registry fields that Touched does not track, leaving the History panel’s storage cursor inconsistent. Mark this change as requiring a full rebuild.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="document/format/src/persist.rs">

<violation number="1" location="document/format/src/persist.rs:461">
P2: This records only the touched entities, but head movement can change registry fields that `Touched` does not track. Mark the change as requiring a full rebuild, otherwise the History panel can move the storage cursor while the editor still displays the old state.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

pub fn move_head(&mut self, rev: Rev) -> Result<(), Error> {
if self.retires_locally() {
let (moved, touched) = self.session.move_head_to(rev)?;
self.remote_changes.touched.extend(touched);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: This records only the touched entities, but head movement can change registry fields that Touched does not track. Mark the change as requiring a full rebuild, otherwise the History panel can move the storage cursor while the editor still displays the old state.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At document/format/src/persist.rs, line 461:

<comment>This records only the touched entities, but head movement can change registry fields that `Touched` does not track. Mark the change as requiring a full rebuild, otherwise the History panel can move the storage cursor while the editor still displays the old state.</comment>

<file context>
@@ -452,6 +452,24 @@ impl<L: Layout> Gdd<L> {
+	pub fn move_head(&mut self, rev: Rev) -> Result<(), Error> {
+		if self.retires_locally() {
+			let (moved, touched) = self.session.move_head_to(rev)?;
+			self.remote_changes.touched.extend(touched);
+			self.persist_registry_snapshot()?;
+			self.persist_session_state()?;
</file context>
Suggested change
self.remote_changes.touched.extend(touched);
self.remote_changes.touched.extend(touched);
self.remote_changes.rebuilt = true;

Comment thread frontend/src/stores/history.ts Resolved
@TrueDoctor
TrueDoctor added this pull request to stack #4897 November 1, 2026 11:29
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from f80208a to 36d14f9 Compare November 1, 2026 11:36
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 36d14f9 to 4a7121b Compare November 1, 2026 14:34
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 4a7121b to f25fbba Compare November 1, 2026 16:41
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from f25fbba to 866e62c Compare November 1, 2026 20:52
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 866e62c to b64bd98 Compare November 1, 2026 21:03
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from b64bd98 to 23ec54e Compare November 1, 2026 22:08
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 23ec54e to 746caaa Compare November 2, 2026 08:11
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 746caaa to 366283d Compare November 2, 2026 19:46
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 366283d to 1d9938d Compare November 2, 2026 21:53
@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from 1d9938d to 76eef1d Compare November 3, 2026 11:35

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 25 files

Confidence score: 3/5

  • In editor/src/messages/portfolio/document/document_history.rs, clearing the legacy redo stack makes BringBack and Redo silently do nothing for an undone step after a History panel change, until the next edit. Keep the legacy redo stack available until storage redo has consumed it.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/portfolio/document/document_history.rs">

<violation number="1" location="editor/src/messages/portfolio/document/document_history.rs:253">
P2: `clear_legacy` empties the legacy redo stack, which `redo_in_storage` requires to be non-empty. After a History panel change, BringBack and Redo of an undone step silently do nothing until the next edit. Keep the legacy stacks the storage path gates on, or gate on the storage redo stack instead.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

}

/// Forgets the legacy snapshots once the head has moved off their line.
pub fn clear_legacy(&mut self) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: clear_legacy empties the legacy redo stack, which redo_in_storage requires to be non-empty. After a History panel change, BringBack and Redo of an undone step silently do nothing until the next edit. Keep the legacy stacks the storage path gates on, or gate on the storage redo stack instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At editor/src/messages/portfolio/document/document_history.rs, line 253:

<comment>`clear_legacy` empties the legacy redo stack, which `redo_in_storage` requires to be non-empty. After a History panel change, BringBack and Redo of an undone step silently do nothing until the next edit. Keep the legacy stacks the storage path gates on, or gate on the storage redo stack instead.</comment>

<file context>
@@ -235,6 +236,26 @@ impl DocumentHistory {
+	}
+
+	/// Forgets the legacy snapshots once the head has moved off their line.
+	pub fn clear_legacy(&mut self) {
+		self.legacy_undo_stack.clear();
+		self.legacy_redo_stack.clear();
</file context>

@TrueDoctor
TrueDoctor force-pushed the graph-storage-24-history-panel branch from aae83e9 to 2b93219 Compare November 6, 2026 20:48
@TrueDoctor TrueDoctor changed the title Add the History panel Add prototype for the history panel Nov 6, 2026
@Keavon Keavon changed the title Add prototype for the history panel Add a prototype implementation of the History panel Nov 6, 2026
@TrueDoctor
TrueDoctor merged commit afc60d2 into master Nov 6, 2026
13 checks passed
@TrueDoctor
TrueDoctor deleted the graph-storage-24-history-panel branch November 6, 2026 23:30

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — 5002235f Deployed Nov 6, 2026 by github-actions[bot]
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.

2 participants