From af9c46398022d25879e5ca4b05c42b4893ec10c7 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Tue, 22 Jun 2021 13:18:07 +0530 Subject: [PATCH 1/5] doc(TODO): add frontend idea --- TODO.org | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/TODO.org b/TODO.org index bab28eb..c161ae4 100644 --- a/TODO.org +++ b/TODO.org @@ -413,7 +413,7 @@ Some options and ideas - - untouched project with target defined - red - target ±5 minutes - green - target*2 and above - red -* documentation discoverability :doc: +* documentation discoverability :doc: Ensure that the user manual is easily discoverable. #+BEGIN_QUOTE @@ -427,7 +427,7 @@ Ensure that the user manual is easily discoverable. [2021-06-02 13:53:37] rnkn: although you will probably need a function link instead to find the org file \\ [2021-06-02 13:54:30] contrapunctus: Although I guess the manual.org does not really need those fancy features...info export could work for it. \\ #+END_QUOTE -* macro for extensions :code:extension: +* macro for extensions :code:extension: <2021-06-07T16:33:54+0530> A macro to create new columns for Chronometrist. @@ -452,7 +452,7 @@ Benefits - + easier creation of such extensions + users can easily replace the function used to generate the cells, without having to deal with how the string is inserted into the row specifier. -* unified format-duration function :code:customization: +* unified format-duration function :code:customization: <2021-06-08T11:17:54+0530> Currently we have at least three ways of displaying durations - ="HH:MM:SS"= , ="XhYm"= , and =X hour(s), Y minutes(s)"= . Make a single function similar to =format-time-string=, but for durations. =ts-human-format-duration= from =ts.el= is not nearly as flexible as I'd like. When completed, we can have a single custom variable accepting a format string, which can be used to customize display of durations for the entire application at once. @@ -490,7 +490,7 @@ Alternative syntax + to display only values, use ="%"= + to display long units, use ="~[]"= -* DONE error - =min= called with nil :spark:bug: +* DONE error - =min= called with nil :spark:bug: <2021-06-11T03:44:17+0530> 1. clock in 2. change =:start= of active interval to another time on the same date @@ -544,7 +544,7 @@ Debugger entered--Lisp error: (wrong-number-of-arguments # 0) command-execute(file-notify-handle-event nil [(file-notify ((1 . 1) (modify) "chronometrist.sexp" 0) file-notify--callback-inotify)] t) #+END_SRC -* STARTED discoverability and mouse-accessibility of commands [33%] :ux: +* STARTED discoverability and mouse-accessibility of commands [33%] :ux: <2021-06-15T16:18:49+0530> Goals 1. discoverability of commands @@ -560,7 +560,7 @@ Strategies * Perhaps I needn't worry too much. =menu-bar-mode= is enabled by default, and it makes #1 and #2 easy. I think a significant amount of the userbase disables =menu-bar-mode=, but they also have things like =counsel-M-x=, =describe-=. + The menu does not make the behavior of the numeric argument discoverable. Doesn't make sense to put it there, either. -* query-editing the file buffer :feature: +* query-editing the file buffer :feature: <2021-06-16T07:50:21+0530> =chronometrist-loop-file= can be used to run queries against user data. It would be cool to be able to edit the file directly from the query results. @@ -569,7 +569,7 @@ Strategies 2. The result data may be something which corresponds to the input data, in which case we could jump to the corresponding plist. 3. The result data may be impossible to trace back to the input data (e.g. a sum of intervals from many plists), in which case we cannot provide direct editing. -* error in change type detection :core:bug: +* error in change type detection :core:bug: <2021-06-16T18:40:18+0530> Steps 1. Clock in @@ -577,16 +577,31 @@ Steps 3. Clock in to different task. Error. Might have to do with there being 2 empty lines between the last-but-one plist and the new last plist. -* spark monthly view :spark:feature: +* Task-specific monthly spark view :spark:feature: :PROPERTIES: :feature: frontend :END: <2021-06-17T00:08:08+0530> Frontend to show one or more months for a specific task, calendar-style, with each day being a single sparkline block. -* Task-specific detailed view :feature: +* Task-specific detailed view :feature: :PROPERTIES: :feature: frontend :END: <2021-06-22T04:57:06+0530> -Frontend similar to =chronometrist=, but specific to one task - displays its unique tag/key-value combinations and their sparklines. Time period (day, week, etc) could be customizable. +Frontend similar to =chronometrist= [fn:1], but specific to one task - displays its unique tag/key-value combinations and their sparklines. Time period (day, week, etc) could be customizable. + +[fn:1] Probably want to extend it by creating a new view-changing command, rather than defining a new frontend. + +* More flexible Chronometrist buffer :feature: +:PROPERTIES: +:feature: frontend +:END: +<2021-06-22T12:45:12+0530> +Define commands to - +1. increment/decrement date for which data is displayed +2. change time range for which data is displayed (day, week, month, etc) + +Problems - +1. What happens when the user clocks in? We could switch back to the default view. Do we want the user to clock in while the buffer is displaying old data? Perhaps clocking in can be disabled while the buffer is displaying old data - you have to exit the 'browse mode' to clock in. + * Non-default views could also be created as new buffers (a la Dired), to differentiate them from the default view as well as make it easy to compare different views. From 2f8d136bf6272e20778fecff8ff64a51491dc487 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Sat, 26 Jun 2021 09:09:11 +0530 Subject: [PATCH 2/5] doc: shorten docstring --- elisp/chronometrist.el | 8 ++------ elisp/chronometrist.org | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/elisp/chronometrist.el b/elisp/chronometrist.el index 360e467..1ebf4a1 100644 --- a/elisp/chronometrist.el +++ b/elisp/chronometrist.el @@ -1457,12 +1457,8 @@ Has no effect if a task is active." ;;;###autoload (defun chronometrist (&optional arg) "Display the user's tasks and the time spent on them today. - -Based on their timelog file `chronometrist-file'. This is the -'listing command' for `chronometrist-mode'. - -If numeric argument ARG is 1, run `chronometrist-report'. -If numeric argument ARG is 2, run `chronometrist-statistics'." +If numeric argument ARG is 1, run `chronometrist-report'; if 2, +run `chronometrist-statistics'." (interactive "P") (chronometrist-migrate-check) (let ((buffer (get-buffer-create chronometrist-buffer-name)) diff --git a/elisp/chronometrist.org b/elisp/chronometrist.org index 68ab0b5..5f80551 100644 --- a/elisp/chronometrist.org +++ b/elisp/chronometrist.org @@ -976,7 +976,7 @@ Boilerplate for updating state between file operations in tests. (list :last (chronometrist-file-hash :before-last nil) :rest (chronometrist-file-hash nil :before-last t))))) #+END_SRC -*** chronometrist-file :custom:variable: +*** chronometrist-file :custom:variable: #+BEGIN_SRC emacs-lisp (defcustom chronometrist-file (locate-user-emacs-file "chronometrist.sexp") @@ -2535,12 +2535,8 @@ Has no effect if a task is active." ;;;###autoload (defun chronometrist (&optional arg) "Display the user's tasks and the time spent on them today. - -Based on their timelog file `chronometrist-file'. This is the -'listing command' for `chronometrist-mode'. - -If numeric argument ARG is 1, run `chronometrist-report'. -If numeric argument ARG is 2, run `chronometrist-statistics'." +If numeric argument ARG is 1, run `chronometrist-report'; if 2, +run `chronometrist-statistics'." (interactive "P") (chronometrist-migrate-check) (let ((buffer (get-buffer-create chronometrist-buffer-name)) From 3c9fc9b13a884d57fa6772d97cef547171343f34 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Sat, 26 Jun 2021 09:11:27 +0530 Subject: [PATCH 3/5] doc(TODO): add frontend macro idea --- TODO.org | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/TODO.org b/TODO.org index c161ae4..4f7eee3 100644 --- a/TODO.org +++ b/TODO.org @@ -429,7 +429,6 @@ Ensure that the user manual is easily discoverable. #+END_QUOTE * macro for extensions :code:extension: <2021-06-07T16:33:54+0530> - A macro to create new columns for Chronometrist. Extension writer specifies @@ -452,6 +451,26 @@ Benefits - + easier creation of such extensions + users can easily replace the function used to generate the cells, without having to deal with how the string is inserted into the row specifier. +Current uses - +1. =chronometrist-goal= +2. =chronometrist-spark= + +* macro for frontends :code: +<2021-06-26T08:49:25+0530> +A macro to create Chronometrist frontends (based on =tabulated-list-mode=). If implemented, would shorten code for all four existing and two planned frontends. + +Programmer specifies - +1. frontend command name (a symbol) +2. name (string, passed to =define-derived-mode=) +3. rows function +4. schema value +5. name of buffer created by command + +Macro creates - +1. =frontend= interactive command, which behaves like a toggle +2. function =frontend-rows= +3. custom variables =frontend-schema=, =frontend-row-transformers=, =frontend-schema-transformers=, =frontend-buffer-name= + * unified format-duration function :code:customization: <2021-06-08T11:17:54+0530> @@ -577,7 +596,7 @@ Steps 3. Clock in to different task. Error. Might have to do with there being 2 empty lines between the last-but-one plist and the new last plist. -* Task-specific monthly spark view :spark:feature: +* spark monthly view :spark:feature: :PROPERTIES: :feature: frontend :END: From df8b7adf801b9c96504dbdea64f9f5e423fb82a6 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Sun, 27 Jun 2021 05:42:08 +0530 Subject: [PATCH 4/5] doc(TODO): add enhanced sparklines idea --- TODO.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TODO.org b/TODO.org index 4f7eee3..1184956 100644 --- a/TODO.org +++ b/TODO.org @@ -624,3 +624,9 @@ Define commands to - Problems - 1. What happens when the user clocks in? We could switch back to the default view. Do we want the user to clock in while the buffer is displaying old data? Perhaps clocking in can be disabled while the buffer is displaying old data - you have to exit the 'browse mode' to clock in. * Non-default views could also be created as new buffers (a la Dired), to differentiate them from the default view as well as make it easy to compare different views. + +* Enhanced sparklines :feature: +<2021-06-27T05:42:56+0530> +Show more information when hovering or clicking on a sparkline bar - +1. mouse over on a bar to show the duration it represents +2. if the bar represents time in a single day, click on it open =chronometrist-details= for that day. From ffa02ad3e9668c197a4e001f3a46b1e8dda43834 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Thu, 1 Jul 2021 07:28:06 +0530 Subject: [PATCH 5/5] doc(TODO): unify frontend ideas and add new ones --- TODO.org | 78 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/TODO.org b/TODO.org index 1184956..b959777 100644 --- a/TODO.org +++ b/TODO.org @@ -596,37 +596,53 @@ Steps 3. Clock in to different task. Error. Might have to do with there being 2 empty lines between the last-but-one plist and the new last plist. -* spark monthly view :spark:feature: -:PROPERTIES: -:feature: frontend -:END: -<2021-06-17T00:08:08+0530> -Frontend to show one or more months for a specific task, calendar-style, with each day being a single sparkline block. -* Task-specific detailed view :feature: -:PROPERTIES: -:feature: frontend -:END: -<2021-06-22T04:57:06+0530> -Frontend similar to =chronometrist= [fn:1], but specific to one task - displays its unique tag/key-value combinations and their sparklines. Time period (day, week, etc) could be customizable. +* STARTED New frontends and enhancements :feature: +** Existing frontends +*** chronometrist (overview for a day) +list of tasks, one day, durations and graphs ++ commands [0%] + 1. [ ] previous/next day + 2. [ ] set day + 3. [ ] reset day + 4. [ ] set duration format +*** report +list of tasks, one week, durations only +*** statistics +list of tasks, one week/month/year [fn:1] +*** details (intervals for a day) [0%] +list of intervals, one day [fn:1] ++ [-] commands [50%] + 1. [X] set [task/key-value] filter [fn:2] + 2. [X] set range + 3. [ ] previous/next day + 4. [ ] set duration format ++ [ ] with =spark= - vertical sparkline for each interval ++ [ ] non-tabular text [fn:3] ++ [ ] when range is a pair with the =car= or the =cdr= being blank, set the respective date to the earliest (if =car= is blank) or the latest (if =cdr= is blank) date available. -[fn:1] Probably want to extend it by creating a new view-changing command, rather than defining a new frontend. +** New frontends I want +*** task-key-values +list of unique key-values for a task, one day [fn:1], durations and graphs ++ commands [0%] + 1. [ ] set task + 2. [ ] set range +*** task-graph [0%] +list of weeks or months [fn:1], one task (with optional key-value filter [fn:2]), horizontal graph (and durations/stats?) ++ [ ] commands [0%] + 1. [ ] toggle week/month + 2. [ ] set [task/key-value] filter + 3. [ ] set range ++ [ ] non-tabular text [fn:3] -* More flexible Chronometrist buffer :feature: -:PROPERTIES: -:feature: frontend -:END: -<2021-06-22T12:45:12+0530> -Define commands to - -1. increment/decrement date for which data is displayed -2. change time range for which data is displayed (day, week, month, etc) - -Problems - -1. What happens when the user clocks in? We could switch back to the default view. Do we want the user to clock in while the buffer is displaying old data? Perhaps clocking in can be disabled while the buffer is displaying old data - you have to exit the 'browse mode' to clock in. - * Non-default views could also be created as new buffers (a la Dired), to differentiate them from the default view as well as make it easy to compare different views. - -* Enhanced sparklines :feature: -<2021-06-27T05:42:56+0530> -Show more information when hovering or clicking on a sparkline bar - -1. mouse over on a bar to show the duration it represents -2. if the bar represents time in a single day, click on it open =chronometrist-details= for that day. +[fn:1] variable range +[fn:2] keys - show intervals with those keys; key-values - intervals with those values; or predicate +[fn:3] +#+BEGIN_SRC +"(Showing intervals|No intervals to show) +[(with (*|*)| +matching )] +(for | +between (|) and (|)| +for )" +#+END_SRC