authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-11 18:08:16-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-11 18:08:16-08:00
loge0df5d5b58aa01accf4b722b9ce4450e6917cd5d
tree6a536ffce51a97f4bf9b4557fc23bcb8ffd7a8a5
parent3697765f4d3402a760a03d0538eac4335daaca8c

Update status bar actions state


1 files changed, 1 insertions(+), 41 deletions(-)

apps/web/src/components/ChatView.tsx+1-41
......@@ -1,6 +1,5 @@
11import {
22 PROVIDER_SEND_TURN_MAX_INPUT_CHARS,
3 type GitRunStackedActionResult,
43 type GitStackedAction,
54 type GitStatusResult,
65 type ProviderApprovalDecision,
......@@ -137,35 +136,6 @@ function derivePendingApprovals(events: ProviderEvent[]): PendingApprovalCard[]
137136 return Array.from(pending.values());
138137}
139138
140function summarizeGitActionResult(result: GitRunStackedActionResult): string {
141 const parts: string[] = [];
142
143 if (result.commit.status === "created") {
144 parts.push(`Committed: ${result.commit.subject ?? "changes saved"}.`);
145 } else {
146 parts.push("No local changes to commit.");
147 }
148
149 if (result.push.status === "pushed") {
150 const upstream = result.push.upstreamBranch;
151 parts.push(
152 upstream ? `Pushed to ${upstream}.` : "Pushed to remote branch.",
153 );
154 } else if (result.push.status === "skipped_up_to_date") {
155 parts.push("Push skipped: branch already up to date.");
156 }
157
158 if (result.pr.status === "created") {
159 parts.push(result.pr.url ? `PR created: ${result.pr.url}` : "PR created.");
160 } else if (result.pr.status === "opened_existing") {
161 parts.push(
162 result.pr.url ? `Opened existing PR: ${result.pr.url}` : "Opened existing PR.",
163 );
164 }
165
166 return parts.join(" ");
167}
168
169139export default function ChatView() {
170140 const { state, dispatch } = useStore();
171141 const api = useMemo(() => readNativeApi(), []);
......@@ -177,7 +147,6 @@ export default function ChatView() {
177147 const [isGitMenuOpen, setIsGitMenuOpen] = useState(false);
178148 const [isGitActionRunning, setIsGitActionRunning] = useState(false);
179149 const [gitStatus, setGitStatus] = useState<GitStatusResult | null>(null);
180 const [gitActionNotice, setGitActionNotice] = useState<string | null>(null);
181150 const [gitActionError, setGitActionError] = useState<string | null>(null);
182151 const [lastEditor, setLastEditor] = useState<EditorId>(() => {
183152 const stored = localStorage.getItem(LAST_EDITOR_KEY);
......@@ -391,13 +360,11 @@ export default function ChatView() {
391360 setIsGitMenuOpen(false);
392361 setIsGitActionRunning(true);
393362 setGitActionError(null);
394 setGitActionNotice(null);
395363 try {
396 const result = await api.git.runStackedAction({
364 await api.git.runStackedAction({
397365 cwd: actionCwd,
398366 action,
399367 });
400 setGitActionNotice(summarizeGitActionResult(result));
401368 } catch (error) {
402369 setGitActionError(
403370 error instanceof Error ? error.message : "Git action failed.",
......@@ -462,7 +429,6 @@ export default function ChatView() {
462429 const activeWorktreePath = activeThread?.worktreePath;
463430
464431 useEffect(() => {
465 setGitActionNotice(null);
466432 setGitActionError(null);
467433 }, [activeProject?.id, activeWorktreePath]);
468434
......@@ -933,12 +899,6 @@ export default function ChatView() {
933899 </div>
934900 )}
935901
936 {gitActionNotice && (
937 <div className="mx-4 mt-3 rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs text-emerald-800 dark:border-emerald-400/20 dark:bg-emerald-500/[0.08] dark:text-emerald-100">
938 {gitActionNotice}
939 </div>
940 )}
941
942902 {pendingApprovals.length > 0 && (
943903 <div className="mx-4 mt-3 space-y-2">
944904 {pendingApprovals.map((approval) => {