Add Reset button and move End Day to right side of actions bar
Reset clears the current block's elapsed time to zero and immediately starts the timer. A shared compute_block_elapsed() utility (utils/timer.py) handles the elapsed calculation in both the sessions and dashboard routers, and correctly treats "reset" events as zero-elapsed restart markers so page reloads after a reset show accurate times. Layout: Start/Pause/Resume/Reset are grouped on the left; End Day sits on the right via justify-content: space-between. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,21 +42,28 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="session-actions">
|
||||
<button
|
||||
class="btn-sm"
|
||||
v-if="scheduleStore.session.current_block_id && !scheduleStore.isPaused"
|
||||
@click="sendAction('pause')"
|
||||
>Pause</button>
|
||||
<button
|
||||
class="btn-sm btn-start"
|
||||
v-if="scheduleStore.isPaused && scheduleStore.blockElapsedOffset === 0 && scheduleStore.session.current_block_id"
|
||||
@click="scheduleStore.startCurrentBlock(scheduleStore.session.id)"
|
||||
>Start</button>
|
||||
<button
|
||||
class="btn-sm"
|
||||
v-if="scheduleStore.isPaused && scheduleStore.blockElapsedOffset > 0"
|
||||
@click="sendAction('resume')"
|
||||
>Resume</button>
|
||||
<div class="session-actions-left">
|
||||
<button
|
||||
class="btn-sm"
|
||||
v-if="scheduleStore.session.current_block_id && !scheduleStore.isPaused"
|
||||
@click="sendAction('pause')"
|
||||
>Pause</button>
|
||||
<button
|
||||
class="btn-sm btn-start"
|
||||
v-if="scheduleStore.isPaused && scheduleStore.blockElapsedOffset === 0 && scheduleStore.session.current_block_id"
|
||||
@click="scheduleStore.startCurrentBlock(scheduleStore.session.id)"
|
||||
>Start</button>
|
||||
<button
|
||||
class="btn-sm"
|
||||
v-if="scheduleStore.isPaused && scheduleStore.blockElapsedOffset > 0"
|
||||
@click="sendAction('resume')"
|
||||
>Resume</button>
|
||||
<button
|
||||
class="btn-sm"
|
||||
v-if="scheduleStore.session.current_block_id"
|
||||
@click="scheduleStore.resetCurrentBlock(scheduleStore.session.id)"
|
||||
>Reset</button>
|
||||
</div>
|
||||
<button class="btn-sm btn-danger" @click="sendAction('complete')">End Day</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -306,7 +313,8 @@ h1 { font-size: 1.75rem; font-weight: 700; }
|
||||
}
|
||||
|
||||
.current-block-timer { display: flex; justify-content: center; margin: 1rem 0; }
|
||||
.session-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
|
||||
.session-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; gap: 0.5rem; }
|
||||
.session-actions-left { display: flex; gap: 0.5rem; flex-wrap: wrap; }
|
||||
|
||||
.btn-sm {
|
||||
padding: 0.4rem 0.9rem;
|
||||
|
||||
Reference in New Issue
Block a user