summaryrefslogtreecommitdiff
path: root/src/components/TimerView.tsx
diff options
context:
space:
mode:
authorSolstice <solstice@local>2026-06-09 01:02:30 -0700
committerSolstice <solstice@local>2026-06-09 01:02:30 -0700
commit4e2d978eb5fc9457d5b913bc10faf1266e6dcda4 (patch)
tree835f8cdc1160fe979a39e0bdad0c5179cc49820d /src/components/TimerView.tsx
parentf43f549ffbe3074977116c9f35aa7064d6a4bd95 (diff)
chore: final polish and preparation for release
Diffstat (limited to 'src/components/TimerView.tsx')
-rw-r--r--src/components/TimerView.tsx37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/components/TimerView.tsx b/src/components/TimerView.tsx
index 973f09f..896c03a 100644
--- a/src/components/TimerView.tsx
+++ b/src/components/TimerView.tsx
@@ -1,3 +1,4 @@
+import type { CSSProperties } from 'react';
import { invoke } from '@tauri-apps/api/core';
import { useTimerStore, TimerPhase } from '../store/timerStore';
import { useTaskStore } from '../store/taskStore';
@@ -7,6 +8,18 @@ const STROKE = 8;
const RADIUS = (RING_SIZE - STROKE) / 2;
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
+const TASK_LABEL_STYLE: CSSProperties = {
+ fontFamily: 'var(--font-sans)',
+ fontSize: '14px',
+ color: 'var(--fg-3)',
+ maxWidth: '320px',
+ textAlign: 'center',
+ minHeight: '20px',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+};
+
function phaseLabel(phase: TimerPhase): string {
switch (phase) {
case 'work': return 'Focus';
@@ -60,9 +73,9 @@ export function TimerView() {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
- gap: '24px',
+ gap: '20px',
flex: 1,
- padding: '32px',
+ padding: '24px 20px',
}}
>
{/* Eyebrow */}
@@ -142,25 +155,10 @@ export function TimerView() {
</div>
{/* Current task name */}
- {currentTask && (
- <span
- style={{
- fontFamily: 'var(--font-sans)',
- fontSize: '14px',
- color: 'var(--fg-3)',
- maxWidth: '320px',
- textAlign: 'center',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- }}
- >
- {currentTask.name}
- </span>
- )}
+ <span style={TASK_LABEL_STYLE}>{currentTask ? currentTask.name : 'No task selected'}</span>
{/* Controls */}
- <div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
+ <div style={{ display: 'flex', gap: '8px', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap' }}>
<button
onClick={running ? handlePause : handleStart}
style={{
@@ -213,6 +211,7 @@ function GhostButton({
fontSize: '14px',
fontWeight: 500,
padding: '8px 16px',
+ minWidth: '72px',
borderRadius: 'var(--r-1)',
border: '1px solid var(--line-2)',
background: 'transparent',