From b0afa2de76a078bc93df9f831427f31c95767fe0 Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Thu, 12 Nov 2026 12:57:29 +0100 Subject: [PATCH 1/2] feat(sidebar): mark sessions waiting for user input --- CHANGELOG.md | 1 + components/SessionSidebar-helpers.ts | 2 ++ components/SessionSidebar-rows.tsx | 21 ++++++++++++++- components/SessionSidebar.tsx | 2 ++ lib/i18n/locales/en.json | 1 + lib/i18n/locales/ja.json | 1 + lib/i18n/locales/zh-CN.json | 1 + lib/rpc-manager.test.mjs | 40 ++++++++++++++++++++++++++++ lib/rpc-manager.ts | 16 +++++++++-- 9 files changed, 82 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89dc4917e..ca35cda99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f - **Traditional Chinese (`zh-TW`) interface language.** Select Traditional Chinese (繁體中文) in the top-bar language menu. On compact layouts, open **More controls** first. Alternatively, let omp-web pick it automatically when the browser language is `zh-TW`, `zh-HK`, `zh-MO`, or `zh-Hant`. Localized Web Push notifications and a Traditional Chinese README (`README.zh-TW.md`) are included. - **Several web apps can share one host daemon and the same live sessions.** Link additional servers with `ompweb host login --add --url ` (token from stdin). Prompts, tool progress, results and dialogs stay synchronized, and restarting one web app leaves the other connected to the same omp process. Link protocol v7 moves session startup, idle cleanup and interrupted-run recovery into the host; older links remain supported without sharing their processes. Schedule the first daemon upgrade while its host is quiescent. - **Sidebar marks sessions with an unsent draft.** A session whose composer still holds text or attachments shows a small pencil beside its title, so a half-written message is easy to find again. The mark follows this browser tab's drafts. +- **Sidebar marks sessions waiting for your input.** A session with an open question, confirmation or other blocking dialog shows a small question-bubble icon beside its title, next to the unsent-draft pencil. The mark clears as soon as the dialog is answered, cancelled or expires, in every open browser. - **Identify untagged builds from the logo.** Clicking or tapping the ompweb logo still reveals the version; builds made from an untagged Git commit also show its full hash and commit date (`YYYY-MM-DD`). Builds made on a tag keep the version-only display. The metadata is embedded in the browser bundle, so installed packages and binaries do not need Git. - **Workspace file APIs run on the owning host.** Directory listings, file metadata and previews, downloads, file search and referenced shell output go through that machine's daemon, including This machine. File downloads stream in bounded chunks rather than being limited by the host link's per-result size. A stopped or older daemon reports unavailable or unsupported instead of reading a path on the web server. - **File tabs keep their owning workspace.** Files with the same path on different hosts open in separate tabs. Switching chats does not redirect a tab's reads, Markdown links, images or downloads to the new host. Explorer and composer file suggestions follow the selected host, and confirming an agent's file-open request keeps that request's source host. Mention and reveal actions are disabled while the active chat belongs to another host. diff --git a/components/SessionSidebar-helpers.ts b/components/SessionSidebar-helpers.ts index 30a698270..2c1e91bd2 100644 --- a/components/SessionSidebar-helpers.ts +++ b/components/SessionSidebar-helpers.ts @@ -213,6 +213,8 @@ interface LivePlace { poolId?: string; projectId?: string; projectKey?: string; + /** Running entries only: a blocking dialog waits for the user. */ + awaitingInput?: boolean; } /** Where a live session the session list lacks gets its placeholder row: the diff --git a/components/SessionSidebar-rows.tsx b/components/SessionSidebar-rows.tsx index e5f7f9f3d..6b14c3ebd 100644 --- a/components/SessionSidebar-rows.tsx +++ b/components/SessionSidebar-rows.tsx @@ -3,7 +3,7 @@ import { memo, useCallback, useId, useRef, useState, useSyncExternalStore, type ReactNode } from "react"; import type { AgentMessage, ExitedRpcSession, ManagedProject, ProjectLaunchConfig, SessionInfo } from "@/lib/types"; import { formatExitedSessionNotice, useI18n } from "@/lib/i18n"; -import { ChevronDown, ChevronRight, Folder, GitBranch, MoreHorizontal, Pencil, Pin, Plus } from "lucide-react"; +import { ChevronDown, ChevronRight, Folder, GitBranch, MessageCircleQuestion, MoreHorizontal, Pencil, Pin, Plus } from "lucide-react"; import { Tooltip } from "./ui/primitives"; import { ConfirmDialog } from "./ui/field"; import { copyText } from "@/lib/clipboard"; @@ -101,6 +101,7 @@ interface ProjectRowProps { hiddenCount: number; selectedSessionId: string | null; runningSessionIds: Set; + awaitingInputIds: Set; unreadSessionIds: Set; recentlyCompletedIds?: Set; exitedSessions: Map; @@ -140,6 +141,7 @@ function ProjectRow({ hiddenCount, selectedSessionId, runningSessionIds, + awaitingInputIds, unreadSessionIds, recentlyCompletedIds, exitedSessions, @@ -482,6 +484,7 @@ function ProjectRow({ node={node} selectedSessionId={selectedSessionId} runningSessionIds={runningSessionIds} + awaitingInputIds={awaitingInputIds} unreadSessionIds={unreadSessionIds} exitedSessions={exitedSessions} recentlyCompletedIds={recentlyCompletedIds} @@ -535,6 +538,7 @@ const SessionTreeItem = memo(function SessionTreeItem({ node, selectedSessionId, runningSessionIds, + awaitingInputIds, unreadSessionIds, exitedSessions, recentlyCompletedIds, @@ -549,6 +553,7 @@ const SessionTreeItem = memo(function SessionTreeItem({ node: SessionTreeNode; selectedSessionId: string | null; runningSessionIds: Set; + awaitingInputIds: Set; unreadSessionIds: Set; exitedSessions: Map; recentlyCompletedIds?: Set; @@ -570,6 +575,7 @@ const SessionTreeItem = memo(function SessionTreeItem({ // check then never re-renders unless this row's flags actually changed. const isSelected = sessionId === selectedSessionId; const isRunning = runningSessionIds.has(sessionId); + const isAwaitingInput = awaitingInputIds.has(sessionId); const isUnread = unreadSessionIds.has(sessionId); const isRecentlyCompleted = !isRunning && (recentlyCompletedIds?.has(sessionId) ?? false); const exited = exitedSessions.get(sessionId); @@ -610,6 +616,7 @@ const SessionTreeItem = memo(function SessionTreeItem({ session={node.session} isSelected={isSelected} isRunning={isRunning} + isAwaitingInput={isAwaitingInput} isUnread={isUnread} exited={exited} isRecentlyCompleted={isRecentlyCompleted} @@ -636,6 +643,7 @@ const SessionTreeItem = memo(function SessionTreeItem({ node={child} selectedSessionId={selectedSessionId} runningSessionIds={runningSessionIds} + awaitingInputIds={awaitingInputIds} unreadSessionIds={unreadSessionIds} exitedSessions={exitedSessions} recentlyCompletedIds={recentlyCompletedIds} @@ -664,6 +672,10 @@ const SessionTreeItem = memo(function SessionTreeItem({ const id = prev.node.session.id; if (prev.runningSessionIds.has(id) !== next.runningSessionIds.has(id)) return false; } + if (prev.awaitingInputIds !== next.awaitingInputIds) { + const id = prev.node.session.id; + if (prev.awaitingInputIds.has(id) !== next.awaitingInputIds.has(id)) return false; + } if (prev.recentlyCompletedIds !== next.recentlyCompletedIds) { const id = prev.node.session.id; if ((prev.recentlyCompletedIds?.has(id) ?? false) !== (next.recentlyCompletedIds?.has(id) ?? false)) return false; @@ -685,6 +697,7 @@ const SessionItem = memo(function SessionItem({ session, isSelected, isRunning, + isAwaitingInput, isUnread, exited, isRecentlyCompleted, @@ -702,6 +715,7 @@ const SessionItem = memo(function SessionItem({ session: SessionInfo; isSelected: boolean; isRunning?: boolean; + isAwaitingInput?: boolean; isUnread?: boolean; exited?: ExitedRpcSession; isRecentlyCompleted?: boolean; @@ -882,6 +896,11 @@ const SessionItem = memo(function SessionItem({ {title} + {isAwaitingInput && ( + + + )} {hasUnsentDraft && (