Skip to content

Comments

Split init into separate queries and simplify tasks panel#804

Open
EhabY wants to merge 1 commit intomainfrom
refactor-tasks-webview
Open

Split init into separate queries and simplify tasks panel#804
EhabY wants to merge 1 commit intomainfrom
refactor-tasks-webview

Conversation

@EhabY
Copy link
Collaborator

@EhabY EhabY commented Feb 19, 2026

  • Replace InitResponse with separate getTasks and getTemplates queries
    with independent poll intervals (10s tasks, 5min templates)
  • Remove extension-side template cache in favor of React Query staleTime
  • Add resume button to TaskMessageInput for paused tasks
  • Reject message sends to paused tasks instead of auto-starting workspace
  • Extract TasksPanel component and usePersistedState hook from App
  • Centralize query keys in config.ts
  • Rename TasksPanel to TasksPanelProvider on the extension side
  • Add refresh bar indicator for initial load and user-triggered refresh

@EhabY EhabY self-assigned this Feb 19, 2026
@EhabY EhabY force-pushed the refactor-tasks-webview branch from 2b6a923 to 0391a4b Compare February 19, 2026 12:24
@EhabY EhabY force-pushed the add-startup-logs-in-task-detail-view branch from aeccdf8 to f93eb37 Compare February 19, 2026 12:33
Base automatically changed from add-startup-logs-in-task-detail-view to main February 19, 2026 14:01
@EhabY EhabY force-pushed the refactor-tasks-webview branch from 0391a4b to adad103 Compare February 19, 2026 14:02
- Replace InitResponse with separate getTasks and getTemplates queries
  with independent poll intervals (10s tasks, 5min templates)
- Remove extension-side template cache in favor of React Query staleTime
- Add resume button to TaskMessageInput for paused tasks
- Reject message sends to paused tasks instead of auto-starting workspace
- Extract TasksPanel component and usePersistedState hook from App
- Centralize query keys in config.ts
- Rename TasksPanel to TasksPanelProvider on the extension side
- Add refresh bar indicator for initial load and user-triggered refresh
@EhabY EhabY force-pushed the refactor-tasks-webview branch from adad103 to 1bd2ac7 Compare February 19, 2026 16:13
@mafredri mafredri self-requested a review February 20, 2026 07:51
createExpanded: createOpen,
historyExpanded: historyOpen,
});
}, [persisted, tasks, templates, createOpen, historyOpen]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you pull persisted out and just operate on save?

const { save } = persisted;

Comment on lines +50 to +53
const { onShowCreateForm } = useTasksApi();
useEffect(() => {
return onShowCreateForm(() => setCreateOpen(true));
}, [onShowCreateForm, setCreateOpen]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternative way without deps?

const api = useTasksApi();
useEffect(() => {
    return api.onShowCreateForm(() => setCreateOpen(true));
}, []);


useEffect(() => {
if (hasInitialData) void refreshAll();
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ... aren't deps missing?


return () => unsubs.forEach((fn) => fn());
}, [api.onTasksUpdated, api.onTaskUpdated, api.onRefresh, queryClient]);
}, [api, queryClient]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean we recreate api on every render?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants