Giter VIP home page Giter VIP logo

rust-cli-pomodoro's Introduction

Hello

24seconds's GitHub stats

Top Langs

rust-cli-pomodoro's People

Contributors

24seconds avatar adrianeffe avatar dependabot[bot] avatar docongminh avatar m-hamashita avatar pablito2020 avatar panarch avatar therustypickle avatar youngmind1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rust-cli-pomodoro's Issues

[Bug] `history` command via IPC returns error in MacOS

Description

This bug is easy to reproduce. When starting pomodoro in one terminal tab and send command with another terminal tab, then pomodoro app can not handle and returns error

pomodoro client side

image

pomodoro receiving side

image

Reproduce steps

  1. Initialize pomodoro app in terminalA
  2. create notifications around 36 in terminalA
  3. delete all notifications in terminalA
  4. prepare terminalB. Typed pomodoro history
  5. Then you will see the error

Solution

Maybe pomodoro app should stream the output and keep the buffer space usage as low as possible.

[installation] brew support

Description

Thanks to many people, I guess it's okay to support brew installation. Other installation channel suggestions are welcome.

Modify README for v1.2.0 prepartion

title explains itself

  • write new mode description! (ipc)
  • rewrite printed help, command and subcommand
  • Add architecture picture for better understanding
  • Update RoadMap
  • Update Compatibility

[nit feature] show configured options when running pomodoro

Description

When the pomodoro is running, sometimes user may(?) want to know what was the configuration.
To solve this curiosity, it would be nice to provide this

# IPC mode
> pomodoro config list 

# standalone mode
> config list

# expected output sample
[2023-03-28T11:56:07Z INFO  pomodoro::configuration]
    config flag result!
    ┌────┬─────────────────────┬───────────────────────────────────┐
    │ ok │ desc                │ reason                            │
    ├────┼─────────────────────┼───────────────────────────────────┤
    │ O  │ no config err       │                                   │
    ├────┼─────────────────────┼───────────────────────────────────┤
    │ X  │ slack_channel       │ can not find slack config in json │
    ├────┼─────────────────────┼───────────────────────────────────┤
    │ X  │ slack_token         │ can not find slack config in json │
    ├────┼─────────────────────┼───────────────────────────────────┤
    │ O  │ discord_webhook_url │                                   │
    └────┴─────────────────────┴───────────────────────────────────┘

Friendly credential.json message

Thanks again @panarch . When initializing the pomodoro app, currently user doesn't know which configuration is successfully applied. I think it's not user friendly. So let's fix this

  • notify user that credential.json is correctly applied or not
  • if applied then which option is successfully applied

Show percentage

While using the app, I found that sometimes I need to finish pomodoro timer early. In that case, I want to record how much did I spend - 70%, 50% for example. Let's make this option

This is adding new column named percentage

Upgrade clap version?

Current clap version is 3.1.6 (as of 2022 Mar 14th). If it's worth to upgrade the clap version, let's do it

Support discord webhook notification

I found that sometimes discord notification is needed.
Let's implement it. It's quite simple

credential.json format would look like this

{
    "discord": {
        "webhook_url": "your webhook url"
    }
}

After implementation, don't forget to update README.md

[improvement] Generate config report considering newly added configurations

Description

image

Recently work_time_default_value and break_time_default_value configurations are added. Therefore, the config report should reflect it.

  • If the work_time_default_value is not given, then 'ok' would be x and the reason would be not specified
  • If the work_time_default_value is given, then 'ok' would be o and the reason would be empty
  • this rule works same as for break_time_default_value

Support cargo install

