mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix(activity): animate the braille spinner in SVG and tighten the activity lists
- Draw the TUI braille spinner as a 2x4 SVG dot cell stepped by declarative <animate> timelines derived from SPINNER_FRAMES: no JavaScript timer or React render per frame, and it keeps animating under prefers-reduced-motion so an active session never looks stalled - Enlarge the spinner cell and dots so it stays legible next to 14px text - Add a compact ActivityList variant for the mobile More drawer and Repos sheet: one flat list capped at five rows, single-line rows, no group subheadings - Let ActivityList callers own navigation so a row tap navigates once instead of pushing a duplicate history entry - Share the picker keyboard navigation between the session and project tabs and reuse the shared session merge helpers in the sidebar repo groups
This commit is contained in:
1 parent
d8f2fcf29c
commit
8b6251d83b
24 files changed
+858
-787
No files matched your search
@@ -49,6 +49,13 @@ describe('ActivitySettings', () => {
|
||||
expect(screen.getByRole('combobox', { name: 'Recent activity window' })).toHaveTextContent('2 hours')
|
||||
})
|
||||
|
||||
it('shows a stored window that is not a preset option', () => {
|
||||
mockUseSettings({ preferences: { ...basePreferences, activityWindowMinutes: 45 } })
|
||||
render(<ActivitySettings />)
|
||||
|
||||
expect(screen.getByRole('combobox', { name: 'Recent activity window' })).toHaveTextContent('45 minutes')
|
||||
})
|
||||
|
||||
it('saves the chosen window in minutes', async () => {
|
||||
const user = userEvent.setup()
|
||||
const updateSettings = vi.fn()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useSettings } from '@/hooks/useSettings'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||
@@ -8,6 +9,15 @@ export function ActivitySettings() {
|
||||
const { preferences, updateSettings } = useSettings()
|
||||
const activityWindowMinutes = preferences?.activityWindowMinutes ?? DEFAULT_ACTIVITY_WINDOW_MINUTES
|
||||
|
||||
const windowOptions = useMemo(() => {
|
||||
const options: number[] = [...ACTIVITY_WINDOW_MINUTE_OPTIONS]
|
||||
if (!options.includes(activityWindowMinutes)) {
|
||||
options.push(activityWindowMinutes)
|
||||
options.sort((a, b) => a - b)
|
||||
}
|
||||
return options
|
||||
}, [activityWindowMinutes])
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<h2 className="text-lg font-semibold text-foreground">Activity</h2>
|
||||
@@ -27,7 +37,7 @@ export function ActivitySettings() {
|
||||
<SelectValue placeholder="Select a window" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{ACTIVITY_WINDOW_MINUTE_OPTIONS.map((minutes) => (
|
||||
{windowOptions.map((minutes) => (
|
||||
<SelectItem key={minutes} value={String(minutes)}>
|
||||
{formatActivityWindow(minutes)}
|
||||
</SelectItem>
|
||||
|
||||
Reference in new issue
Block a user