Commit Graph

29 Commits

Author SHA1 Message Date
Levi Neely 541ef48bb7 Refactor GUI into session tree and chat pane components 2026-08-16 12:56:49 +02:00
Levi Neely e7b3291826 cleanup: delete all dead D-Bus code and unused UI components
Removed:
- plasmoid/ (entire directory — QML plugin, D-Bus client, metadata)
- tray/ (entire directory — KStatusNotifierItem, D-Bus watcher)
- gui/chatblockmodel.* (replaced by plain text streaming)
- gui/thememanager.* (unused — Basic style handles palette)
- gui/ChatPane.qml, SessionGraph.qml (complex delegate system, gone)
- gui/emojis.js (emoji shortcode completion, can re-add later)
- gui/main-kf5.qml (duplicate of main.qml)

What remains in gui/:
- main.cpp, main.qml — 9P-based minimal GUI
- ollie9pclient.cpp/h — QProcess-based 9P transport
- qml.qrc, ollie.svg, desktop file
2026-07-31 20:44:22 +02:00
Levi Neely f4161fcabc gui: replace D-Bus with native 9P streaming
Kill the entire D-Bus rendering pipeline. The GUI now uses plan9port's
9p command as a subprocess for all server communication:

- Chat streaming: persistent 'read chat' process, readyReadStandardOutput
  delivers tokens directly to QML (no polling, no signals, no offsets)
- State: 'read statewait' process, restarts on each state change
- Session list: 'read session/idx' one-shot
- Submit/stop/kill: 'write prompt/ctl' one-shot

The QML is stripped to fundamentals: session list + monospace streaming
text (last 8KB tail) + input field. No ChatBlockModel, no ThemeManager,
no OllieDBusClient, no syntax highlighting, no markdown rendering.

This eliminates the multi-second GUI freezes caused by:
- QTextDocument relayout on 200KB+ accumulated text
- loadEarlier cascade creating hundreds of delegates
- KSyntaxHighlighting::Repository blocking init
- Offset mismatch triggering synchronous D-Bus calls

