Commit Graph

204 Commits

Author SHA1 Message Date
Levi Neely 68e7dfa7c2 chat blocks use theme palette colors instead of hardcoded 2026-08-01 10:11:53 +02:00
Levi Neely 873ad9ae23 chat blocks respect font setting; use pointSize for DPI scaling 2026-08-01 10:04:49 +02:00
Levi Neely e03488e6bb add settings dialog (color scheme, font family/style/size) 2026-08-01 10:02:16 +02:00
Levi Neely da1f7f02dd restore ThemeManager (color scheme, font settings) from git history 2026-08-01 09:57:39 +02:00
Levi Neely 857a919b64 streaming INI parser: ChatBlockModel with per-block decorations 2026-08-01 09:37:48 +02:00
Levi Neely b28921c39f fix qt_add_resources: add BASE gui so main.qml is at qrc:/main.qml 2026-08-01 08:43:41 +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 f5ccaf13bd kate: start chat/state streams on session switch
switchToSession() was loading the log but never starting the
streaming processes. New output from the agent was never delivered.
Now: stopStreams → load log → startChatStream + startStateStream.
2026-07-31 20:33:19 +02:00
Levi Neely 4f1c1f7222 gui: fix session switch — emit signals after agent ID discovery
Signals were emitted before m_agentId was set, causing QML's
onActiveSessionIdChanged handler to call readLog() with an empty
agent path. Now: discover agent → emit signals → start streams.
2026-07-31 20:30:17 +02:00
Levi Neely 1ceeeeb39c kate: complete 9P conversion, remove all D-Bus dependencies
Replace all 28+ D-Bus call sites with 9P operations via plan9port's
9p command. Chat streaming via persistent QProcess reading the chat
file. State updates via statewait process restart loop.

Ghost text provider disabled (needs separate 9P port).

The entire KDE submodule is now D-Bus-free for server communication.
D-Bus is only used internally by KDE frameworks (KRunner plugin loading,
KStatusNotifierItem, etc.) — not for ollie protocol.
2026-07-31 20:25:04 +02:00
Levi Neely e89b723627 kill D-Bus: krunner+tray use 9P, remove plasmoid+tray, disable kate
- KRunner: rewritten to use plan9port 9p command for all operations
  (list sessions, kill, one-shot generate). No D-Bus dependency.

- Tray: removed. Was a thin D-Bus status wrapper, not useful enough
  to justify maintaining.

- Plasmoid: removed. GUI is standalone now.

- Kate: temporarily disabled in CMake. Header partially converted to
  9P (D-Bus includes removed, QProcess/9P helpers declared). Full
  conversion is next.

- All ninepBin() helpers use $PLAN9/bin/9p (not hardcoded path).

- CMake: removed Qt5::DBus, KF5::Notifications, KF5::Plasma deps.
  Only remaining link deps: Qt5::Core, Qt5::Widgets, Qt5::Quick,
  Qt5::QuickControls2, KF5::Runner.
2026-07-31 20:16:25 +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 f00ed7738d kate: fix crash in onSessionKilled
QTextDocument::setHtml was called while the document was still
tearing down from clear(). Defer refreshSessions to the next
event loop iteration with QTimer::singleShot(0, ...).
2026-07-31 16:34:33 +02:00
Levi Neely 5dfdd2bd31 gui: add remote field to new session dialog
Allow specifying a remote target (e.g. user@host) when creating a
session from the GUI. Empty means local execution. The value is passed
through to the D-Bus CreateSession method's remote parameter.
2026-07-31 10:54:40 +02:00
Levi Neely 17f9d30aaa gui: remove reaction UI artifacts
Reactions were removed from the core runtime. Remove the dead QML code:
- 3x setReactions/getReactions dbus calls
- blockReaction property on delegate loader
- Reaction badge label and reaction buttons row
2026-07-31 09:19:45 +02:00
Levi Neely 5bdab3c616 remove emoji reaction feature (KDE GUI) 2026-07-31 09:09:30 +02:00
Levi Neely d473fb4e4c justfile: fix paths relative to submodule root
just -f runs recipes from the directory containing the justfile, not
from cwd.  Strip the kde/ prefix from all paths.
2026-07-30 20:50:39 +02:00
Levi Neely 1d6055c444 add standalone justfile for decoupled builds 2026-07-30 19:35:53 +02:00
Levi Neely 75b9a5ffb1 kate: fix segfault in clearAnnotations on document close
MovingRanges are owned by the document. When the document is destroyed,
it deletes its ranges. If clearAnnotations is called after the document
is gone (e.g., view changed), qDeleteAll double-frees. Track the owning
document with QPointer and only delete ranges if it's still alive.
2026-07-30 17:05:56 +02:00
Levi Neely 1a6aab7a13 gui: populate model list on dialog open
When the new-session dialog opens, the backend combo defaults to index 0
but onCurrentTextChanged doesn't fire for the initial value. Explicitly
call listModelsByBackend for the default backend so the model dropdown
is populated immediately.
2026-07-30 16:29:50 +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 c76a144de2 diagrams: re-enable mermaid server via /img/ (raster) endpoint
The mermaid container has been replaced with a proper mermaid.ink
server. Use /img/ endpoint (returns JPEG) instead of /svg/ since
Qt's SVG renderer can't handle CSS class-based styles. Falls back
to mmdc CLI with PNG output if server is unavailable.
2026-07-29 16:40:18 +02:00
Levi Neely a598d0c5cc diagrams: render mermaid as PNG instead of SVG
Qt's SVG renderer doesn't support CSS class-based styling that mermaid
generates (<style> blocks with class selectors). This caused text and
connectors to be invisible — they had no fill/stroke applied.

