TUI: messagesBeforeRevert/messagesFromRevert duplicate revert boundary logic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend
Research direction
Read routes/session/index.tsx around lines 134–174 and trace how messagesBeforeRevert and messagesFromRevert use the revert boundary. Extract their shared boundary lookup into a helper, then check the session view behavior for cases with and without a matching revert message; done when both functions use the shared lookup and preserve their current results.
Written by the indexing model from the issue text.
Description
Summary
routes/session/index.tsx:134-174 — messagesBeforeRevert and messagesFromRevert both search for the revert boundary — duplicate logic.
Root cause
const messagesBeforeRevert = () => {
const messageID = session()?.revert?.messageID
const index = messages().findIndex((message) => message.id === messageID)
return index === -1 ? messages() : messages().slice(0, index)
}
const messagesFromRevert = () => {
const messageID = session()?.revert?.messageID
const index = messages().findIndex((message) => message.id === messageID)
return index === -1 ? [] : messages().slice(index)
}
Both functions find the revert boundary index independently.
Suggested fix
Extract the revert boundary index lookup into a shared helper.
- Dominant language
- TypeScript
- Stars
- 215k
- Forks
- 28.9k
- Avg merge
- 8h 27m
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
pending close triaging
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#57028 · 3 comments ·
Maintainers usually reply within 1 day
-
Plan mode leave reminder becomes the final user turn after a tool-driven agent switch, models refusePossibly taken A pull request linked to this issue is open or already merged. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#57013 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
anomalyco/opencode#56891 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#56843 · 1 comment ·
Maintainers usually reply within 1 day
-
triaging
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#56765 · 3 comments ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jessepollak/home#2223 ·
Maintainers usually reply within 1 day
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
code-yeongyu/senpi#3756 ·
Maintainers usually reply within 1 day
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
langchain-ai/deepagents#7059 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
osmlab/name-suggestion-index#12992 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
hemilabs/ui-monorepo#2506 ·
Maintainers usually reply within 1 day