Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Respond with ONLY valid JSON matching this exact schema — no markdown, no expl
"description": "string (1 sentence explaining the task)",
"type": "feature" | "bug" | "task",
"priority": "high" | "medium" | "low",
"storyPoints": number (1-13, fibonacci-ish: 1 2 3 5 8 13)
"storyPoints": number (must be one of: 1 2 3 5 8 13 21)
}
]
}`
Expand Down
36 changes: 25 additions & 11 deletions src/components/dialogs/WorkItemDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react'
import type { WorkItem, Sprint } from '../../types'
import { STATUSES, PRIORITIES, ITEM_TYPES, STATUS_LABELS, PRIORITY_LABELS, TYPE_LABELS } from '../../constants'
import { STATUSES, PRIORITIES, ITEM_TYPES, STATUS_LABELS, PRIORITY_LABELS, TYPE_LABELS, FIBONACCI_POINTS } from '../../constants'

interface Props {
item?: WorkItem | null
Expand Down Expand Up @@ -74,16 +74,27 @@ export default function WorkItemDialog({ item, sprints, onSave, onDelete, onClos
</label>
</div>

<div style={row}>
<label style={{ ...label, flex: 1 }}>Sprint
<select style={input} value={form.sprintId} onChange={e => set('sprintId', e.target.value)}>
<option value="">Backlog (no sprint)</option>
{sprints.map(s => <option key={s.id} value={s.id}>{s.name}</option>)}
</select>
</label>
<label style={{ ...label, width: 80 }}>Points
<input style={input} type="number" min={0} max={100} value={form.storyPoints} onChange={e => set('storyPoints', Number(e.target.value))} />
</label>
<label style={label}>Sprint
<select style={input} value={form.sprintId} onChange={e => set('sprintId', e.target.value)}>
<option value="">Backlog (no sprint)</option>
{sprints.map(s => <option key={s.id} value={s.id}>{s.name}</option>)}
</select>
</label>

<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
<span style={label}>Story Points</span>
<div style={pointsPicker}>
{FIBONACCI_POINTS.map(pt => (
<button
key={pt}
type="button"
style={{ ...pointsBtn, ...(form.storyPoints === pt ? pointsBtnActive : {}) }}
onClick={() => set('storyPoints', form.storyPoints === pt ? 0 : pt)}
>
{pt}
</button>
))}
</div>
</div>

<div style={row}>
Expand Down Expand Up @@ -128,3 +139,6 @@ const input: React.CSSProperties = { background: '#0f172a', border: '1px solid #
const primaryBtn: React.CSSProperties = { background: '#3b82f6', color: '#fff', border: 'none', borderRadius: 6, padding: '8px 20px', fontSize: 14, fontWeight: 600, cursor: 'pointer' }
const ghostBtn: React.CSSProperties = { background: 'none', border: '1px solid #334155', color: '#94a3b8', borderRadius: 6, padding: '8px 20px', fontSize: 14, cursor: 'pointer' }
const deleteBtn: React.CSSProperties = { background: 'none', border: '1px solid #7f1d1d', color: '#f87171', borderRadius: 6, padding: '8px 16px', fontSize: 14, cursor: 'pointer' }
const pointsPicker: React.CSSProperties = { display: 'flex', gap: 6 }
const pointsBtn: React.CSSProperties = { flex: 1, background: '#0f172a', border: '1px solid #334155', borderRadius: 6, color: '#64748b', fontSize: 14, fontWeight: 600, padding: '8px 0', cursor: 'pointer' }
const pointsBtnActive: React.CSSProperties = { background: '#1d4ed8', border: '1px solid #3b82f6', color: '#fff' }
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ export const STATUSES: WorkItemStatus[] = ['new', 'active', 'resolved', 'closed
export const PRIORITIES: Priority[] = ['high', 'medium', 'low']
export const ITEM_TYPES: WorkItemType[] = ['feature', 'bug', 'task']
export const SPRINT_STATUSES: SprintStatus[] = ['planned', 'active', 'completed']
export const FIBONACCI_POINTS: number[] = [1, 2, 3, 5, 8, 13, 21]
Loading