Fix App Console history shortcuts#205
Conversation
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de51ff5212
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const historyIndex = historyBrowseRef.current.index; | ||
| const canBrowsePrevious = |
There was a problem hiding this comment.
Track history index in state for button enablement
canBrowsePrevious/canBrowseNext are derived from historyBrowseRef.current.index, but browseHistory() mutates that ref without always triggering a re-render (it returns early when nextSource === draft.source). In that case, the Prev/Next buttons keep stale disabled states, so users can get controls that do not reflect actual navigation state (for example when the draft text already equals the most recent history entry). Store the browse index in React state (or force a render on ref changes) so button enablement stays in sync.
Useful? React with 👍 / 👎.
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Fix #200