diff --git a/src/main/index.ts b/src/main/index.ts
index 0ff6540..475ea8e 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -47,6 +47,7 @@ function createWindow(): void {
}
app.whenReady().then(async () => {
+ app.setName("Agent Trace");
const userDataPath = app.getPath("userData");
const updateService = createUpdateService({
currentVersion: app.getVersion(),
diff --git a/src/main/ipc/register-ipc.ts b/src/main/ipc/register-ipc.ts
index 57edf78..bbd8faa 100644
--- a/src/main/ipc/register-ipc.ts
+++ b/src/main/ipc/register-ipc.ts
@@ -87,6 +87,12 @@ export function registerIpcHandlers(deps: IpcDependencies): () => void {
}
await deps.proxyManager.startProfile(profileId);
+
+ const profiles = deps.profileStore.getProfiles();
+ const updated = profiles.map((p) => p.id === profileId ? { ...p, autoStart: true } : p);
+ deps.profileStore.saveProfiles(updated);
+
+ broadcast(deps.getMainWindow, IPC.PROFILES_CHANGED, { profiles: updated });
broadcast(deps.getMainWindow, IPC.PROFILE_STATUS_CHANGED, {
statuses: deps.proxyManager.getStatuses(),
});
@@ -98,6 +104,12 @@ export function registerIpcHandlers(deps: IpcDependencies): () => void {
}
await deps.proxyManager.stopProfile(profileId);
+
+ const profiles = deps.profileStore.getProfiles();
+ const updated = profiles.map((p) => p.id === profileId ? { ...p, autoStart: false } : p);
+ deps.profileStore.saveProfiles(updated);
+
+ broadcast(deps.getMainWindow, IPC.PROFILES_CHANGED, { profiles: updated });
broadcast(deps.getMainWindow, IPC.PROFILE_STATUS_CHANGED, {
statuses: deps.proxyManager.getStatuses(),
});
diff --git a/src/preload/index.ts b/src/preload/index.ts
index efce7ee..d4f4c2d 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -4,6 +4,7 @@ import type {
ConnectionProfile,
ExchangeDetailVM,
ProfileStatusChangedEvent,
+ ProfilesChangedEvent,
SessionListFilter,
SessionListItemVM,
SessionTraceVM,
@@ -94,6 +95,17 @@ export const electronAPI: ElectronAPI = {
ipcRenderer.removeListener(IPC.PROFILE_STATUS_CHANGED, handler);
},
+ onProfilesChanged: (
+ cb: (payload: ProfilesChangedEvent) => void,
+ ): (() => void) => {
+ const handler = (
+ _e: Electron.IpcRendererEvent,
+ payload: ProfilesChangedEvent,
+ ) => cb(payload);
+ ipcRenderer.on(IPC.PROFILES_CHANGED, handler);
+ return () => ipcRenderer.removeListener(IPC.PROFILES_CHANGED, handler);
+ },
+
onUpdateStateChanged: (cb: (state: UpdateState) => void): (() => void) => {
const handler = (_e: Electron.IpcRendererEvent, state: UpdateState) =>
cb(state);
diff --git a/src/renderer/src/components/context-chip.tsx b/src/renderer/src/components/context-chip.tsx
index 8d82f0b..a9f3f81 100644
--- a/src/renderer/src/components/context-chip.tsx
+++ b/src/renderer/src/components/context-chip.tsx
@@ -93,7 +93,7 @@ export function ContextChip({
return (
setExpanded(!expanded)}
>
diff --git a/src/renderer/src/components/conversation-view.tsx b/src/renderer/src/components/conversation-view.tsx
index 6c85754..de5a63b 100644
--- a/src/renderer/src/components/conversation-view.tsx
+++ b/src/renderer/src/components/conversation-view.tsx
@@ -4,6 +4,7 @@ import { ArrowUp, ArrowDown } from "lucide-react";
import { cn } from "../lib/utils";
import type { SessionTimeline } from "../../../shared/contracts";
import { useTraceStore } from "../stores/trace-store";
+import { useSessionStore } from "../stores/session-store";
const SCROLL_THRESHOLD = 120;
@@ -15,6 +16,7 @@ interface ConversationViewProps {
export function ConversationView({ timeline, rawMode }: ConversationViewProps) {
const storeTrace = useTraceStore((state) => state.trace);
const storeRawMode = useTraceStore((state) => state.rawMode);
+ const selectedSessionId = useSessionStore((s) => s.selectedSessionId);
const activeTimeline = timeline ?? storeTrace?.timeline ?? { messages: [] };
const activeRawMode = rawMode ?? storeRawMode;
const messages = activeTimeline.messages;
@@ -24,16 +26,68 @@ export function ConversationView({ timeline, rawMode }: ConversationViewProps) {
const [showBottom, setShowBottom] = useState(false);
const [hasNew, setHasNew] = useState(false);
const prevCountRef = useRef(messages.length);
+ const scrollCache = useRef