mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
docs: document the OpenCode client migration surfaces (OM-179)
Adds JSDoc comments to the functions this branch adds or changes, so the touched-code docstring coverage clears the review threshold. Comments only; no code, formatting or import changes.
This commit is contained in:
1 parent
64e87ba1ea
commit
6297403a41
41 files changed
+691
No files matched your search
@@ -322,6 +322,11 @@ export function selectActiveSessionDirectoriesKey(
|
||||
|
||||
const EventContext = createContext<EventContextValue | null>(null)
|
||||
|
||||
/**
|
||||
* Provides stream-derived state to the page tree — SSH host key prompts, permission and form
|
||||
* queues, stream health, and session-to-repo lookup — and routes stream events, status changes,
|
||||
* and resyncs into React Query, session status, and running-shell state.
|
||||
*/
|
||||
export function EventProvider({ children }: { children: React.ReactNode }) {
|
||||
const queryClient = useQueryClient()
|
||||
const navigate = useNavigate()
|
||||
@@ -1050,6 +1055,11 @@ export function EventProvider({ children }: { children: React.ReactNode }) {
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated) return
|
||||
|
||||
/**
|
||||
* Routes one stream event by type into the session status, permission, form, shell and cache
|
||||
* stores. Goal events are offered to `applySessionGoalEvent` first and skip the switch when it
|
||||
* consumes them.
|
||||
*/
|
||||
const handleSSEMessage = (event: OpenCodeStreamEvent) => {
|
||||
const serverId = event.serverId ?? LOCAL_OPENCODE_SERVER_ID
|
||||
|
||||
@@ -1258,6 +1268,11 @@ export function EventProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Repairs caches after the stream reports missed events: a remote server reconciles its own
|
||||
* directory activity and list caches, while the local server also refreshes session statuses,
|
||||
* running shells, and pending actions.
|
||||
*/
|
||||
const handleResync = (subscribedDirectories: string[], serverId?: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: [SESSION_GOAL_QUERY_ROOT] })
|
||||
if (serverId && !isLocalOpenCodeServer(serverId)) {
|
||||
|
||||
Reference in new issue
Block a user