Skip to content

Comments

Fix undo to skip ignored messages#330

Open
gergesh wants to merge 1 commit intoLatitudes-Dev:integrationfrom
gergesh:undo-to-nonignored
Open

Fix undo to skip ignored messages#330
gergesh wants to merge 1 commit intoLatitudes-Dev:integrationfrom
gergesh:undo-to-nonignored

Conversation

@gergesh
Copy link

@gergesh gergesh commented Feb 22, 2026

Summary

Greptile Summary

Enhanced the undo functionality to skip over messages where all text parts are marked as ignored by DCP, ensuring users revert to the last meaningful message.

Minor issues:

  • Missing safety check when accessing sync.data.part[message.id] on line 543 (should use ?? [] fallback)
  • Redo functionality may need similar ignored-message filtering for consistency

Confidence Score: 4/5

  • This PR is safe to merge with minor refinements needed
  • The core logic correctly implements the feature to skip ignored messages during undo. Two minor issues identified: (1) missing null safety check on line 543 that could cause runtime error, and (2) redo functionality lacks similar ignored-message filtering for consistency. The implementation is targeted and focused on the stated issue.
  • Line 543 needs a safety check (?? []), and consider updating redo at line 572 for consistency

Important Files Changed

Filename Overview
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx Added logic to skip messages with all ignored text parts during undo; minor safety concern with parts access

Last reviewed commit: dc7314f

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 22, 2026

Additional Comments (2)

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
add fallback to match pattern used elsewhere in this file

        const parts = sync.data.part[message.id] ?? []

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Line: 543

Comment:
add fallback to match pattern used elsewhere in this file

```suggestion
        const parts = sync.data.part[message.id] ?? []
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
redo should likely also skip ignored messages for consistency with undo behavior

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Line: 572

Comment:
redo should likely also skip ignored messages for consistency with undo behavior

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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.

/undo broken with plugin

1 participant