Skip to content

Fix the Clock-In and Ticket Timer Flow From Start to Clock-Out #586

Closed

Description

@SarkarShubhdeep

Overview

Ticket timers need an active shift, so clocking in and starting a ticket timer are one flow in practice, but they are wired as separate steps that don't hand off to each other. This holds for every ticket, Huddle or Redmine, and every place a timer can be started. A user who starts a ticket while clocked out can hit a dead end (plan-required teams), or get their timer started with no confirmation (everyone else). Switching tickets and clocking out also stop timers without saying so. This issue makes the clock-in → ticket timer → clock-out path one continuous, confirmed flow, for any ticket, wherever it is started. It replaces #580.

Current State

  • The server gate is source-agnostic. timers.createEntry and timers.startSession both refuse with no-active-shift when there is no shift, for Huddle and Redmine tickets alike.

  • The client handling is not. Each start point deals with being clocked out on its own:

    Start point Huddle Redmine Clocked out today
    My Board rows (TicketsPage) ✅ ✅ "Clock In Required" prompt
    Search suggestions (TicketsPage) — ✅ same prompt
    Work page entry rows (WorkPage, timers.startSession) ✅ ✅ its own copy of the prompt
    Redmine issue page (Start a Timer and Add to My Board From the Redmine Issue Page #594) — ✅ no prompt: "Clock in to start a ticket timer."
  • The prompt dead-ends on plan-required teams. handleClockInAndStart calls a bare clockIn(), which fails and shows "Write today's plan first — see the Clock page or Huddle." The user has to leave, and the timer they asked for never starts.

  • Otherwise the delayed start is silent. The timer starts, but its outcome is discarded, so no toast, and the Redmine suggestions don't refresh.

  • Only Redmine suggestion starts are confirmed at all. A direct start from a My Board row or the Work page, Huddle or Redmine, shows no toast. The toast strings (suggestionText.timerStarted*) are Redmine-only and name the ticket by #id.

  • The start itself is already shared for ticket rows: startTicketTimer and toastTimerOutcome in src/features/tickets/startTicketTimer.ts (Start a Timer From the Redmine Issue Page #595). Only the clock-in half is still copied.

  • Switching tickets: starting a second timer closes the first (closeRunningSession, timers.js) with no message.

  • Clocking out closes every running ticket timer (closeAllForUser, clock.js) without warning.

Proposed Flow

The whole work day as one path. A ticket of any source (Huddle or Redmine), started from anywhere while clocked out, goes through the clock-in prompt, which plans (if the team requires it), clocks in, and then starts that ticket by itself.

flowchart TD
    Plan["1 · Plan the day<br/>Plan in composer, posted to Huddle"]
    ClockIn["2 · Clock in<br/>clock.start — the main timer runs"]
    StartTicket["3 · Start ticket timer<br/>One at a time, any ticket<br/>Pins a Redmine issue<br/>Confirms the start, names a switched-off ticket"]
    StopTicket["4 · Stop ticket<br/>Ask for a one-line note (optional)"]
    MoreTickets{"More tickets?"}
    WrapUp["5 · Submit wrap-up<br/>Prefilled: plan + ticket times + notes"]
    ClockOut["6 · Clock out<br/>Closes timers visibly; offers Redmine push"]
    ClockInPrompt["Clock-in prompt<br/>Plan (if required), then clock in<br/>Resumes the ticket + shows a toast"]

    Plan --> ClockIn --> StartTicket --> StopTicket --> MoreTickets
    MoreTickets -->|yes| StartTicket
    MoreTickets -->|no| WrapUp --> ClockOut
    StartTicket -->|clocked out| ClockInPrompt
    ClockInPrompt -->|plan and clock in first| Plan

    classDef existing fill:#f5f5f5,stroke:#a3a3a3,color:#262626
    classDef thisIssue fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#1e3a8a
    classDef later fill:#ffffff,stroke:#a3a3a3,stroke-dasharray:5 4,color:#525252
    class Plan,ClockIn,MoreTickets existing
    class StartTicket,ClockInPrompt,ClockOut thisIssue
    class StopTicket,WrapUp later
Loading

Key: blue, solid border = what this issue delivers (the clock-in prompt, start and switch confirmations, the clock-out warning). Grey = works today. Dashed = the later part of the same flow, out of scope here: the stop note (4), the prefilled wrap-up (5) and the Redmine push offered at clock-out (6).

Proposed Changes

  1. One shared, source-agnostic clock-in-then-start hook
    • Extract the clock-in prompt from TicketsPage and WorkPage into one hook before changing it.
    • It takes the start to run once clocked in, not a ticket shape, so it works for any ticket and any start: startTicketTimer for ticket rows and the issue page, timers.startSession for Work page entries.
    • Use it at every start point in the table above. Any future start point (for example a timer on the Huddle ticket page) uses it too.
  2. Plan-first clock-in, then resume
    • When the team requires a plan, the "Clock In Required" prompt says so and offers Write today's plan, which opens the Clock page with the ticket remembered.
    • The Clock page shows which timer is waiting, with a Cancel.
    • As soon as the user posts the plan and clocks in, the pending ticket starts by itself and they're returned to the page they started from.
    • The plan is written in the Clock page's own composer; the prompt has no composer of its own.
  3. Confirm the start on every path, for every ticket
    • Every start shows a toast, direct or delayed, Huddle or Redmine: "Timer started on #1234 and added to My Board" for a Redmine issue, the ticket's title for a Huddle ticket, and the pin-limit message from Show a Clear Message When the Redmine Pin Limit Is Reached #581 where it applies.
    • Move the toast strings out of the Redmine suggestion strings into ticket-timer strings that name a ticket by its source.
    • Refresh the Redmine suggestion list after a Redmine start, as a direct start does.
  4. Say when a timer is stopped for the user
    • Switching tickets names both, whatever their sources: "Stopped Timeharbor Legacy Full Conversion #12, started Fix login".
    • Clocking out with a timer running: the Clock page shows "Clocking out will stop the timer on …" under the clock-out controls (an inline notice, not a confirm dialog).

Acceptance Criteria

  • On a plan-required team, starting any ticket while clocked out takes the user to write the plan, and ends with the timer running and the user back where they started
  • This works the same for a Huddle ticket and a Redmine issue
  • It works from every start point: My Board rows, search suggestions, Work page entries and the Redmine issue page
  • Every start (direct or through the prompt, Huddle or Redmine) shows a toast naming the ticket
  • The "Timer running" suggestion chip is correct after a delayed start
  • Switching tickets tells the user which timer stopped
  • With a timer running, the Clock page says clocking out will stop it, naming the ticket
  • One shared hook; no start point keeps its own copy of the prompt
  • E2E tests cover: plan-required clock-in → timer running, for a Huddle ticket and a Redmine issue; clock-in prompt → toast; switch message; clock-out notice

Out of Scope (for Now)

Activity

  1. added
    bug
    ui
    and removed on Sep 28, 2026
  2. changed the title [-]Clock-In Prompt Dead-Ends When the Team Requires a Daily Plan[/-] [+]Fix the Clock-In and Ticket Timer Flow From Start to Clock-Out[/+] on Sep 28, 2026
  3. SarkarShubhdeep commented on Sep 28, 2026

    @SarkarShubhdeep
    CollaboratorAuthor

    Follow-up for when the shared clock-in-then-start hook lands: #594 is being scoped down to not depend on this issue. Its Redmine issue page Start timer button will show "Clock in to start a ticket timer." when clocked out, rather than opening the prompt. Once the hook exists, that page should use it too, so it gets the same prompt and plan-first flow as the Tickets and Work pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

High Prioritybuguiweb

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions