Commit Graph
138 Commits
Author SHA1 Message Date
David KayaandCopilot 38d7e339a2 fix: replace imperative DOM overlay with React-based positioning
The imperative approach inserted overlay elements directly into
Lexical-managed CodeNode DOM elements.  Lexical's MutationObserver
detected the foreign DOM nodes, reconciled them away, which triggered
update listeners that re-inserted them — causing an infinite loop
that froze the app.

The new approach renders overlay elements via React, positioned
absolutely in a pointer-events:none container that sits over the
content editable.  Overlay positions are computed from each code
element's bounding rect and updated via requestAnimationFrame on
editor updates and scroll events.  This avoids all Lexical DOM
mutation and eliminates the freeze.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:49:16 +01:00
David KayaandCopilot 9ef7150183 feat: move language selector onto code block, fix code block insertion
Language selector:
- Replaced toolbar dropdown with an imperative overlay rendered
  directly inside each code block's DOM element
- Overlay uses contentEditable='false' + position:absolute at the
  top-right of the code block, styled as a compact native select
- Plugin re-inserts overlays after each Lexical reconciliation to
  survive DOM diffing

Code block insertion:
- toggleCodeBlock now inserts a trailing paragraph after the code
  block when it would otherwise be the last element, so the user
  can always type regular text below a code block

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:42:58 +01:00
David KayaandCopilot 039b9037ee feat: add code block language selector to composer
When the cursor is inside a code block, the formatting toolbar shows
a language dropdown (22 languages). Selecting a language updates the
CodeNode, which the markdown serializer writes as the fenced code
block language tag (e.g. \\\	ypescript).

A CodeBlockLabelPlugin syncs a data-code-language attribute on each
code block element so CSS ::before shows the friendly language name
as a small label at the top of the block.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:37:08 +01:00
David KayaandCopilot 1f9203e1da fix: send button clearance and code block display mode
- Increase editable min-height from 40px to 52px and padding from 8px
  to 10px so the send button (32px + 8px bottom offset) has 12px
  clearance from the toolbar border instead of 0px
- Add display: block to .mc-code-block — Lexical CodeNode renders as
  <code> which is inline by default, causing border/padding to split
  visually across lines instead of forming a proper block
- Revert empty code block to code.select() without synthetic TextNode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:35:25 +01:00
David KayaandCopilot d84de12f45 fix: send button overlaps toolbar border and empty code block glitch
- Move send button into MarkdownComposer children slot so it positions
  relative to the editor content area, not the full container
- Always create a text node when inserting a code block to prevent
  Lexical from rendering a split/empty code block artifact

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:31:24 +01:00
David KayaandCopilot 77194d1f01 feat: replace textarea with Lexical WYSIWYG markdown composer
Replace the plain <textarea> in ChatPane with a full WYSIWYG
markdown composer built on Lexical 0.42.0.

