Commit Graph

368 Commits

Author SHA1 Message Date
Levi Neely e86b09447b gui: use FileDialog instead of QtQuick.Dialogs 1.15
- Remove import of QtQuick.Dialogs 1.15 (not available on Gentoo)
- Replace FolderDialog with FileDialog { selectFolder: true }
- FileDialog is part of QtQuick.Controls 2.x which is already imported
2026-08-01 11:56:37 +02:00
Levi Neely 774c3d4d77 gui: new session dialog with directory, backend, model, agent, remote fields
- Add C++ methods: loadRootBackends(), loadRootAgents(), getAvailableModels(), createSession()
- Add Q_PROPERTYs for root data state (backends, agents, models)
- Add '+' button to sessions toolbar
- Create New Session Dialog with:
  - Directory field + Browse button (FolderDialog)
  - Name field (optional, auto-generated if empty)
  - Backend combo (populated from /backends)
  - Model combo (filtered by selected backend)
  - Agent combo (populated from /agents)
  - Remote field (user@host:port)
- Root data loaded lazily on startup
- OK creates session via 'write new' 9P call and refreshes list
2026-08-01 11:55:17 +02:00
Levi Neely 69458631dc gui: fix session tree view delegate crashes and scrollable input
- Guard delegate against undefined properties during initial render
- Use || 0 fallbacks for optional model properties
- Remove broken ScrollBar.vertical.value assignment (not assignable)
- Fix Keys.onReturnPressed to use explicit function(event) parameter
- Call buildSessionTree() on Component.onCompleted
2026-08-01 11:48:59 +02:00
Levi Neely 3cedf602be gui: session tree view with agent sub-elements
- Add getAgents() to Ollie9pClient for listing agents per session
- Add switchAgent() for switching sessions+agents atomically
- Add activeAgentId property and activeAgentIdChanged signal
- Replace flat ListView with tree-aware model (session → agents)
- Session nodes expandable/collapsible with ▶/▼ indicator
- Agent nodes indented, clickable to activate that agent
- Active agent highlighted, active session auto-expanded
- State dots on both session and agent rows
2026-08-01 11:43:55 +02:00
Levi Neely a0f71a01c2 gui: wrap prompt input in ScrollView for scrollable multi-line text area
- TextArea grows from 5 rows up to 200px as content increases
- Auto-scrolls to bottom on text change
- Uses Math.min(contentHeight, max) to avoid unnecessary space
2026-08-01 11:39:21 +02:00
Levi Neely 24edd5941a gui: syntax-highlight fenced code/diff blocks at stream end
- Add fence state machine (NoFence → InFence) to ChatBlockModel
- On closing ```, render via KSyntaxHighlighting or inline diff colorizer
- Store rendered HTML in ChatBlock.renderedHtml, emit dataChanged on RenderedHtmlRole
- QML shows RichText Label when renderedHtml is populated, falls back to PlainText
- Add KF6::SyntaxHighlighting dependency for ollie-gui target
2026-08-01 11:36:43 +02:00
Levi Neely 1aa1455f33 state indicator: simple forever-loop via statewait subprocess 2026-08-01 11:16:19 +02:00
Levi Neely de835e9e6e fix QProcess pipe deadlock: drain stdout in run9p while waiting 2026-08-01 10:38:56 +02:00
Levi Neely 95d6da75f6 fix scroll: use named Timer instead of Timer.singleShot (scope issue) 2026-08-01 10:23:24 +02:00
Levi Neely 50c3b5979c fix streaming scroll: use Timer.singleShot + positionViewAtIndex 2026-08-01 10:20:50 +02:00
Levi Neely df41aad5cb trim chat to last 30 blocks on initial load and session switch 2026-08-01 10:19:22 +02:00
Levi Neely 2d2ba1eeaf fix scroll: defer positionViewAtEnd to after layout 2026-08-01 10:17:52 +02:00
Levi Neely 2bd7a2dca0 apply full theme palette to ApplicationWindow for system-wide consistency 2026-08-01 10:15:04 +02:00
Levi Neely 207eaf4f9d header colors derive from base background, light/dark aware 2026-08-01 10:13:27 +02:00
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