Skip to content

Feat/290 pin frequently used timers - #295

Open
Martin-1997 wants to merge 6 commits into
masterfrom
feat/290-pin-frequently-used-timers
Open

Martin-1997 wants to merge 6 commits into
masterfrom
feat/290-pin-frequently-used-timers

Conversation

@Martin-1997

Copy link
Copy Markdown
Collaborator

No description provided.

Martin-1997 and others added 6 commits October 24, 2026 00:20
The Timer view only had a description field and a Start button, so a
new entry could only get its project afterwards in the list.

- Add a project and a tag selector next to the description field.
- Pre-fill them with what the server would pick: for a description that
  was used before, the project and tags of its latest entry; otherwise
  the project of the latest entry that has one. Once the user changes
  the selection, it is kept until the timer starts.
- Send the selection with POST /ajax/start-timer/{name}, which already
  accepts projectId and tags. Clearing the selection keeps the previous
  behaviour: the server copies project and tags from the latest entry
  with the same name.
- The selectors are disabled while a timer is running.

Fixes #293

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
The Timer view sent the end date picker's value as the upper bound for
the entry list. That is the page load time initially, and midnight at
the start of the day once a date is picked, so entries started later
that day were left out: a timer started after opening the page didn't
show up in the list until reload, and picking an end date hid that
day's entries. This also kept "last used project" from updating after
starting a timer.

Send the end of the selected day instead, like the quick range presets
already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
Store a few timers per user (name, project, tags) on the server, so the
web app and the Android app can start them with one click.

New table timetracker_pinned_timer (migration, app version 0.0.94).

Endpoints, all for the current user:
- GET  /ajax/pinned-timers
    -> {"PinnedTimers": [{id, name, projectId, tagIds: [int], sortOrder, createdAt}]}
- POST /ajax/add-pinned-timer           body: name, projectId?, tagIds? ("3,7" or [3, 7])
- POST /ajax/edit-pinned-timer/{id}     body: name, projectId?, tagIds?
- POST /ajax/delete-pinned-timer/{id}
- POST /ajax/reorder-pinned-timers      body: ids ("5,2,9" or [5, 2, 9]), the new order
All POSTs return the updated list, or {"Error": "..."} for an empty or
too long name, a project the user can't access, an identical pin
(same name, project and tags), or another user's pin.

Deleted projects and tags don't leave broken pins:
- deleting a tag removes it from all pins
- deleting a project with its data clears it from everyone's pins
- leaving a project (delete-project) clears it from the user's own pins

Refs #290

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
- A row of pinned timers above the start bar shows each pin's name and
  project colour. Clicking a pin starts its timer with its project and
  tags, stopping a running one; clicking the pin of the running timer
  stops it.
- A pin button on every entry pins its name, project and tags; it's
  disabled when that combination is already pinned.
- Each pin's menu offers Edit (name, project, tags), Move left, Move
  right and Unpin. Pins can also be reordered by drag and drop.
- Adds @mdi/js (already shipped with @nextcloud/vue) as a direct
  dependency for the icons.

Fixes #290

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
Keeps the start bar (description, project, tags, Start) to the controls
for starting a timer.

Refs #290

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
…Stop

Reworks the Timer view after feedback on the pinned timers:

- Pinned timers are a "Pinned" group above the newest day, with the
  same columns as the day lists instead of chips above the start bar.
  Each pin shows the time booked on it today (counting up while it
  runs), Start and Stop buttons, and a menu with Edit, Move up, Move
  down and Unpin. Pins can still be reordered by drag and drop.
- Each day shows one row per timer (same name, project and tags) with
  the total time. Every Start still records its own block, so start and
  end times stay correct in reports, but booking more time on a timer
  no longer adds a row. Rows with several blocks expand to show them,
  each with its time range, duration, cost, details and delete; the
  running block counts up. Changing project or tags of a row changes
  all its blocks; deleting it deletes them after confirmation.
- Separate Start and Stop buttons on every row, every pin and in the
  start bar. Start stops a running timer first; Stop is only enabled
  where the running timer is.
- Only the start bar's Stop names the running timer from the
  description field, as before. Stop on a row or pin, and switching
  timers, keep the timer's name and the typed description.
- All groups use the same column widths; on narrow screens the tables
  scroll sideways inside their group.

Refs #290

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
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.

1 participant