Commit Graph

385 Commits

Author SHA1 Message Date
Levi Neely 2d6e0ed787 gui: extract dialogs and chat delegate into components
Phase 1 of GUI cleanup - component extraction:
- SettingsDialog.qml: theme and font settings (118 lines)
- NewSessionDialog.qml: session creation form (79 lines)
- NewAgentDialog.qml: agent creation form (174 lines)
- ChatBlockDelegate.qml: chat block with text/diagram segments (322 lines)

main.qml reduced from 1685 to 1030 lines (39% reduction).
Updated CMakeLists.txt for both Qt6 and KF5 builds.
2026-08-07 17:40:09 +02:00
Levi Neely bdad2b740f remove scroll-to-bottom button 2026-08-07 17:17:14 +02:00
Levi Neely b77667fbfb Fix QML performance and stability issues
- Fix TypeError by using explicit id instead of parent.parent chains
- Remove onContentHeightChanged handler that caused layout thrashing
- Add active guard on Loader to prevent null modelData access
- Simplify blockSegments null checks
2026-08-07 15:25:16 +02:00
Levi Neely 0ac03a9931 Fix chat rendering and improve scroll behavior
- Emit SegmentsRole in dataChanged signals so QML updates properly
- Add onContentHeightChanged to scroll when content loads after session switch
- Add floating scroll-to-bottom button that appears when scrolled up
- Wrap chat ScrollView in Item to allow button overlay
2026-08-07 15:15:05 +02:00
Levi Neely 07232b94df Add PlantUML and Mermaid diagram rendering
- Detect plantuml/mermaid code fences and render as diagrams
- PlantUML: POST to localhost:8080/svg for SVG output
- Mermaid: GET to localhost:8081/img/ with base64 for JPEG output
  (SVG not usable - Qt doesn't support foreignObject)
- Cache rendered diagrams by content hash
- Toggle between source code and rendered image view
- Copy button for source text or image data
- Fall back to source display on render errors
- Add ClipboardHelper for image clipboard support
- Clear diagram cache on session reset
2026-08-07 14:59:20 +02:00
Levi Neely 2ea6ec1ba7 gui: fix scrolling in chat and message input
- Restore ScrollView for message input to enable overflow scrolling
- Remove manual wheel handlers that broke ListView virtualization
- Let wheel events propagate naturally to ListView
2026-08-07 11:20:13 +02:00
Levi Neely df8e69aeb8 gui: I-beam cursor over block content context menu area 2026-08-07 11:01:09 +02:00
Levi Neely f086400bf3 gui: add text selection and context menus
Chat blocks:
- Enable selectByMouse and persistentSelection for text selection
- Add context menu with Copy and Select All
- Disable ListView drag during text selection (preserves wheel scroll)
- I-beam cursor over text content

Prompt input:
- Enable selectByMouse and persistentSelection
- Add context menu with Cut, Copy, Paste, Select All
- Remove ScrollView wrapper (TextArea handles overflow natively)
- I-beam cursor
2026-08-07 11:00:15 +02:00
Levi Neely 624b7ad66d gui: smart auto-scroll follows streaming content
- Add shouldAutoScroll property to track user intent
- Auto-scroll when near bottom (within 50px threshold)
- Disable auto-scroll when user scrolls up to read history
- Re-enable when user scrolls back to bottom
- Reset to auto-scroll on session/agent switch
- Increase timer interval to 16ms for smoother layout settling
2026-08-07 10:21:53 +02:00
Levi Neely 1ca5563fdb gui: stream partial content to UI before newlines
appendData() now emits dataChanged with partial line buffer content
so the UI updates as tokens arrive, not just after complete lines.
This fixes the laggy streaming where text would appear in chunks.
2026-08-07 10:11:14 +02:00
Levi Neely bb1454f85a fix: ollie_ghost compile — stripPrefixEcho signature and forward declarations 2026-08-07 08:59:03 +02:00
Levi Neely 08ec46027e kate: replace ollie-9p complete with generate for code completions
- Build the completion prompt inline (mirrors agent/complete.go prompt)
- Call ollie-9p rdwr generate instead of ollie-9p rdwr complete
- Pass backend/model as JSON fields in the generate request
- StripCompletionNoise and stripPrefixEcho moved into C++ helpers
2026-08-07 07:37:42 +02:00
Levi Neely ab8aa8d719 kate: add 'Start Session' context action
Available without text selection. Ensures a kate session/agent exists
(reuses existing or creates new), sets cwd to the current project
directory, and updates the status bar.
2026-08-06 16:58:02 +02:00
Levi Neely 05fa829ec1 kate: ESC dismisses ghost completion 2026-08-06 16:55:47 +02:00
Levi Neely c1160a468a ghost: add tinted background to multi-line overlay
The overlay now draws a semi-opaque background (editor base color
tinted slightly toward highlight) so continuation lines are clearly
distinguished from the underlying document text. Re-enabled the
multi-line overlay since it's now visually distinct from real content.

- Background at 92% opacity with subtle highlight tint
- Ghost text at 60% opacity (up from 40%)
- Small padding around overlay content
2026-08-06 16:54:02 +02:00
Levi Neely e4c831df89 kate: add config page with 'Automatic completion' toggle
Adds a Settings → Configure Kate → Plugins → Ollie config page with a
checkbox to enable/disable automatic ghost text completion. The setting
persists via KConfig and is applied when the ghost provider is created.
2026-08-06 16:52:16 +02:00
Levi Neely 1df0daf9de kate: reuse single agent, write cwd on project change
Instead of one-agent-per-project-directory, reuse the first agent in
the kate session. When the project changes, write the new directory
to the agent's ctl file (cwd command). Simpler model — one kate
session, one agent, cwd follows the active project.
2026-08-06 16:50:49 +02:00
Levi Neely 405095716a docs: add Send verbatim action and connection recovery to README 2026-08-06 16:15:33 +02:00
Levi Neely 48a5250194 kate: add 'Send verbatim' context action
Sends selected text wrapped in a code fence with the appropriate language
(derived from Kate's highlighting mode). Useful for pasting code snippets
directly to the agent without any surrounding prompt text.
2026-08-06 14:56:13 +02:00
Levi Neely 4acda0f7de gui: rename 'Human' to 'You' in chat block headers 2026-08-06 14:15:58 +02:00
Levi Neely 2a6441cd53 kate: add connection state tracking and auto-recovery
Adds a heartbeat timer (5s interval) that pings the 9P server with a
cheap read. If the server goes down, the status bar turns red showing
'disconnected'. When it comes back, the plugin reconnects and
re-selects the agent for the current project.

Status bar now shows connection state:
- Red '✗ disconnected' — server unreachable
- Gray '○ no agent' — connected but no agent selected
- Green '● kate/ID' — connected with active agent
2026-08-06 14:09:33 +02:00
Levi Neely 0ff1025bb9 docs: update README for simplified kate plugin and GUI sidebar toggle 2026-08-06 13:57:37 +02:00
Levi Neely d90a2e6f27 ghost: fix completion overlapping existing document text
- Don't show inline ghost note when cursor is mid-line (text exists
  after cursor) — the ghost would visually conflict with real content
- Only show multi-line overlay when cursor is near EOF, so continuation
  lines don't paint on top of existing document lines
- Tab-accept still works regardless of visual display
2026-08-06 13:49:22 +02:00
Levi Neely 9887751690 gui: add sidebar toggle (Ctrl+B or click button in header)
Adds ability to hide/show the session list sidebar:
- Ctrl+B keyboard shortcut
- Toggle button (◀/▶) in the chat header
- Sidebar collapses to zero width when hidden
2026-08-06 13:42:36 +02:00
Levi Neely 7aad74dafe kate: simplify plugin — remove chat panel, keep context actions + ghost text
Strip the plugin down to its core value:
- Context menu actions (explain, fix, refactor, document, test, review diff)
- Ghost text completion (unchanged)
- Git++ review diff integration
- Auto agent-per-project matching (silent, no UI)
- Status bar indicator showing current agent

Removed:
- Chat panel (side panel UI, streaming, renderer)
- Inline annotations
- Emoji processing
- Config page (use env vars: OLLIE_COMPLETE_BACKEND, etc)
- Apply code blocks
- libkateprivate/diff viewer integration

3109 LOC → 1192 LOC. Use the KDE GUI app tiled alongside Kate for chat.
2026-08-06 13:39:30 +02:00
Levi Neely 9a1704d728 Remove all D-Bus mentions from README 2026-08-05 19:01:33 +02:00
Levi Neely 00b904063e Fix close-to-tray comment - it is implemented 2026-08-05 18:59:47 +02:00
Levi Neely 8748c2e540 Fix architecture diagram: KDE programs use 9P clients to access olliesrv
- olliesrv is the single 9P server, not parallel to ollie-9p
- KDE programs connect via libollie9p, ollie-9p subprocess, or plan9port's 9p
- Remove remaining Plasmoid reference from intro
2026-08-05 18:58:35 +02:00
Levi Neely e8ac6f445d Remove stale tray/daemon/plasmoid build files
- Delete CMakeLists-active.txt and CMakeLists-kf5.txt (legacy D-Bus build
  configs referencing deleted tray/, daemon/, plasmoid/ directories)
- Mark close-to-tray property as unimplemented in thememanager
2026-08-05 18:57:35 +02:00
Levi Neely 7393e4a846 Remove remaining plasmoid/tray references
- Remove Plasmoid from README components, architecture diagram, usage, file layout
- Remove Plasmoid build outputs from Build section
- Remove Plasma dependency from Dependencies
- Remove stale plasmoid/tray paths from justfile uninstall targets
- Fix typo in justfile (q5 -> qt5)
- Remove test-peers.sh from file layout
2026-08-05 18:56:32 +02:00
Levi Neely ce36dcde52 Update KDE README and remove D-Bus dependencies
- Rewrite README.md with accurate 9P-based architecture
- Remove all D-Bus dependencies:
  - Update dolphin/ollie-ask to use ollie-9p rdwr generate
  - Update kate/ollie_ghost.cpp to use ollie-9p rdwr complete
  - Remove QDBusInterface from ollie_ghost.h
  - Fix OllieGhostProvider constructor in ollie_kate.cpp
  - Remove D-Bus comments from gui/main.cpp and kate/ollie_kate.cpp
  - Remove QtDBus from CMakeLists.txt (KF5 and KF6)
  - Delete D-Bus test scripts test-e2e.sh and test-peers.sh
- Clarify no system tray component exists
- Update build/install instructions with just commands
2026-08-05 18:53:30 +02:00
Levi Neely 73e262ffaf kate: fix agent selection, block rendering, project change detection
- newAgent() is idempotent: selects existing agent by cwd if one exists
- Use rdwr() to get new agent ID from server instead of ls() ordering
- selectAgentForProject() returns bool for caller branching
- Connect to Kate project plugin projectChanged signal
- Update chat block parser to [[[type]]] / [[[end]]] format
- Guard pluginViewCreated for KF5 < 5.78
2026-08-05 17:51:27 +02:00
Levi Neely 2c7b5e6fc5 gui: add heartbeat-based daemon disconnect detection
- Add 2.5 second heartbeat timer using Lib9pClient to read 'help'
- Heartbeat detects daemon death reliably (vs unreliable process exit codes)
- On disconnect: clear sessions, stop streams, reset active selection
- On reconnect: refresh sessions, restart agent streams

Replaces flaky NinePConnection::disconnected signal which depended on
eventwait process exit behavior.
2026-08-05 09:02:51 +02:00
Levi Neely d01d7c8ad8 gui: add session connection status indicator
- Add colored dot to session rows showing tool server RPC status:
  green=connected, yellow=paused+connected, gray=paused, red=broken
- Remove vestigial agent.connected from model (was never displayed)
- Session-level connected status is the correct granularity
2026-08-05 08:35:43 +02:00
Levi Neely 9f3f962567 Remove sidebar state dot indicators 2026-08-04 16:33:21 +02:00
Levi Neely dbc1eabf55 gui: revert to working approach - activeState for selected agent only
Non-selected agents show idle (green). This matches the working
top indicator approach until we find a proper solution for tracking
all agent states reactively in QML.
2026-08-04 16:26:32 +02:00
Levi Neely 9929abc73b gui: use Connections to update agent state on revision change 2026-08-04 16:24:57 +02:00
Levi Neely 670d759769 gui: use revision inside binding expression for proper dependency tracking 2026-08-04 16:24:10 +02:00
Levi Neely 22980e376a gui: track all agent states via revision counter for proper QML binding
- Add agentStateRevision property that increments on any state change
- QML binds to revision to trigger re-evaluation of agentState() calls
- All agent dots now show correct live state, not just active agent
2026-08-04 16:23:04 +02:00
Levi Neely 1d79d0ee89 gui: agent tree dot uses ollie.activeState directly for active agent 2026-08-04 16:19:33 +02:00
Levi Neely dbd2606ed2 gui: agent tree dot uses ollie.agentState() like top indicator 2026-08-04 16:18:42 +02:00
Levi Neely 457a6a55dc gui: use explicit properties for agent state dot binding
Create agentState and isPaused properties to ensure proper binding
updates when model roles change via setProperty
2026-08-04 16:17:11 +02:00
Levi Neely 9e5352f700 gui: fix agent state dot colors and parentPaused propagation
- Update parentPaused on agents during incremental session updates
- Set parentPaused and parentExpanded when inserting new agents
- Update session paused property during updates
- Use explicit === true check for parentPaused
2026-08-04 16:15:40 +02:00
Levi Neely 3d739a9560 gui: gray indicators and 'inactive' label for paused sessions
- Agent dots in tree are gray when parent session is paused
- Top state indicator is gray when viewing agent in paused session
- Top state label shows 'inactive' instead of agent state when paused
2026-08-04 16:13:04 +02:00
Levi Neely 2b19cafc50 gui: show disconnected state visually, remove session connected/ended messages
- Session list shows '(not connected)' when daemon disconnected
- Chat area shows 'Not connected' placeholder when disconnected
- Message input disabled and shows 'Not connected' when disconnected
- Chat ListView hidden when disconnected
- Remove sessionConnected/streamingDone signals (visual feedback is sufficient)
2026-08-04 16:11:39 +02:00
Levi Neely b4ae887089 ninepconnection: emit disconnected when leaving Connected state
Previously disconnected was only emitted when entering Disconnected state,
not when transitioning Connected->RetryWait. This caused Lib9pClient to
keep a stale handle when olliesrv restarted, preventing reconnection.
2026-08-04 16:07:26 +02:00
Levi Neely 22302ce9f1 gui: session tree with Active/Paused groups, arbitrary-depth expand/collapse 2026-08-04 16:05:08 +02:00
Levi Neely 265a1fdda9 refactor: promote remote to session level, remove agent connectivity, formalize NinePConnection state machine
- Add createSession(name, remote) with New Session dialog
- Remove agent connectivity code (redundant with session connectivity)
- Refactor NinePConnection as formal state machine with explicit events
- Fix silent restart to not cycle through Connecting state
2026-08-04 15:22:08 +02:00
Levi Neely ec89eaae18 fix: always send stop on ESC regardless of cached state
Removes the activeState !== 'idle' check before sending the stop
command. The server-side Interrupt() is safe to call on an idle
agent (returns false, no-op).

This fixes an intermittent issue where pressing ESC wouldn't stop
the agent because the GUI's cached activeState was stale/out-of-sync
with the server's actual state.
2026-08-04 11:51:01 +02:00
Levi Neely 9d059943f2 cleanup: remove debug logging 2026-08-03 20:43:16 +02:00