Skip to content

refactor(opencode): restructure tui args and navigation data handling#15579

Open
OpeOginni wants to merge 1 commit intoanomalyco:devfrom
OpeOginni:fix/better-single-prompt-use
Open

refactor(opencode): restructure tui args and navigation data handling#15579
OpeOginni wants to merge 1 commit intoanomalyco:devfrom
OpeOginni:fix/better-single-prompt-use

Conversation

@OpeOginni
Copy link
Contributor

Issue for this PR

Closes #15575

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes the TODO around the module-scoped once variable by making CLI and route-provided prompts one-time consumable.

  • useArgs now stores CLI args in local state and adds consumePrompt(), which returns the CLI prompt once and clears it so it cannot be reused on later Home mounts.
  • useRoute now stores navigation state in a signal instead of a store, so navigation payloads are replaced rather than merged; this prevents stale fields like initialPrompt from carrying into the next route.

How did you verify your code works?

Tested different flows making use of these constraints, such as passing args into cli, having a draft PR in the prompt box then moving to a new session. These prompts are only used once and not moved to other pages or sections.

Screenshots / recordings

Screen.Recording.2026-03-01.at.14.55.06.mov

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

… for improved state management and using signals for nav data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Todo in Codebase on better wa to handle one time prompts from CLI

1 participant