Skip to content

Commit fac27bc

Browse files
committed
WIP
1 parent db8d55e commit fac27bc

14 files changed

Lines changed: 500 additions & 28 deletions

File tree

exec/java-exec/src/main/resources/webapp/src/components/prospector/ToolCallDisplay.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
import { Collapse, Tag } from 'antd';
18+
import { Button, Collapse, Space, Tag } from 'antd';
19+
import { Link } from 'react-router-dom';
1920
import {
2021
CodeOutlined,
2122
DatabaseOutlined,
2223
BarChartOutlined,
2324
DashboardOutlined,
2425
SaveOutlined,
2526
FunctionOutlined,
27+
EyeOutlined,
2628
} from '@ant-design/icons';
2729
import type { ToolCall } from '../../types/ai';
2830
import type { ChatMessage } from '../../types/ai';
@@ -86,14 +88,29 @@ export default function ToolCallDisplay({ toolCalls, toolResults }: ToolCallDisp
8688
<strong>Arguments:</strong>
8789
<pre className="prospector-tool-json">{formatJson(tc.arguments)}</pre>
8890
</div>
89-
{result && (
90-
<div>
91-
<strong>Result:</strong>
92-
<pre className="prospector-tool-json">
93-
{formatJson(result.content || '')}
94-
</pre>
95-
</div>
96-
)}
91+
{result && (() => {
92+
let parsed: Record<string, unknown> | null = null;
93+
try { parsed = JSON.parse(result.content || ''); } catch { /* ignore */ }
94+
const viewPath = parsed?.viewPath as string | undefined;
95+
const hasError = !!parsed?.error;
96+
return (
97+
<div>
98+
<strong>Result:</strong>
99+
<pre className="prospector-tool-json">
100+
{formatJson(result.content || '')}
101+
</pre>
102+
{viewPath && !hasError && (
103+
<Space style={{ marginTop: 8 }}>
104+
<Link to={viewPath}>
105+
<Button size="small" type="primary" icon={<EyeOutlined />}>
106+
View {tc.name === 'create_dashboard' ? 'Dashboards' : 'Visualizations'}
107+
</Button>
108+
</Link>
109+
</Space>
110+
)}
111+
</div>
112+
);
113+
})()}
97114
</div>
98115
),
99116
};

exec/java-exec/src/main/resources/webapp/src/components/results/ResultsGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default function ResultsGrid({
9393
headerName: col,
9494
sortable: true,
9595
resizable: true,
96-
minWidth: 100,
96+
minWidth: Math.max(100, col.length * 9 + 60),
9797
filter: config.filter,
9898
filterParams: config.filterParams,
9999
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)