Currently this pomodoro app is hard to use for other people.
To make app more like app, there are somethings to do.

  • get credential_json via input argument or flag (#10 )
  • publish this app so that other can use it

Feature: provide more configuration knob to users

Description

Currently rust-cli-pomodoro app forces desktop notification and sound (as I remember..).
But sometimes it could be annoying to other people. Therefore, it would be nice to if we gave knob to user about

  • controlling sound dynamically
  • turning on/off notification channel dynamically

What dynamically means user can turn it on/off whenever they want while the app is running.

Any configuration which can be controlled dynamically suggestions are welcome

[Discussion needed, new feature] Support writing `description` for each notification

Description

Currently description column is not used. It just shows default string, sample. See the image below.
image

I found that this could be useful if it accepts user input. If the user can type description on their own, then the user can see the more information in history.

Problem - fat table & accepting user input

Because the result of list table is quite fat (there are many columns), I don't think it's good idea to extend description column. For example, if the description string length is more than 50 (50 is just a sample number. There is no meaning), then the table would be more uglier than now. So we should find a proper way of

  • showing description efficiently
  • accepting description from user input efficiently

Suggestion - accepting description from user input

Maybe --description or --desc should be introduced. For example, we can create a notification like this.

> pomodoro create --default --desc "finish writing README.md"

Discussion needed - showing description efficiently

I have no idea..

Additional feature

  • Maybe description can be configured by --config option if it is changed too often.
  • Desktop Notification or other channel notification message can contain description.

Feature: command auto complete

Description

When I use the git command, git supports auto complete. For example, I typed git sta and pressed tab then git showed suggestions. I can select one of suggestions with arrow keys (up/down) and tab and enter.

image

Fig 1. `git sta` example

It would be nice for pomodoro to support this feature also

Support executing commands in any terminal tabs

Usually rust-cli-pomodoro works as follow

  1. run binary in certain terminal tab
  2. write command to that terminal tab. Then rust-cli-pomodoro works with the command

I found that whenever I need to write command, it's quite cumbersome.
I need to find the executing terminal then write command.

How can we improve this? There might be several options.

  1. run rust-cli-pomodoro as a server and listen to the specific port (TCP or Unix)
  2. (any suggestion?)

Why is main.rs using the tokyo::sync::oneshot channels?

Hi!
First of all, emphasize that I have seen the project and it fits exactly in my needs (to have an offline tool to manage pomodoro times), and I want to contribute to the project.

I've been looking at the code for a while and I can't understand why are you using oneshot::channel for communicating between the different threads. Couldn't the first tokio::spawn thread delegate the function to display the type of error/action to the thread that analyzes the user input? With this form we wouldn't need the tokyo::sync::oneshot channel, (element that has made my reading of the code a little bit more difficult).

channel figure

Finally, why is this project using the tokio library instead of the standard thread api from rust? From what I have seen I would say that all the added functionalities can be done (without much more complication) with the standard library. Emphasize that in case you say that the tokio library is not really necessary, I could contribute to port the current code to a new one that uses the standard thread library.

Thanks in advance and that said, I will try to contribute when I can, although it has to be said that I am relatively new to rust 😅

Handle notification error user friendly

  • notify user that which notifications (default, slack, discord etc) is failed or succeed
  • do not interrupt other notifications if one notification failed or made error

Mark terminal_notifier as configuration option

Description

while preparing the release, I found that macOS compiles notify_terminal_notifier function.
And inside this function, it's calling terminal-notifier.
So macOS user should install this binary to avoid error currently.

To avoid this inefficiency, let's handle the case where macOS user didn't install it

Feature: arrow up key shows previous command

Description

Usually terminal supports thie feature: when I entered arrow up key, then the terminal automatically shows previous command.

Maybe it would be nice to implement this feature in pomodoro cli

Support `Queue` command

Queue command is to queue the notification.
For example, if there is several notifications in the Notification table,
Queue would create notification started at right after the last notification in Notification table expired.

Support notification history

It's different from #14 . This feature is to show the notification history.
Currently, once the notification is consumed, it is deleted in the memory.
Recently I felt like notification history is really needed. So it's good to keep notification history in the memory.

Maybe new table, archived_notifications are needed to do this.

Feature: Clear history

While using the history, I found that staled notification is not that important. So I guess it's okay to delete them.
Let's support clearing feature.
As of now clearing all or nothing is enough to cover my needs, providing flag --clear or --c would be okay.

`test` command yield wrong notification configuration

Description

When running test command, the notification configuration UI shows wrongly.
image

  • I did not specify slack but it shows it is configured
  • I think desktop notification works well but it shows it is not configured

Figure out root cause and let's fix it!

Refactoring main.rs

main.rs is lenghty. Refactor it so that reader can focus on what they really want.

[Bug] `d -a` command not work.

Description

Previously in the version 1.3.4 rust-cli-pomodoro, d -a command works. It deletes all notifications in the queue.
But main branch version rust-cli-pomodoro can not handle this command. Let's fix it.

Additional

To prevent this case, it would be nice to write down test case for this.

print message with timestamp

sometimes I want to check when did I run the command without typing the command.

This is current stdout message.
As-is

❯ pmdr q -b 5
Notification (id: 67) created and queued

Let's add timestamp like this.
To-be

❯ pmdr q -b 5
[2023-01-22 14:12] Notification (id: 67) created and queued

Bug? Feature?: Start up pomodoro with IPC mode by specifying the option

Description

While using it, I found that I wanted to make ipc command but I sometimes typed pmdr by mistake. Then what it happened is running pomodoro's ipc socket is closed. (Because newly running pomodoro app - by pmdr command - deleted existing file..)
To prevent this, let's run pomodoro app with certain option if user wants IPC feature.

Maybe --ipc flag would be enough?

Support command history

I've using this app and found that maybe it's good to show the usage statistics.
To do that, logging the command should be done first

Integration with any other storage for the analysis

While using this app, I think it could be more powerful if it supports history tracking.
For example, week or day analysis can be possible. And visualizing the history can give some insight to me.
Maybe the simple storage for this purpose would be firestore I guess.

Feature: draw gantt chart or statistic report

Description

Sometime, it's good to look back. I guess gantt chart form is good to view and might give some insights to users.
Or any other statistic report form suggestions are welcome.

Goal

  • draw gantt chart. Output can be either terminal standard output or jpeg image.
  • [optional] If possible, adding more statistics report form.

Implement timeout for ipc

Description

Sometimes socket doesn't work as expected. In that case timeout is necessary to proceed the program execution. Let's implement it

Concurrent sending notifications feature

Currently, sending notifications are done by one by one. So it took some time to get notification.
To reduce the latency a bit, let's make sending notifications concurrently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.