Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refresh without tui interval functionality #102

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

coolsloth55
Copy link
Contributor

Partial for #101

I couldn't wrap my head around on how to hook into TUI correctly to fetch but also dynamically update list like r key does but from some event or go routine.

  • Added config for convenience.
  • Added a timestamp for refreshed status.

If timestamp is welcomed I'm also open to making it configurable from config for those who prefer something other than YYYY-MM-DD hh:mm:ss.

@guyfedwards
Copy link
Owner

guyfedwards commented Dec 15, 2024

Thanks for this @coolsloth55. The TUI background refresh can be a separate PR which just calls Refresh on a timer.

Overall happy to merge if you just remove the timestamp bit for now, thanks

return listUpdate{
items: convertItems(items),
status: "Refreshed.",
status: fmt.Sprintf("Refreshed at %s.", now),
Copy link
Owner

Choose a reason for hiding this comment

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

As the only method for refresh currently is the nom refresh command I don't think a timestamp is needed.

This can be something to add with the TUI background update and maybe shown somewhere dedicated in the UI (bottom or top right maybe) with a relative date
E.g. Updated 5m ago

@guyfedwards guyfedwards merged commit 0087188 into guyfedwards:master Dec 16, 2024
2 checks passed
@guyfedwards
Copy link
Owner

thanks for the contribution @coolsloth55 🎉

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