feat(workbench): redesign investigation reports and diagrams
This commit is contained in:
@@ -42,6 +42,7 @@ import { MobileWorkbenchSheet } from "./components/mobile-workbench-sheet";
|
||||
import { FeaturePopover } from "./components/feature-popover";
|
||||
import { ScheduledConditionFeed } from "./components/scheduled-condition-feed";
|
||||
import { TaskConversationReview } from "./components/task-conversation-review";
|
||||
import type { InvestigationDiscussion } from "./api/investigation-report";
|
||||
import { WorkbenchAgentPanels } from "./components/workbench-agent-panels";
|
||||
import { OperationalTimeline } from "./operational-timeline/operational-timeline";
|
||||
import {
|
||||
@@ -144,6 +145,7 @@ export function MapWorkbenchPage({
|
||||
const [conditionFocusRequest, setConditionFocusRequest] = useState<{
|
||||
conditionId: string;
|
||||
requestId: number;
|
||||
actionId?: string | null;
|
||||
} | null>(null);
|
||||
const [activeBaseLayerId, setActiveBaseLayerId] = useState(
|
||||
hasMapboxToken ? "mapbox-light" : hasTiandituToken ? "tianditu-vector" : "none"
|
||||
@@ -766,13 +768,9 @@ export function MapWorkbenchPage({
|
||||
}
|
||||
|
||||
function handleSelectAlert(alert: WorkbenchAlert) {
|
||||
if (alert.id.startsWith("operational-task-notification:")) {
|
||||
const notificationId = alert.id.slice("operational-task-notification:".length);
|
||||
const notification = operationalTasks.notifications.find((item) => item.notification_id === notificationId);
|
||||
if (notification?.status === "unread") {
|
||||
void operationalTasks.acknowledgeNotification(notificationId, notification.version);
|
||||
}
|
||||
}
|
||||
const notificationId = alert.id.startsWith("operational-task-notification:")
|
||||
? alert.id.slice("operational-task-notification:".length) : null;
|
||||
const notification = operationalTasks.notifications.find((item) => item.notification_id === notificationId);
|
||||
const conditionId = alert.conditionId ?? getScheduledConditionIdFromAlertId(alert.id);
|
||||
if (conditionId) {
|
||||
const condition = scheduledConditions.find((item) => item.id === conditionId);
|
||||
@@ -788,8 +786,12 @@ export function MapWorkbenchPage({
|
||||
openConditionWorkspaceForViewport();
|
||||
setConditionFocusRequest((current) => ({
|
||||
conditionId,
|
||||
requestId: (current?.requestId ?? 0) + 1
|
||||
requestId: (current?.requestId ?? 0) + 1,
|
||||
actionId: notification?.subject_type === "action" ? notification.subject_id : null
|
||||
}));
|
||||
if (notification?.status === "unread") {
|
||||
void operationalTasks.acknowledgeNotification(notification.notification_id, notification.version);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -871,9 +873,10 @@ export function MapWorkbenchPage({
|
||||
await agent.loadHistorySession(sessionId);
|
||||
}
|
||||
|
||||
async function handleOpenTaskCollaboration(taskId: string) {
|
||||
async function handleOpenTaskCollaboration(taskId: string, discussion?: InvestigationDiscussion) {
|
||||
mapController.clearScadaAnalysis();
|
||||
await agent.openTaskCollaboration(taskId);
|
||||
await agent.openTaskCollaboration(taskId, discussion?.context);
|
||||
if (discussion?.prompt) await agent.submitPrompt(discussion.prompt);
|
||||
}
|
||||
|
||||
async function handleDeleteAgentHistorySession(sessionId: string) {
|
||||
@@ -1330,6 +1333,8 @@ export function MapWorkbenchPage({
|
||||
onTaskReconcile={operationalTasks.reconcileAction}
|
||||
onLoadTaskEvidenceSnapshot={operationalTasks.loadEvidenceSnapshot}
|
||||
onTaskRefresh={operationalTasks.refresh}
|
||||
onLoadTaskReports={operationalTasks.loadReports}
|
||||
onReportViewed={operationalTasks.markReportRead}
|
||||
onRefresh={workbenchSync.refresh}
|
||||
/>
|
||||
</div>
|
||||
@@ -1480,6 +1485,8 @@ export function MapWorkbenchPage({
|
||||
onTaskReconcile={operationalTasks.reconcileAction}
|
||||
onLoadTaskEvidenceSnapshot={operationalTasks.loadEvidenceSnapshot}
|
||||
onTaskRefresh={operationalTasks.refresh}
|
||||
onLoadTaskReports={operationalTasks.loadReports}
|
||||
onReportViewed={operationalTasks.markReportRead}
|
||||
onRefresh={workbenchSync.refresh}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user