Composer features:
- Rich text editing with inline formatting (bold, italic, code)
- Block-level elements: headings, bullet/numbered lists, code blocks,
  blockquotes, links via markdown shortcuts (e.g. ## , - , \\\)
- Formatting toolbar with active-state indicators
- Markdown paste auto-import when the editor is empty
- Enter to send, Shift+Enter for newline (matches prior behavior)
- Disabled state syncs with session busy/config states
- Serializes to markdown on submit via the backend helpers

Files:
- New: MarkdownComposer.tsx (Lexical editor, toolbar, internal plugins)
- Modified: ChatPane.tsx (swap textarea for MarkdownComposer, simplify state)
- Modified: styles.css (add markdown composer theme classes)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:21:13 +01:00
David KayaandCopilot d07bf30e81 feat: add markdown composer backend foundation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 19:19:58 +01:00
David Kaya a8c6ba94f5 feat: collapse timeline automatically 2026-03-25 00:25:00 +01:00
David KayaandCopilot f2c5b2cf1a fix: preserve handoff final authorship
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:15:30 +01:00
David KayaandCopilot a6b3b0ff83 docs: note local upstream clone paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:13:25 +01:00
David KayaandCopilot 6460fe7173 fix: preserve agent authorship across projections
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:10:56 +01:00
David KayaandCopilot 9bfd7837aa fix: preserve handoff agent identity
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 00:02:46 +01:00
David KayaandCopilot 7c848113c0 fix: correct handoff output attribution
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:55:30 +01:00
David Kaya 2fc03454c4 fix: block tools for handoff triage\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 2026-03-24 23:51:38 +01:00
David KayaandCopilot 2c972a063a fix: tighten handoff routing behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:47:31 +01:00
David KayaandCopilot f67fab0816 fix: edge selection highlighting and group-chat connection rules
- Add CSS styling for selected edges (indigo highlight with glow)
- Enable orchestrator↔agent connections in group-chat mode
- Downgrade disconnected-agent validation from error to warning
- Rename addHandoffEdge to addEdge (generic for all modes)
- Add tests for group-chat connection rules

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:41:00 +01:00
David KayaandCopilot f0d7d44589 feat: enable edge deletion in group-chat mode
Extend edge deletion to group-chat orchestrator↔agent edges in addition
to handoff agent↔agent edges. Structural edges (user-input/output,
distributor/collector) remain non-deletable across all modes.

Sequential, concurrent, and single modes keep fully structural topologies
with no user-deletable edges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:34:38 +01:00
David KayaandCopilot 24bbf1ded3 fix: agent node deletion, inspector layout, and header overlap
- Enable Delete-key removal of agent nodes on the canvas; system nodes
  remain non-deletable. Removals route through the authoritative
  removeAgent path which prevents deleting the last agent.
- Stack Model and Reasoning selects vertically in the inspector panel
  so they fit within the 320px-wide column without truncation.
- Add right padding (pr-36 / 144px) to the editor header so the Save
  and Delete buttons clear the Windows title-bar overlay controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:32:22 +01:00
David KayaandCopilot c81ea6f83b feat: improve graph readability with colored edges, bezier curves, and auto-layout
- Color-code edges by semantic role: structural edges (system↔node) in
  muted zinc, agent-to-agent edges in indigo for clear visual separation
- Switch from smoothstep to bezier curves for smoother, more natural
  edge routing that reduces right-angle overlaps
- Stagger agent nodes at alternating X offsets in concurrent, handoff,
  and group-chat layouts so parallel fan-out/fan-in edges take distinct
  bezier paths instead of stacking
- Increase spacing in all layouts to give edges more room
- Add dagre-powered auto-layout button (top-right of canvas) that
  computes optimal left-to-right hierarchical node positions
- Add 2 new tests for auto-layout across all orchestration modes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:27:43 +01:00
David Kaya 9b689e1411 Revert "fix: show single handle per node, rely on arrow for direction"
This reverts commit b5b4f1b1c6.
2026-03-24 23:21:15 +01:00
David KayaandCopilot b5b4f1b1c6 fix: show single handle per node, rely on arrow for direction
Hide the target (left) handle on SystemNode and AgentNode so each node
displays only one visible circle. The directional arrow marker on edges
communicates flow direction, halving the visual handle count.

- user-input:  source handle on right (visible)
- user-output: target handle on left  (visible)
- all others:  source handle on right (visible), target on left (hidden)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:18:55 +01:00
David KayaandCopilot eb2c8450e3 feat: directional edges and provider icons on agent nodes
- Add ArrowClosed markers to all graph edges for clear directional flow
- Replace generic Bot icon with AI provider logos (OpenAI, Anthropic,
  Google) on agent nodes, inferred from the agent's model id
- Show model display name as subtitle on agent nodes (e.g. 'GPT-5.4',
  'Claude Opus 4.5')
- Thread availableModels catalog from PatternEditor through canvas to
  resolve friendly model names; falls back to raw model id
- Add 3 new tests for arrow markers, provider icons, and model labels

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:16:04 +01:00
David KayaandCopilot c6c8e79e9f fix: address graph editor UX feedback
- Hide input handle on User Input nodes and output handle on User Output
  nodes (separate userInputNode/userOutputNode node types)
- Enable edge deletion in handoff mode only (Delete key or React Flow UI);
  only agent-to-agent edges are deletable, structural edges are protected
- Block all edge mutations (add/delete) in concurrent and group chat modes
- Add agent as disconnected node without auto-rebuilding the graph
- Add sequential reorder controls (↑↓) in the inspector panel with
  position/order swap and automatic edge rebuilding
- Replace circular group chat layout with vertical column to prevent
  bidirectional edge crossings
- Tighten handoff layout spacing so edges between triage and specialists
  don't overlap nodes
- Use smoothstep edge type for cleaner edge routing across all modes
- Add 6 new tests covering reorder, disconnected add, edge deletion rules,
  and node type assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 23:09:21 +01:00
David KayaandCopilot 7d078faada feat: replace form-based pattern editor with interactive graph canvas
Replace the flat agent list and static flow diagrams in PatternEditor with
an interactive React Flow canvas backed by the authoritative PatternGraph
model. Users can now see and manipulate orchestration topology visually.

Changes:
- Add @xyflow/react (React Flow) as a canvas library
- Create patternGraph view-model layer for graph-to-canvas projection
- Create GraphNodes with custom system/agent node components
- Create PatternGraphCanvas with drag, connect, and selection support
- Create PatternGraphInspector for selected node/agent details
- Rewrite PatternEditor with split layout: canvas + inspector sidebar
- Add dark theme CSS overrides for React Flow
- Add 11 tests covering view-model projection, connection rules, and
  graph mutation helpers
- Update ARCHITECTURE.md to reflect the new renderer graph boundary

The canvas projects PatternGraph into React Flow nodes/edges. Handoff mode
supports drawing new agent-to-agent edges interactively. Node positions
persist to the graph on drag completion. Agent editing moves from inline
forms to the inspector panel on node selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:54:02 +01:00
David KayaandCopilot 2e2caf78f9 feat: add graph-backed orchestration topology
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:44:17 +01:00
David KayaandCopilot 5ab0b22d15 fix: align orchestration behavior with agent framework docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:09:52 +01:00
David KayaandCopilot cf6a25a9da refactor: simplify handoff payload parsing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:37:36 +01:00
David KayaandCopilot 8b2e7cd2c0 refactor: simplify workflow request interpretation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:29:35 +01:00
David Kaya 38ebe5bdfa docs: revert agent things 2026-03-24 21:23:48 +01:00
David KayaandCopilot 76846843ab docs: refine agent quality guidance
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:17:40 +01:00
David KayaandCopilot f1a96773c8 refactor: decompose CopilotWorkflowRunner
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:10:06 +01:00
David Kaya b4de1346fd docs: remove files 2026-03-24 21:08:17 +01:00
David KayaandCopilot 44d9c43b09 refactor: resolve approval tools from SDK call ids
- correlate permission requests to tool names via ToolCallId when the
  workflow request stream exposes matching CallId values
- keep the url-to-web_fetch alias only as a narrow fallback when a
  matching tool call cannot be recovered
- cover generic permission-category lookup for url, shell, and read in
  sidecar tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:03:16 +01:00
David KayaandCopilot 7622d047b1 fix: auto-approve URL permission requests
- map GitHub Copilot SDK PermissionRequestUrl to web_fetch so runtime
  tool auto-approval matches URL fetch permissions
- include hook tool names in approval tool-name extraction
- include requested URLs in approval detail when manual review is still
  required
- add sidecar tests covering URL and hook permission handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:43:06 +01:00
David KayaandCopilot 2891d4bc90 refactor: move session controls from activity panel to chat input
Move interactive tool toggles and auto-approval overrides from the
ActivityPanel side panel into compact pill-style popovers above the
chat composer in ChatPane. This cleanly separates concerns:

- ActivityPanel is now purely read-only (agents + timeline)
- ChatPane owns all session-level interactive controls
- Tools pill: popover with MCP/LSP enable/disable toggles
- Auto-approval pill: popover with grouped tool auto-approval overrides
  including session override state and reset action

Follows the existing InlineModelPill/InlineThinkingPill pattern for
scratchpad sessions, giving non-scratchpad sessions the same kind
of inline configuration experience.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:28:08 +01:00
David KayaandCopilot b4330ec01d fix: improve approval auto-approval UX
- fix double-toggle bug in PatternEditor (nested buttons caused clicks to cancel out)
- only show tool auto-approval section when tool-call checkpoint is enabled
- group tools by kind (built-in, MCP, LSP) with sub-headers when mixed
- remove redundant per-row shield icons and kind badges from ActivityPanel
- fix missing bottom margin on Tools section in ActivityPanel
- shorten and clarify status badges and empty-state messages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:20:56 +01:00
David KayaandCopilot 130b114906 fix: use runtime tools for approval auto-approval
- load runtime tools dynamically from Copilot CLI capabilities via tools.list
- merge runtime tools with configured MCP and LSP tools in the approval catalog
- keep a fallback builtin runtime tool list when capabilities are unavailable
- move approval-tool pruning to the app service so dynamic tools are not dropped on load
- update approval UI and docs to use the corrected runtime-tool model

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:16:11 +01:00
David KayaandCopilot 4b7409368f feat: add tool auto-approval UX in pattern editor and activity panel
- PatternEditor: tool auto-approval defaults section with toggles per tool
- ActivityPanel: per-session override section with inherited/custom state and reset action
- ChatPane: surface toolName in approval banner and queued approval list
- Disable controls while running; scratchpad non-interactive explanation
- Use listApprovalToolDefinitions() exclusively for tool identity

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:14:14 +01:00
David KayaandCopilot d5c538eed9 feat: add tool-specific approval overrides
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 20:02:29 +01:00
David KayaandCopilot f896fa6442 feat: add approval queue UX with position labels, queue preview, and count badges
- ChatPane: show 'Approval 1 of N' label, queued-approvals accordion preview,
  queue count badge in header, and hint text for queue advancement
- Sidebar: show '+N queued' count next to 'Awaiting approval' badge
- ActivityPanel: show total approval count in header badge

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:56:47 +01:00
David KayaandCopilot c6e20da8db fix: queue session approvals
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:56:21 +01:00
David KayaandCopilot f54cbdb6b1 feat: add approval checkpoint UX across renderer
- ChatPane: approval banner with approve/reject, final-response preview, error handling
- PatternEditor: approval checkpoints section with toggles and agent scope selector
- Sidebar: amber awaiting-approval badge replaces running indicator when pending
- ActivityPanel: shield icon approval badge in header
- RunTimeline: approval kind badge, detail text, status-aware colors

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:52:23 +01:00
David KayaandCopilot 2aa8d73b2d feat: add approval checkpoints backend
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:48:58 +01:00
David Kaya e7dfb66038 docs: remove handover doc 2026-03-24 19:44:49 +01:00
David KayaandCopilot 070515667b docs: rewrite architecture guide
Rewrite ARCHITECTURE.md as a higher-level system document.
The new version removes file-by-file detail, adds mermaid diagrams,
and focuses on runtime boundaries, communication links, security,
state ownership, and cross-cutting concerns so readers can understand
how the app is architected without reading the code first.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:41:10 +01:00
David KayaandCopilot f7ab880e9f docs: add architecture guide
Create ARCHITECTURE.md with a concrete overview of the Electron app,
its renderer/main/preload boundaries, shared domain model, .NET
sidecar, persistence model, workflow execution path, tooling model,
and build/release pipeline.

Also update AGENTS.md so future agents keep ARCHITECTURE.md in sync
when a change materially affects the system design.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:35:00 +01:00
David KayaandCopilot 75934a161a fix: sync title bar overlay colors with app theme
The Windows title bar overlay (minimize/maximize/close buttons) was
hardcoded to dark colors and did not update when switching themes.

- Add titleBarTheme helper that maps AppearanceTheme to overlay and
  background colors, using nativeTheme for the system preference
- Call applyTitleBarTheme from the setTheme IPC handler so the overlay
  updates immediately on theme change
- Apply persisted theme on startup so the overlay matches from launch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:31:49 +01:00
David KayaandCopilot 973e5eb25c feat: implement light mode with settings toggle
Add appearance theme support (dark/light/system) using CSS custom
property overrides. In light mode the Tailwind zinc scale is inverted
and semantic surface/border tokens are swapped, so all existing
utility classes pick up the new palette automatically.

- Add AppearanceTheme type and theme field to WorkspaceSettings
- Add setTheme IPC channel wiring (contracts, preload, handler, service)
- Add [data-theme='light'] CSS overrides for zinc scale, surface tokens,
  scrollbar, and markdown prose colours
- Add Appearance section to SettingsPanel with radio-button theme picker
- Apply data-theme attribute on document root via useEffect in App.tsx,
  with matchMedia listener for the system option

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:28:48 +01:00
David KayaandCopilot 33c4cee0b4 fix: normalize oversized font sizes across the UI
Tighten font sizes to match the app's compact design language:

- WelcomePane: heading from text-xl (20px) to text-base (16px),
  buttons and descriptions from text-sm (14px) to text-[13px]
- SettingsPanel: all section headings from text-sm to text-[13px]
- NewSessionModal: title from text-sm to text-[13px]
- PatternEditor: title from text-sm to text-[13px]
- ChatPane: empty-state prompt from text-sm to text-[13px]
- Markdown prose: h1 from 1.25rem to 1.125rem, h2 from 1.125rem
  to 1rem, h3 from 1rem to 0.9375rem

Keeps text-sm only for the app brand name, loading state, and error
headings where larger text is intentional.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:24:08 +01:00
David KayaandCopilot 2f069f60b4 feat: add cross-platform release automation
Add a GitHub Actions workflow that validates the app on pushes and pull requests, and publishes Windows, macOS, and Linux release assets when a tag is pushed.

Also replace the Windows-only packaging flow with cross-platform Bun scripts for sidecar publishing and Electron packaging so the release job can package each runner natively.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:20:46 +01:00