Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(web): remove the agents right panel #12835

Mergedmaria-rcksmerged 2 commits intot3code/codex-turn-mapping fromrefs/pull/12835/headmerged by maria-rcks View on GitHub

Showing 10 changed files with 60 additions and 22 deletions (loading 7).

x
0 of 10 viewed, 10 left
57 additions and 0 deletionsapps/web/src/components/chat/AgentElapsed.tsxAdded
View file
@@ -0,0 +1,57 @@
+import type { RuntimeSubagent } from "@t3tools/client-runtime/state/subagentRuntime";
+import { useEffect, useRef } from "react";
+​
+function formatElapsedSeconds(totalSeconds: number): string {
+ const seconds = Math.max(0, Math.floor(totalSeconds));
+ const minutes = Math.floor(seconds / 60);
+ if (minutes === 0) {
+ return `${seconds}s`;
+ }
+ const hours = Math.floor(minutes / 60);
+ if (hours === 0) {
+ return `${minutes}m ${String(seconds % 60).padStart(2, "0")}s`;
+ }
+ return `${hours}h ${String(minutes % 60).padStart(2, "0")}m`;
+}
+​
+function elapsedBetween(startedAt: string, endIso: string | null): string {
+ const start = Date.parse(startedAt);
+ const end = endIso ? Date.parse(endIso) : Date.now();
+ if (Number.isNaN(start) || Number.isNaN(end)) {
+ return "";
+ }
+ return formatElapsedSeconds((end - start) / 1000);
+}
+​
+/**
+ * Elapsed time for the current activation. Live agents self-tick via DOM
+ * writes (zero React commits per tick); settled agents freeze at completedAt.
+ */
+export function AgentElapsed({ agent }: { agent: RuntimeSubagent }) {