Skip to content

fix(tui): restore activity picker/edit behavior after runtime refactor#94

Merged
ponbac merged 1 commit intomasterfrom
tui-fix-stale-activity-selection
Mar 2, 2026
Merged

fix(tui): restore activity picker/edit behavior after runtime refactor#94
ponbac merged 1 commit intomasterfrom
tui-fix-stale-activity-selection

Conversation

@ponbac
Copy link
Owner

@ponbac ponbac commented Feb 28, 2026

Greptile Summary

This PR fixes a critical bug where the activity picker wouldn't properly load activities when editing historical entries after the runtime refactor. The fix ensures activities are loaded asynchronously via the action queue before opening the picker.

  • Fixed duplicate key event processing by filtering to KeyEventKind::Press events only
  • Refactored activity loading logic into reusable ensure_activities_for_project helper function
  • Added OpenEditActivityPicker action to handle async activity loading in edit mode
  • Improved UX by resetting activity picker search state on exit
  • Added backspace shortcut to clear project/activity or note fields when timer is stopped
  • Updated handle_entry_edit_enter signature to accept action queue for proper async handling

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it fixes real bugs and improves code quality
  • The changes are well-structured, fix legitimate bugs (activity loading in edit mode, duplicate key events), and follow established patterns in the codebase. The refactoring improves code reusability without introducing breaking changes. All modifications are localized to the TUI runtime and properly handle async operations through the action queue.
  • No files require special attention

Important Files Changed

Filename Overview
toki-tui/src/runtime/event_loop.rs Added KeyEventKind::Press filter to prevent duplicate key event processing from key releases
toki-tui/src/runtime/action_queue.rs Added OpenEditActivityPicker action to support async activity loading when editing entries
toki-tui/src/runtime/actions.rs Refactored activity loading into reusable ensure_activities_for_project helper; updated handle_entry_edit_enter to use action queue for async operations
toki-tui/src/app/mod.rs Added clear_project_activity and clear_note methods; activity picker now resets search state on exit for clean re-entry
toki-tui/src/runtime/views/timer.rs Added backspace handling to clear project/activity or note when timer is stopped; updated call to handle_entry_edit_enter with action queue parameter
toki-tui/src/runtime/views/history.rs Updated call to handle_entry_edit_enter to pass action queue parameter for async activity loading

Last reviewed commit: 0e4dfda

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
toki2 Ready Ready Preview, Comment Feb 28, 2026 0:20am

Request Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e4dfda9c5

ℹ️ 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".

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.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@alxhall
Copy link
Collaborator

alxhall commented Mar 2, 2026

Tested and verified, so I believe this should be safe to merge!

@ponbac ponbac merged commit e009381 into master Mar 2, 2026
6 checks passed
@ponbac ponbac deleted the tui-fix-stale-activity-selection branch March 2, 2026 12:47
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