mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +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
@@ -4,29 +4,16 @@ import { listRepos } from '@/api/repos'
|
||||
import { sessionQueryOptions, useSessionsAcrossDirectories } from '@/hooks/useOpenCode'
|
||||
import { useSessionPins } from '@/hooks/useSessionPins'
|
||||
import { buildPinnedSessionKeys, buildSessionKey, getSessionKey } from '@/lib/sessionKey'
|
||||
import type { Repo, Session } from '@/api/types'
|
||||
import type { Repo } from '@/api/types'
|
||||
import {
|
||||
SIDEBAR_SESSIONS_PER_REPO,
|
||||
buildSidebarRepoGroups,
|
||||
combineQuerySessions,
|
||||
mergeExtraSessions,
|
||||
selectNavigableRepos,
|
||||
type SidebarRepoGroup,
|
||||
} from '@/components/navigation/sidebar-session-tree'
|
||||
|
||||
const combinePinnedSessions = (results: Array<{ data?: Session }>): Session[] =>
|
||||
results.flatMap((result) => (result.data ? [result.data] : []))
|
||||
|
||||
const mergeSessions = (sessions: Session[], pinnedSessions: Session[]): Session[] => {
|
||||
if (pinnedSessions.length === 0) return sessions
|
||||
const seen = new Set(sessions.map((session) => session.id))
|
||||
const extras: Session[] = []
|
||||
for (const session of pinnedSessions) {
|
||||
if (seen.has(session.id)) continue
|
||||
seen.add(session.id)
|
||||
extras.push(session)
|
||||
}
|
||||
return extras.length === 0 ? sessions : [...sessions, ...extras]
|
||||
}
|
||||
|
||||
export function useSidebarRepoGroups(input: {
|
||||
repos: Repo[]
|
||||
search?: string
|
||||
@@ -56,11 +43,11 @@ export function useSidebarRepoGroups(input: {
|
||||
|
||||
const pinnedSessions = useQueries({
|
||||
queries: missingPins.map((pin) => sessionQueryOptions(pin.sessionId, pin.directory)),
|
||||
combine: combinePinnedSessions,
|
||||
combine: combineQuerySessions,
|
||||
})
|
||||
|
||||
const mergedSessions = useMemo(
|
||||
() => mergeSessions(sessions, pinnedSessions),
|
||||
() => mergeExtraSessions(sessions, pinnedSessions),
|
||||
[sessions, pinnedSessions],
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user