Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(cos): prevent mobile UI freeze when expanding completed agent output

Adam Eivy35cb9d3d6940
diff --git a/client/src/components/cos/OutputBlocks.jsx b/client/src/components/cos/OutputBlocks.jsx
index d9fc8bd7a5..56afe9007f 100644
--- a/client/src/components/cos/OutputBlocks.jsx
+++ b/client/src/components/cos/OutputBlocks.jsx
@@ -1,10 +1,32 @@
-import { useMemo } from 'react';
+import { useMemo, useState } from 'react';
import MarkdownOutput from './MarkdownOutput';
export const isToolLine = (line) =>
line.startsWith('🔧') || line.startsWith(' →') || line.startsWith(' ↳') || line.startsWith('[stderr]');
+const INITIAL_BLOCKS = 80;
+const LOAD_MORE_BLOCKS = 120;
+
+function renderBlock(block, i) {
+ if (block.type === 'tool') {
+ const line = block.line;
+ if (line.startsWith('🔧')) {
+ return <div key={i} className="py-0.5 text-xs font-mono text-port-accent break-all">{line}</div>;
+ }
+ if (line.startsWith(' →')) {
+ return <div key={i} className="py-0.5 text-xs font-mono text-gray-500 pl-4 break-all">{line.substring(4)}</div>;
+ }
+ if (line.startsWith(' ↳')) {
+ return <div key={i} className="py-0.5 text-xs font-mono text-gray-600 pl-4 break-all">{line.substring(4)}</div>;
+ }
+ return <div key={i} className="py-0.5 text-xs font-mono text-yellow-500 break-all">{line}</div>;
+ }
+ return <MarkdownOutput key={i} content={block.content} />;
+}
+
export default function OutputBlocks({ output }) {
+ const [visibleCount, setVisibleCount] = useState(INITIAL_BLOCKS);
+
// Group consecutive lines: tool lines render as monospace, content lines as markdown
const blocks = useMemo(() => {
const result = [];
@@ -30,24 +52,19 @@ export default function OutputBlocks({ output }) {
return result;
}, [output]);
+ const hasMore = blocks.length > visibleCount;
+
return (
<div className="space-y-0.5 min-w-0 overflow-hidden">
- {blocks.map((block, i) => {
- if (block.type === 'tool') {
- const line = block.line;
- if (line.startsWith('🔧')) {
- return <div key={i} className="py-0.5 text-xs font-mono text-port-accent break-all">{line}</div>;
- }
- if (line.startsWith(' →')) {
- return <div key={i} className="py-0.5 text-xs font-mono text-gray-500 pl-4 break-all">{line.substring(4)}</div>;
- }
- if (line.startsWith(' ↳')) {
- return <div key={i} className="py-0.5 text-xs font-mono text-gray-600 pl-4 break-all">{line.substring(4)}</div>;
- }
- return <div key={i} className="py-0.5 text-xs font-mono text-yellow-500 break-all">{line}</div>;
- }
- return <MarkdownOutput key={i} content={block.content} />;
- })}
+ {blocks.slice(0, visibleCount).map(renderBlock)}
+ {hasMore && (
+ <button
+ onClick={() => setVisibleCount(prev => prev + LOAD_MORE_BLOCKS)}
+ className="w-full py-2 text-xs text-port-accent hover:text-white bg-port-border/30 hover:bg-port-border/50 rounded transition-colors min-h-[40px]"
+ >
+ Show more ({blocks.length - visibleCount} remaining)
+ </button>
+ )}
</div>
);
}
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index 6bb6245b12..7470ee5633 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -771,7 +771,7 @@ export default function AgentCard({ agent, onKill, onDelete, onResume, completed
{/* Expanded output view */}
{expanded && (
- <div className="border-t border-port-border bg-port-bg/50 p-3 min-w-0 overflow-hidden">
+ <div className="border-t border-port-border bg-port-bg/50 p-3 min-w-0 overflow-y-auto max-h-[60vh]">
{/* Pipeline stage tabs */}
{pipelineStages && (
<div className="flex items-center gap-1 mb-2 overflow-x-auto">
@@ -819,7 +819,7 @@ export default function AgentCard({ agent, onKill, onDelete, onResume, completed
);
}
if (stageOut && stageOut.length > 0) {
- return <OutputBlocks output={stageOut} />;
+ return <OutputBlocks key={activeStage.agentId} output={stageOut} />;
}
return <div className="text-gray-500 text-sm">No output captured for this stage</div>;
}