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
1 change: 1 addition & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ompweb --no-open # ブラウザ自動起動を無効
## 主な機能

- **リアルタイムチャット**: ローカルの `omp` エージェントとストリーミング対話。
- **キュー削除の確認**: キュー内のフォローアップやステアメッセージをパネルから削除する前に、内容を表示して確認します。OMP 内部ですでにキューに入ったメッセージの配信は取り消しません。
- **セッション管理**: プロジェクトごとに履歴を一覧表示、分岐やフォークにも対応。
- **ライブタスク&サブエージェント**: Todo リストと稼働中サブエージェントの進捗を折りたたみパネルでリアルタイム表示。
- **ファイル閲覧・プレビュー**: チャットと並べてファイルを閲覧、コード・Markdown・画像・音声・PDF をプレビュー。
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ password is stored there in plain text).
## Features

- **Interactive Chat**: Real-time streaming conversation with your local `omp` agent — tool calls, thinking levels, token counts, cost, context gauge, queue controls, and interrupt & retry.
- **Queue Deletion Confirmation**: Preview and confirm before removing queued follow-ups or steered messages from the queue panel. This does not cancel delivery already queued inside OMP.
- **Session Management**: Browse past conversations by project, fork sessions, branch within a session, archive/restore, import session files, and deep-link via URL.
- **Live Plans & Subagents**: Collapsible panels pinned above the composer track live todo phases and running subagents (status, tool, retries, tokens/cost, nested tasks) with transcript dialogs and history recovery.
- **Tool Preset Picker**: Choose the toolset for new sessions in the composer — `none` / `default` (`read,bash,edit,write`) / `full` (all tools including subagents). Persists to localStorage.
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ompweb --no-open # 不自动打开浏览器
## 功能特性

- **实时对话**:与本地 `omp` 智能体进行低延迟流式交互。
- **队列删除确认**:从队列面板移除后续消息或引导消息前,先预览内容并确认。此操作不会取消 OMP 内部已排队消息的发送。
- **会话管理**:按项目浏览历史会话,支持会话分叉与分支回溯。
- **实时任务与子智能体**:可折叠面板实时展示任务清单(todo)与子智能体进度,并支持查看完整转录。
- **文件管理与预览**:与对话并排浏览文件,支持代码、Markdown、图片、音频及 PDF 预览。
Expand Down
35 changes: 33 additions & 2 deletions components/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getSubmitDuringRunBehavior } from "@/lib/composer-prefs";
import type { BuiltinSlashCommandResult, CompactResultInfo, QueuedMessages, SlashCommandInfo } from "@/hooks/useAgentSession";
import type { ActiveGoal, ActivePlan } from "@/lib/web-mode-state";
import { toast } from "@/components/ui/toast";
import { ConfirmDialog } from "@/components/ui/field";
import { useDictation } from "@/hooks/useDictation";
import type { GenerationSpeedInfo, SessionStatsInfo } from "@/lib/pi-types";
import { formatCompactNumber, formatPercent } from "@/lib/format";
Expand Down Expand Up @@ -267,6 +268,11 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
[locale],
);
const [value, setValue] = useState(() => (draftKey ? getDraft(draftKey)?.value ?? "" : ""));
const [queuedDeleteTarget, setQueuedDeleteTarget] = useState<{
text: string;
draftKey: string | undefined;
queue: Props["queuedMessages"];
} | null>(null);
const [modelDropdownOpen, setModelDropdownOpen] = useState(false);
const [thinkingDropdownOpen, setThinkingDropdownOpen] = useState(false);
const [contextOpen, setContextOpen] = useState(false);
Expand Down Expand Up @@ -596,6 +602,7 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
// validation banner along with the old draft.
attachmentRevisionRef.current += 1;
setAttachError(null);
setQueuedDeleteTarget(null);

