Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

fix(ui): remember task details state per conversation

CloudTianTian7b647465c1af
diff --git a/src/renderer/modules/conversation-info.js b/src/renderer/modules/conversation-info.js
index 6de6756c..e148adca 100644
--- a/src/renderer/modules/conversation-info.js
+++ b/src/renderer/modules/conversation-info.js
@@ -17,6 +17,8 @@ const ConversationInfo = (() => {
let _cid = null;
let _open = false;
let _activeTab = 'files';
+ // Renderer-session preferences belong to each task, not the shared panel DOM.
+ const _panelStateByCid = new Map();
let _panelResize = null;
let _seq = 0;
let _fileSeq = 0;
@@ -853,8 +855,13 @@ const ConversationInfo = (() => {
}
function bind(cid) {
+ if (_cid) _panelStateByCid.set(_cid, { open: _open, tab: _activeTab });
+ _panelResize?.finish();
_cid = cid || null;
- _open = false;
+ const saved = _cid ? _panelStateByCid.get(_cid) : null;
+ _open = saved?.open || false;
+ _activeTab = saved?.tab || 'files';
+ if (_open) window.VideoReviewPanel?.close();
_expandedDirectoryPaths.clear();
_snapshot = { conversation: null, history: [], files: [], filesTruncated: false, filesCount: 0, filesScanSkipped: false, syncEnabled: false, attachments: [] };
_error = '';
diff --git a/test/e2e/conversation_outputs_e2e_panel.spec.ts b/test/e2e/conversation_outputs_e2e_panel.spec.ts
index e3ca00ec..4c0e3286 100644
--- a/test/e2e/conversation_outputs_e2e_panel.spec.ts
+++ b/test/e2e/conversation_outputs_e2e_panel.spec.ts
@@ -79,6 +79,50 @@ function wavBytes(): Buffer {
test.describe.configure({ timeout: 120_000 });
+test('task details remembers open and closed panels and each selected tab across navigation', async ({ orkas }) => {
+ const page = orkas.page!;
+ const first = (await orkas.invoke<any>('conversations.create', { title: 'Details state first' })).conversation.conversation_id;
+ const second = (await orkas.invoke<any>('conversations.create', { title: 'Details state second' })).conversation.conversation_id;
+ await page.evaluate(() => (window as any).loadConversations());
+ const enter = (cid: string) => page.evaluate(id => (window as any).setView('conversation', id), cid);
+ const panel = page.locator('#conversation-info-panel');
+ const toggle = page.locator('#conversation-info-toggle');
+ const tab = (name: string) => panel.locator(`[data-info-tab="${name}"]`);
+
+ await enter(first);
+ await expect(panel).toBeHidden();
+ await toggle.click();
+ await tab('attachments').click();
+ await enter(second);
+ await expect(panel).toBeHidden();
+ await toggle.click();
+ await expect(tab('files')).toHaveClass(/is-active/);
+ await tab('browser').click();
+ await expect(page.locator('.web-assist-shell')).toBeVisible();
+ await enter(first);
+ await expect(panel).toBeVisible();
+ await expect(tab('attachments')).toHaveClass(/is-active/);
+ await expect(page.locator('.web-assist-shell')).toBeHidden();
+ await page.locator('#conversation-info-close').click();
+ await enter(second);
+ await expect(panel).toBeVisible();
+ await expect(tab('browser')).toHaveClass(/is-active/);
+ await expect(page.locator('.web-assist-shell')).toBeVisible();
+ await enter(first);
+ await expect(panel).toBeHidden();
+ await expect(toggle).toHaveAttribute('aria-expanded', 'false');
+ await toggle.click();
+ await expect(tab('attachments')).toHaveClass(/is-active/);
+ await page.evaluate(() => (window as any).setView('connectors'));
+ await enter(first);
+ await expect(panel).toBeVisible();
+ await expect(tab('attachments')).toHaveClass(/is-active/);
+ await toggle.click();
+ await page.evaluate(() => (window as any).setView('connectors'));
+ await enter(first);
+ await expect(panel).toBeHidden();
+});
+
test('surfaces produced files, outside files, and artifacts for one conversation', async ({ orkas }, testInfo) => {
const page = orkas.page!;
const uid = 'account-e2e';
diff --git a/test/renderer/conversation-info.test.ts b/test/renderer/conversation-info.test.ts
index 188ca48a..c4f9eec7 100644
--- a/test/renderer/conversation-info.test.ts
+++ b/test/renderer/conversation-info.test.ts
@@ -121,6 +121,38 @@ function renderFilesHtml(snapshot: {
}
describe('ConversationInfo files tab', () => {
+ it('restores each task panel visibility and selected tab after switching away and back', async () => {
+ await renderFilesResult({ history: [], files: { items: [] } }, context => {
+ const info = context.window.ConversationInfo;
+ const panel = context.document.getElementById('conversation-info-panel');
+ const body = context.document.getElementById('conversation-info-body');
+ info.openAndSetTab('browser');
+ info.bind('c2');
+ expect(panel.hidden).toBe(true);
+ expect(body.hidden).toBe(false);
+ info.openAndSetTab('attachments');
+ info.bind('c1');
+ expect(panel.hidden).toBe(false);
+ expect(body.hidden).toBe(true);
+ info.close();
+ info.bind('c2');
+ expect(panel.hidden).toBe(false);
+ expect(body.hidden).toBe(false);
+ info.bind('c1');
+ expect(panel.hidden).toBe(true);
+ info.open();
+ expect(body.hidden).toBe(true);
+ info.unbind();
+ expect(panel.hidden).toBe(true);
+ info.bind('c1');
+ expect(panel.hidden).toBe(false);
+ expect(body.hidden).toBe(true);
+ // A same-task view refresh must also preserve visibility.
+ info.bind('c1');
+ expect(panel.hidden).toBe(false);
+ });
+ });
+
it('only reveals a task-scoped browser in the currently displayed and bound task', async () => {
await renderFilesResult({ history: [], files: { items: [] } }, context => {
const info = context.window.ConversationInfo;