Fix: output PNG from mmdc for mermaid diagrams. Qt renders PNG perfectly.
PlantUML and Draw.io continue using SVG (they use inline styles).
2026-07-29 16:38:34 +02:00
Levi Neely 3b27bccdda diagrams: force light theme for mermaid rendering
Text and connectors were invisible because mmdc rendered with a dark
theme (white text/edges) on the white diagram background. Explicitly
pass -t default to force dark text on light background.
2026-07-29 16:25:36 +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 b591640b65 gui: refresh session list on ConfigChanged D-Bus signal
Connect the new ConfigChanged signal from the session manager to trigger
refreshSessions() and fetchConfig(), so the sidebar updates immediately
when the user runs /agent to switch agents.
2026-07-29 11:04:06 +02:00
Levi Neely 5bc480c706 gui-kf5: fix reaction badge not updating via reactive property
In Qt5 Repeater delegates, 'property var block: model' doesn't
propagate dataChanged updates for individual roles. Add a reactive
'blockReaction' string property bound to model.reaction directly,
which updates when the model emits dataChanged.
2026-07-29 09:43:57 +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 c5a5c0c9b9 add agent selector to new session dialog 2026-07-27 20:43:05 +02:00
Levi Neely 1cce42f2d6 fix: setReactions updates blocks in-place with dataChanged signal 2026-07-27 19:50:53 +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 6e02ea4ca3 fix: update assistant block reaction badge on incremental parse 2026-07-27 19:33:15 +02:00
Levi Neely 042acf347e fix: parse reaction markers from [user] block content 2026-07-27 19:30:10 +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 7b59e11f6d kf5: add emoji reaction buttons on assistant messages
Reaction buttons (👍👎🚀💩🤔) appear on hover over assistant chat
bubbles. Clicking one calls the React D-Bus method which records
the feedback in session history without triggering a model turn.

Also adds react() to OllieDBusClient.
2026-07-27 15:33:33 +02:00
Levi Neely 582ea51126 kf5: replace sloppy focus with click-to-focus
The hover-based sloppy focus timer was stealing focus from buttons
via paneRoot.focus=true every 100ms of mouse movement, making
buttons very hard to click.

Replace with a click-to-focus MouseArea that only updates the
focusedPaneIndex on actual clicks, with mouse.accepted=false
so clicks propagate to the target widget normally.
2026-07-27 15:28:40 +02:00
Levi Neely d6c3e82dc8 kf5: fix buttons not responding to first click
The sloppy focus timer was calling panePrompt.forceActiveFocus()
on mouse movement, stealing focus from button clicks. Remove the
auto-focus; add Ctrl+L shortcut to focus the prompt input instead.
2026-07-27 15:21:48 +02:00
Levi Neely d183b489d5 gui: add Ctrl+Q shortcut to quit 2026-07-27 09:42:13 +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 4392c7ec7b gui: add session name field to New Session dialog
Optional name field in the dialog. If provided, the session is
renamed immediately after creation via RenameSession D-Bus call.
Left blank, the auto-generated ID is used as before.
2026-07-27 09:25:00 +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