Skip to content

fix(tui): fix activities fetch issue and let backspace key clear input fields for non-running timer#92

Closed
alxhall wants to merge 2 commits intoponbac:masterfrom
alxhall:fix/tui-stale-activity-selection
Closed

fix(tui): fix activities fetch issue and let backspace key clear input fields for non-running timer#92
alxhall wants to merge 2 commits intoponbac:masterfrom
alxhall:fix/tui-stale-activity-selection

Conversation

@alxhall
Copy link
Collaborator

@alxhall alxhall commented Feb 27, 2026

Greptile Summary

Fixed activity fetching in edit mode by refactoring the Enter key handler to async, ensuring activities are fetched from the API when editing entries with projects that aren't in the cache. Also fixed double key event processing by filtering for KeyEventKind::Press, cleared activity search state when entering the activity picker, and added Backspace keybinding to clear project/activity or note when the timer is stopped.

Key changes:

  • Refactored handle_entry_edit_enter into async version that fetches activities on-demand using the activity cache
  • Added KeyEventKind::Press filtering to prevent processing both key press and release events
  • Reset activity search input and filtered list when entering SelectActivity view
  • Added clear_project_activity() and clear_note() methods
  • Bound Backspace key to clear fields when timer is stopped and appropriate box is focused

Confidence Score: 5/5

  • Safe to merge - focused bug fixes and UX improvements with no breaking changes
  • Clean refactoring that fixes a real bug (activities not being fetched in edit mode), adds proper key event filtering, and improves UX with clear functionality. Changes are well-contained to the TUI module with no impact on other components.
  • No files require special attention

Important Files Changed

Filename Overview
toki-tui/src/app/mod.rs Added clear_project_activity() and clear_note() helper methods, fixed activity search state reset when entering activity picker
toki-tui/src/main.rs Fixed key event double-processing, refactored edit-mode Enter handler to async to fetch activities on-demand, added Backspace keybinding to clear fields

Last reviewed commit: 30fa326

(5/5) You can turn off certain types of comments like style here!

@vercel
Copy link

vercel bot commented Feb 27, 2026

@alxhall is attempting to deploy a commit to the ponbac's projects Team on Vercel.

A member of the Team first needs to authorize it.

@alxhall alxhall changed the title fix(tui): fix activitie fetch issue and add backspace keybinding to clear project/activity and note for non-running timer fix(tui): fix activities fetch issue and let backspace key clear input fields for non-running timer Feb 27, 2026
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.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ponbac
Copy link
Owner

ponbac commented Feb 28, 2026

Replaced with #94

@ponbac ponbac closed this Feb 28, 2026
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