if (previousDraftKey) {
setDraft(previousDraftKey, {
Expand Down Expand Up @@ -1017,6 +1024,9 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
const queuedCount = queuedEntries.length;

const [queueExpanded, setQueueExpanded] = useState(false);
// Invalidate confirmation if delivery or navigation changes the queue.
const activeDeleteTarget = queuedDeleteTarget?.draftKey === draftKey
&& queuedDeleteTarget?.queue === queuedMessages ? queuedDeleteTarget : null;

const handleItemEdit = useCallback((text: string) => {
onRemoveQueuedMessage?.(text);
Expand All @@ -1034,8 +1044,8 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
}, [onRemoveQueuedMessage]);

const handleItemDelete = useCallback((text: string) => {
onRemoveQueuedMessage?.(text);
}, [onRemoveQueuedMessage]);
setQueuedDeleteTarget({ text, draftKey, queue: queuedMessages });
}, [draftKey, queuedMessages]);

const handleItemSteer = useCallback((entry: { kind: "follow-up" | "steer"; text: string }) => {
if (entry.kind === "follow-up") {
Expand Down Expand Up @@ -1440,6 +1450,27 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
padding: "0 16px calc(8px + env(safe-area-inset-bottom))",
}}
>
<ConfirmDialog
open={activeDeleteTarget !== null}
onOpenChange={(open) => { if (!open) setQueuedDeleteTarget(null); }}
title={t("chatInput.queuedDeleteTitle")}
description={(
<>
{t("chatInput.queuedDeleteConfirmBody")}
<span style={{ display: "block", marginTop: 12, maxHeight: 180, overflowY: "auto", whiteSpace: "pre-wrap", overflowWrap: "anywhere" }}>
{activeDeleteTarget?.text}
</span>
</>
)}
confirmLabel={t("chatInput.queuedDelete")}
cancelLabel={t("chatInput.cancel")}
danger
onConfirm={() => {
if (!activeDeleteTarget) return;
setQueuedDeleteTarget(null);
onRemoveQueuedMessage?.(activeDeleteTarget.text);
}}
/>
{/* Hidden file input */}
<input
ref={fileInputRef}
Expand Down
2 changes: 2 additions & 0 deletions lib/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@
"chatInput.fastLabel": "Fast",
"chatInput.queuedDelete": "Delete",
"chatInput.queuedDeleteTitle": "Remove this queued message",
"chatInput.queuedDeleteConfirmBody": "Remove this message from the queue panel? This cannot be undone here. The agent may still deliver a message it has already queued.",
"chatInput.cancel": "Cancel",
"chatInput.queuedEdit": "Edit",
"chatInput.queuedEditTitle": "Edit this queued message",
"chatInput.queuedFollowUp": "Queued follow-up",
Expand Down
2 changes: 2 additions & 0 deletions lib/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@
"chatInput.fastLabel": "高速",
"chatInput.queuedDelete": "削除",
"chatInput.queuedDeleteTitle": "このキューされたメッセージを削除",
"chatInput.queuedDeleteConfirmBody": "このメッセージをキューパネルから削除しますか?ここでの削除は取り消せません。エージェントがすでにキューに保持しているメッセージは、引き続き配信される場合があります。",
"chatInput.cancel": "キャンセル",
"chatInput.queuedEdit": "編集",
"chatInput.queuedEditTitle": "このキューされたメッセージを編集",
"chatInput.queuedFollowUp": "キューされたフォローアップ",
Expand Down
2 changes: 2 additions & 0 deletions lib/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@
"chatInput.fastLabel": "快速",
"chatInput.queuedDelete": "删除",
"chatInput.queuedDeleteTitle": "移除这条已排队消息",
"chatInput.queuedDeleteConfirmBody": "要从队列面板移除这条消息吗?此处的删除无法撤销。智能体仍可能发送其已加入队列的消息。",
"chatInput.cancel": "取消",
"chatInput.queuedEdit": "编辑",
"chatInput.queuedEditTitle": "编辑这条已排队消息",
"chatInput.queuedFollowUp": "已排队的后续消息",
Expand Down