Features will be re-added incrementally on this proven foundation.
D-Bus retained only for plasmoid/tray/KRunner (desktop integration).
2026-07-31 20:06:05 +02:00
Levi Neely 5bdab3c616 remove emoji reaction feature (KDE GUI) 2026-07-31 09:09:30 +02:00
Levi Neely e4c1cea385 diagrams: move MouseArea outside Flickable to fix pan
Child MouseArea inside Flickable interferes with drag detection even
when only accepting RightButton. Move it to a sibling overlay with
propagateComposedEvents so left-drag reaches the Flickable natively.
2026-07-29 16:49:44 +02:00
Levi Neely 32c501a2c7 diagrams: simplify pan — native Flickable drag, MouseArea only for wheel+right-click
Remove manual pan logic. Let Flickable handle drag-to-pan natively.
MouseArea only accepts RightButton (close) and wheel (zoom), so it
no longer steals left-click events from the Flickable.
2026-07-29 16:47:29 +02:00
Levi Neely 395f2890ae diagrams: use Ctrl+drag to pan (Meta is global on KDE) 2026-07-29 16:45:01 +02:00
Levi Neely 931cadb3ce diagrams: Meta+click-drag to pan fullscreen viewer
Left-click drag was unreliable for panning. Use Meta (Super/Win key)
+ left-click-drag instead. Flickable interactive mode disabled;
panning is handled manually via MouseArea.
2026-07-29 16:43:12 +02:00
Levi Neely d008a2e6a8 gui: collapse call blocks by default, click to expand
Tool call args are less interesting than results. Show only the
call name with a ▶ toggle; click to expand and see the full args.
2026-07-29 16:23:37 +02:00
Levi Neely 29c74b2837 feat(gui): render PlantUML, Mermaid, and draw.io diagrams as images
- Detect mermaid/plantuml/drawio/mxgraph code fences as 'diagram' sub-blocks
- Render via local servers (PlantUML :8080, Mermaid :8081, draw.io :8082)
- Fall back to CLI tools (plantuml, mmdc, drawio) if servers unavailable
- Cache rendered SVGs in ~/.cache/*/diagrams/ keyed by content hash
- Show rendered image with white background (dark theme friendly)
- Collapsible source toggle (▶/▼) below rendered diagram
- Middle-click to invalidate cache and re-render
- Left-click opens fullscreen pannable/zoomable viewer
- Fullscreen: scroll-wheel zoom, drag to pan, Esc/right-click/dbl-click to close
- Both kf5 and kf6 builds
2026-07-29 15:23:29 +02:00
Levi Neely 9cf63f67b4 gui: fix ghost process, null block.reaction crash, window counter 2026-07-27 21:32:31 +02:00
Levi Neely d5f0770b0a structured reactions via getReactions/setReactions, remove broken chat-text parsing 2026-07-27 19:47:21 +02:00
Levi Neely cf1f0f75d9 pin reaction badge on assistant blocks, hide reaction buttons after reacting 2026-07-27 19:27:20 +02:00
Levi Neely e2592d821f propagate response IDs through chat models to reactTo 2026-07-27 19:12:12 +02:00
Levi Neely 16364e52b0 kf6: add reaction buttons + remove sloppy focus
Same fixes as kf5:
- Remove hover-based sloppy focus that stole focus from buttons
- Add Ctrl+L to focus prompt
- Add emoji reaction buttons on assistant message hover
2026-07-27 15:48:43 +02:00
Levi Neely 81bd93f1f4 gui: sloppy focus targets filter input when filter bar is visible 2026-07-27 09:41:42 +02:00
Levi Neely a7dc265f5f gui: don't steal focus from filter input 2026-07-27 09:39:47 +02:00
Levi Neely dc18436bae gui: Ctrl+F filter bar to search chat messages
Adds a filterText property to ChatBlockModel that filters all
parsed blocks by case-insensitive substring match on content
or tool/call name. Toggle the filter bar with Ctrl+F; Escape
or the close button clears the filter and hides the bar.
Shows match count while filtering.
2026-07-27 09:37:26 +02:00
Levi Neely c62ae85b2c gui: style scrollbar handle for visibility
Use palette.mid at 60% opacity when active (scrolling), fully
transparent when idle, palette.mid on hover, palette.highlight
when pressed. 150ms color animation for smooth transitions.
2026-07-27 09:20:39 +02:00
Levi Neely 2b17e861be gui: add native scrollbar + lazy-load on scroll-up
- Add ScrollBar.vertical to the chat Flickable (both KF5/KF6)
- Remove interactive:false so native flick gestures work
- Trigger paneModel.loadEarlier() when scrolled near top
- Preserve scroll position when prepending older blocks
- Reduce column width by 12px for scrollbar clearance
2026-07-27 09:17:28 +02:00
Levi Neely 1d2fffdcab gui: persist prompt draft text per session
When switching between sessions, the draft text in the prompt
is saved and restored. Each pane maintains a _drafts map keyed
by session ID, so switching away and back preserves whatever
was typed.
2026-07-27 09:09:24 +02:00
Levi Neely b868fd5b9d gui: fix video embed - proper thumbnail, min height, correct property refs
- YouTube videos show hqdefault.jpg thumbnail
- All cards have minimum 200px height
- Play button opens in browser (fixed parent chain)
- Use id-based refs instead of fragile parent.parent chains
2026-07-18 18:52:02 +02:00
Levi Neely b9e02a972a gui: inline video embeds in chat
Detect video URLs (YouTube, Vimeo, Dailymotion, Twitch, direct media)
in chat responses. Direct .mp4/.webm/.ogv files play inline via
QtMultimedia Video. Other video sites show a card with play button
that opens in the system browser.

Adds Qt6::Multimedia dependency.
2026-07-18 18:46:35 +02:00
Levi Neely 513029005e gui: fix buttons not responding on first click
Replace full-pane MouseArea sloppy focus with HoverHandler which
does not interfere with click event delivery. Also increase timer
to 300ms and guard against redundant forceActiveFocus() calls.
2026-07-18 18:32:13 +02:00
Levi Neely caf547c4af ChatPane: remove read-only implicitWidth assignments on TextEdit
Qt 6 TextEdit.implicitWidth is computed from content and cannot be
assigned. Remove the three occurrences that caused the QML load error.
2026-07-17 23:28:21 +02:00
Levi Neely 131e875820 gui: add process detach support + Process Manager window
- OllieDBusClient: detachProcess, listDetached, signalDetached,
  getDetachedOutput, dismissDetached methods + D-Bus signal handlers
- ChatPane.qml: Detach button (visible during calling: state) +
  badge showing detached process count (click opens Process Manager)
- main.qml + main-kf5.qml: Process Manager window with process list,
  live output tail, Term/Kill/Dismiss buttons per process
2026-07-17 17:01:16 +02:00
Levi Neely 72185c5752 gui: text selection, copy z-index, scroll fix 2026-07-17 15:03:45 +02:00
Levi Neely e1e7422166 gui: BSP tiling split panes, sloppy focus, emoji selector, drag-swap headers
Full split-pane implementation:
- Ctrl+\ splits focused pane (BSP tree layout, alternating h/v)
- Ctrl+W closes focused pane (collapses parent split)
- Sloppy focus: pane focuses when mouse stops moving (100ms)
- Drag header to another pane to swap sessions
- Multi-line TextArea prompt with emoji shortcode completion
- Each pane has own ChatBlockModel and D-Bus signal filtering
- Auto-relayout on window resize
2026-07-16 23:28:39 +02:00
Levi Neely 2699044b3b gui: split-pane sessions (Ctrl+* to split, Ctrl+W to close)
Major refactor: extracted chat UI into ChatPane.qml (self-contained
with own ChatBlockModel, D-Bus signal filtering, prompt input).
Main content area is now a SplitView with dynamic pane creation.
Auto-layout: splits horizontal if window wider than tall.
Sidebar click updates the focused pane session.

New OllieDBusClient methods: getChat, getConfig, getState (per-session).
New signal: chatAppended (emitted for all sessions, not just active).
2026-07-16 22:35:35 +02:00