Commit Graph

308 Commits

Author SHA1 Message Date
Levi Neely 857a919b64 streaming INI parser: ChatBlockModel with per-block decorations 2026-08-01 09:37:48 +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 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 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 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 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 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
Levi Neely 756e4086b3 gui: Ctrl+N new window shortcut + KF5 draft persistence
- Expose GuiActivator as "activator" context property
- Add Ctrl+N shortcut to open a new window (both KF5 and KF6)
- Add per-session draft text persistence to main-kf5.qml
  (KF6 ChatPane.qml already had this from previous commit)
2026-07-27 09:14:13 +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 325870e38c gui: support multiple windows in single instance
Running ollie-gui a second time now opens a new window in the
existing process (via NewWindow D-Bus method) instead of just
raising the existing window. The single-instance guard remains.

Each window gets its own ChatBlockModel via QML instantiation
(ChatPane.qml), so windows can display independent sessions.
2026-07-27 09:05:14 +02:00
Levi Neely 5b005c4126 gui/kf5: remove palette.placeholderText (Qt6-only property) 2026-07-24 12:07:26 +02:00
Levi Neely 325ff53a54 gui: sync kf5 with kf6 features
- New session dialog with backend/model picker (replaces folder-only)
- Error dialog connected to dbus.onErrorOccurred
- Video sub-delegate (thumbnail card, opens in browser)
- Session graph: stateColor helper, zoom-toward-mouse
- placeholderText in palette block
2026-07-24 12:05:35 +02:00
Levi Neely abd46c052e gui: model ComboBox populated by ListModelsByBackend on backend change 2026-07-21 15:32:54 +02:00
Levi Neely 726b3f29d7 gui: new session dialog with backend/model/cwd configuration
Replace simple folder picker with a full dialog. Adds listBackends()
and listModels() to OllieDBusClient. createSession() now accepts
backend and model parameters.
2026-07-21 15:27:59 +02:00
Levi Neely 10e39abc8e gui/plasmoid: show error dialog on CreateSession failure
Adds errorOccurred signal to OllieDBusClient, emitted when
CreateSession (or other async calls) fail. GUI shows a modal
dialog; plasmoid shows a passive notification.
2026-07-21 15:20:55 +02:00
Levi Neely 412d17dda3 krunner: open selected session in ollie-gui via SelectSession D-Bus call 2026-07-18 23:47:25 +02:00
Levi Neely 046665c684 gui: add copy button to detached process window
Copies stdout+stderr output of the selected process to clipboard.
2026-07-18 20:15:07 +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 7703d06430 gui: revert incremental parsing, use full reparse always
Incremental parsing caused phantom blocks and disappearing content.
The 150ms coalescing on the daemon side is sufficient for perf.
updateVisibleWindow() extraction kept for clean separation.
2026-07-18 18:12:10 +02:00
Levi Neely c46f38fc93 gui: fix incremental parser producing phantom tool_call blocks
When the tail contains only one header (common case during streaming),
just update the last block content directly. Fall back to full reparse
only when a genuinely new block boundary appears.
2026-07-18 18:04:42 +02:00
Levi Neely 7ccce95445 gui: incremental chat parsing during streaming
reparseIncremental() only re-parses from the last block boundary
instead of the entire chat text. Fixes UI lag and typing blockage
during long streaming responses.

Also extracted updateVisibleWindow() for reuse.
2026-07-18 17:36:36 +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 3aa751d8de gui: fix Process Manager scroll — use Flickable with contentHeight tracking
ScrollView + TextArea approach did not auto-scroll. Replaced with
Flickable that tracks contentHeight changes and scrolls to bottom
when pinned.
2026-07-17 22:22:49 +02:00
Levi Neely 6ea77c56c2 gui: auto-scroll output in Process Manager (pin to bottom) 2026-07-17 22:20:08 +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 d707dd3a56 kf5: fix build error and sync features with KF6
- kate: use KTextEditor::MovingInterface for newMovingRange() on KF5
- gui: rewrite main-kf5.qml with tiling panes, session graph, per-pane
  chat model, drag-to-swap, sloppy focus (matching KF6 ChatPane.qml)
2026-07-17 09:41:33 +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
Levi Neely 16c195b1a8 gui: session graph in separate window, pannable + zoomable 2026-07-16 22:14:32 +02:00
Levi Neely 6362e399bd gui: session topology graph
Circular node layout showing all sessions with peer relationship edges.
Nodes are color-coded by state (green=idle, blue=thinking, orange=calling),
pulse when active. Click a node to select that session.
Toggle between list and graph view in sidebar toolbar.
Adds peerList() to OllieDBusClient.
2026-07-16 22:06:08 +02:00
Levi Neely 5eb8f49d15 Activate the existing Ollie GUI instance 2026-07-16 19:58:15 +02:00
Levi Neely 9e0e5cb0f4 Improve KDE GUI file and command handling 2026-07-16 19:42:21 +02:00
Levi Neely 167e70531a gui: add copy button to call and tool blocks 2026-07-16 16:23:56 +02:00
Levi Neely f45cb8199d gui: close-to-tray option + fix session list disrupting rename
- Add configurable close-to-tray (Settings > System Tray)
  - QSystemTrayIcon with show/hide toggle and quit action
  - closeToTray property persisted in theme.conf
  - Window hides instead of quitting when enabled

- Fix session rename being interrupted by state changes
  - onStateChanged no longer calls refreshSessions()
  - State updates in-place via sessionStateUpdated signal
  - Delegates track state locally, preserving rename TextField
2026-07-16 14:34:14 +02:00
Levi Neely 1d646f7fab gui: fix flickering, add code exec button, fix bubble width, improve scroll
- Replace Qt.callLater scroll debounce with Timer (16ms) to coalesce
  rapid contentHeight changes and eliminate scroll flickering
- Add execute button (play icon) on code blocks for scripted languages
  (bash, python, perl, ruby, etc.) — launches in terminal
- Fix assistant bubble width: always use 95% of available width
- Add minimum width (280px) to code fence blocks
- Move emoji popup into prompt RowLayout so it appears near input
- Disable wheel scroll inertia (direct contentY) while keeping flick
  inertia intact
- Apply all fixes to both KF5 and KF6 QML files
2026-07-16 13:20:08 +02:00
Levi Neely 2929bb6b04 kde: visual enhancements, emoji completion, scroll/layout fixes
ollie-gui:
- Structured chat blocks (user/assistant bubbles, tool/call with left borders)
- Tool/call blocks always visible (not collapsible), whitespace preserved
- User interrupt blocks (amber warning style)
- Copy buttons on bubbles (32x32, hover-visible)
- Emoji completion with popup selector + quick emoticons
- Backend/model display in header bar
- Session state updates on switch
- Scroll flicker fix (debounced, guarded)
- Null guards on delegate block properties
- Binding loop fixes

Kate plugin:
- Diff viewer integration via Kate DiffWidget (libkateprivate)
- Diff mode config (unified/side-by-side/raw)
- Emoji processing in prompt input (quick emoticons + :shortcode:)
- Increased chat font size
- Scroll position preservation

Dbus client:
- activeModel/activeBackend properties from GetConfig
2026-07-16 11:19:22 +02:00
Levi Neely f6b218bef7 kf5: sync gui with kf6 features, fix install paths
- main-kf5.qml: port all KF6 gui enhancements (chat bubbles, structured
  blocks, markdown, syntax highlighting, diff coloring, collapsible
  call/tool blocks, lazy-load scrolling)
- CMakeLists.txt: add chatblockmodel.cpp and KF5::SyntaxHighlighting to
  KF5 gui target; fix Kate plugin INSTALL_NAMESPACE (ktexteditor, not
  kf5/ktexteditor or kf6/ktexteditor)
- Makefile: fix KF6 kate install path; add icon+desktop to kf5-install
- main.qml + main-kf5.qml: fix prose font size (use root.font.pointSize
  instead of Qt.application.font.pixelSize)
2026-07-16 08:43:25 +02:00
Levi Neely f546c8cf69 move You/Ollie labels below bubbles 2026-07-16 07:38:56 +02:00
Levi Neely a0fae46417 chat bubble styling for user and assistant messages
- User messages: right-aligned bubble, accent-tinted (15%), max 85% width
- Assistant messages: left-aligned bubble, subtle text-color tint (6%), max 95% width
- Both have 12px radius, 12px internal padding
- Small "You" / "Ollie" labels above each bubble
- Tool/call/reasoning blocks remain unchanged (collapsed, no bubble)
2026-07-16 07:34:33 +02:00
Levi Neely dfca04e734 all blocks use markdown rendering by default
- Tool blocks: expanded via sub-blocks (same as assistant) so embedded
  diffs and code fences render properly with coloring
- Call blocks: always JSON, use formattedContent (pretty-print + highlight)
- Prose sub-blocks use Text.MarkdownText for native backtick/bold/link support
2026-07-16 07:29:30 +02:00
Levi Neely 7f226e2012 tool blocks: use sub-block rendering (same as assistant)
Tool results often contain markdown with code fences and diffs.
Using formattedContent treated the whole block as raw text.
Now tool blocks expand into parsed sub-blocks (prose, code, diff)
just like assistant blocks, so embedded diffs get colored.
2026-07-16 07:27:33 +02:00
Levi Neely c907aee653 use Qt native MarkdownText for prose blocks
Stop hand-rolling markdown with regex. Qt 6 Text supports
textFormat: Text.MarkdownText natively — handles backticks,
bold, italic, links, lists correctly. Code blocks and diffs
still use our custom KSyntaxHighlighting rendering.
2026-07-16 07:23:41 +02:00
Levi Neely cc24400ba7 fix indentation: wrap highlighted HTML in <pre> with white-space:pre-wrap
HTML RichText collapses multiple spaces, destroying JSON indentation.
Wrap all highlighted output in <pre> tags and use real newlines instead
of <br>. pre-wrap allows wrapping at container width.
2026-07-16 07:20:55 +02:00
Levi Neely 5c093a3bb2 fix syntax highlighting: use AbstractHighlighter directly
QSyntaxHighlighter applies colors to the layout only (not accessible
via QTextBlock iteration). Replace with a custom AbstractHighlighter
subclass (HtmlBuilder) that builds HTML directly in applyFormat().
This actually produces colored output.
2026-07-16 07:19:09 +02:00
Levi Neely 9f365f49b0 fix backtick regex: prevent matching across newlines 2026-07-16 07:09:16 +02:00
Levi Neely 93c9bd995e move call/tool formatting entirely to C++ via formattedContent role
QML scope issues made JS-based formatting unreliable. New approach:
- FormattedContentRole in the model computes pretty-printed HTML in C++
- Call blocks: always prettyJson()
- Tool blocks: detect JSON/diff and format, otherwise escaped HTML
- QML just binds text: block.formattedContent || ""
2026-07-16 07:07:51 +02:00
Levi Neely 7cd46337a3 render inline \`code\` in monospace with subtle background 2026-07-16 07:04:46 +02:00
Levi Neely c2ff88e8e6 fix: String() conversion for block.blockContent, avoid ES2019 methods
blockContent from QVariant needs explicit String() conversion.
Use charAt/indexOf instead of startsWith (ES6 compat).
2026-07-16 07:03:40 +02:00
Levi Neely 38df1a8e32 fix TypeError: guard against undefined blockContent in tool/call delegates 2026-07-16 07:02:04 +02:00
Levi Neely c39e0f2723 fix call/tool pretty-print: use C++ prettyJson() with QJsonDocument
The onVisibleChanged approach failed because block.blockContent could
not resolve through the Loader scope. Now using direct binding:
- call blocks: text bound to chatModel.prettyJson(block.blockContent)
- tool blocks: detect JSON/diff, format accordingly
- prettyJson() uses QJsonDocument for proper indentation + KSyntaxHighlighting
- Only evaluated when visible (lazy)
2026-07-16 07:00:40 +02:00
Levi Neely ee3a0a1e76 pretty-print + syntax highlight call/tool blocks
Call blocks: always pretty-print JSON + highlight on expand.
Tool blocks: detect JSON/diff and highlight accordingly.
2026-07-16 06:56:14 +02:00
Levi Neely 481f7f9d76 toggle arrow direction on collapsible blocks (▶/▼) 2026-07-16 06:54:06 +02:00
Levi Neely d7a66f1827 replace ListView with Flickable+Column+Repeater
ListView.positionViewAtEnd() causes freezes by forcing instantiation
of all delegates to measure total height. Flickable+Column avoids this
- contentHeight is computed directly from Column.implicitHeight
- Scroll to bottom is just contentY = contentHeight - height
- No virtualization needed with only 20 blocks
- Eliminates all positionViewAtEnd and _scrolling guard complexity
2026-07-16 06:51:37 +02:00
Levi Neely 79656596e4 fix startup freeze: async highlighting + reduce initial blocks to 20
- Code blocks show plain text immediately, highlight via Timer after
  150ms (prevents blocking the render thread during initial load)
- Reduced initial blocks from 40 to 20
- Detect append vs full reset in setRawText for better session switch
2026-07-16 06:49:20 +02:00
Levi Neely f122a69bce reverse-scroll chat: start at bottom, lazy-load on scroll up
- Model shows last 40 blocks initially, positioned at end
- Scrolling near top triggers loadEarlier() which prepends 30 blocks
- Scroll position maintained after prepend via contentY adjustment
- All blocks still parsed (for searching later) but only tail rendered
- Reduced initial render cost significantly
2026-07-16 06:46:47 +02:00
Levi Neely f1a045077b limit visible blocks to 80 + reduce cacheBuffer for startup perf
With 300KB+ chat logs producing hundreds of blocks, instantiating all
delegates was causing unresponsiveness. Cap the model at the last 80
blocks and set cacheBuffer: 200 to limit off-screen rendering.
2026-07-16 06:44:11 +02:00
Levi Neely 6f351b77e4 fix performance: cache subBlocks and syntax highlighting
- Cache parseSubBlocks per block (only reparse when content changes)
- Cache highlightedHtml results (code+language key)
- Prevents expensive KSyntaxHighlighting and regex on every render
- Also fixes scroll loop with _scrolling guard
2026-07-16 06:42:11 +02:00
Levi Neely a6a1a227c3 fix scroll: incremental model updates + prevent scroll loop
- ChatBlockModel::reparse() now does incremental diffs instead of
  beginResetModel which destroys all delegates and resets scroll
- ListView scroll uses _scrolling guard to prevent infinite loop
  from positionViewAtEnd triggering contentHeightChanged
2026-07-16 06:38:37 +02:00
Levi Neely 0783c7dda3 fix scroll height and prose line breaks in rich output
- Loader delegate: set explicit height from item.implicitHeight so
  ListView can calculate correct contentHeight for scrolling
- Prose sub-blocks: escape HTML, convert newlines to <br> before
  linkifying paths (RichText ignores bare newlines)
2026-07-16 06:36:00 +02:00
Levi Neely 9e10bf30db fix: Text has no background property, wrap diff lines in Rectangle 2026-07-16 06:31:02 +02:00
Levi Neely 6e03064d0f rich output rendering for ollie-gui
Replace flat TextArea chat view with structured ListView:
- ChatBlockModel parses raw chat text into typed blocks (user,
  assistant, reasoning, call, tool, error, info)
- Sub-blocks parsed from markdown: prose, fenced code, diffs
- Code blocks rendered with KSyntaxHighlighting (auto light/dark theme)
- Diff blocks with red/green line coloring
- Copy button on code and diff blocks
- File paths linkified and clickable (opens with xdg-open)
- Reasoning/call/tool blocks collapsible (click to expand)
- User blocks highlighted with subtle accent background
- Error blocks in red
- Scroll pinning preserved (auto-scroll when at bottom)
2026-07-16 06:29:18 +02:00
Levi Neely 6642ab014b multi-line prompt input across all front-ends
Replace single-line TextField/QLineEdit with multi-line TextArea/QPlainTextEdit.
Enter sends, Shift+Enter and Ctrl+J insert newlines. Max height capped so the
input area does not take over the panel.
2026-07-16 06:19:14 +02:00
Levi Neely 7b8fa5eca4 support arbitrary color schemes in ollie-gui
Scan ~/.local/share/color-schemes/ in addition to /usr/share/color-schemes/
so user-installed themes (e.g. Catppuccin) are discovered. Mode is now any
scheme name rather than just system/light/dark. Settings dialog uses a
ComboBox listing all available schemes plus "System".
2026-07-16 06:08:41 +02:00
Levi Neely fcc3cd2313 kate stop button, sorted sessions, scroll pinning, install fix
- Kate: add always-visible stop button next to prompt input
- All front-ends: sort sessions alphabetically by ID
- All front-ends: only auto-scroll chat if at bottom, show
  floating go-to-bottom button when scrolled away
- CMakeLists: set KDE_INSTALL_PLUGINDIR to QT6_INSTALL_PLUGINS
  so plugins install to lib64/qt6/plugins/ (where Kate looks)
2026-07-16 06:03:15 +02:00
Levi Neely 45419393ae gui: allow text selection in chat area
- Enable selectByMouse on chatArea TextArea
- Only auto-scroll to bottom when no text is selected
2026-07-10 11:43:48 +02:00
Levi Neely dc1816f023 gui: fix Qt5/KF5 compatibility
- Remove placeholderText from QML palette block (not available in Qt5)
- Use theme.placeholderTextColor directly instead of palette.placeholderText
- Add Qt version guards for QFontDatabase static vs instance API
- Add Qt version guard for QVariant::typeId vs QVariant::type
- Link KF5::ConfigCore for ollie-gui KF5 build
2026-07-09 11:26:10 +02:00
Levi Neely 7f93543e56 gui: theme manager with KDE color schemes, font settings, and native folder dialogs 2026-07-09 00:07:47 +02:00
Levi Neely 86518c75fe fix: prefer theme icon over font-rendered fallback
Use QIcon::fromTheme("ollie") if available, which loads the SVG
from hicolor. Falls back to FA font rendering if the theme icon
is not installed.
2026-07-08 21:13:57 +02:00
Levi Neely c2df43749e fix: use visible pink color for brain icon
#eeeeee was invisible on light/transparent backgrounds.
2026-07-08 21:11:37 +02:00
Levi Neely 75e518dd5f fix: use concrete fill color in icon SVG
currentColor only works with Breeze icon engine color substitution,
not with generic hicolor theme loaders.
2026-07-08 21:08:49 +02:00
Levi Neely a66b9984e3 fix: use proper vector path for brain icon SVG
Extracted path data from FA6 OTF directly. The text-based SVG
did not render because icon loaders do not support font rendering
in SVG text elements.
2026-07-08 20:58:37 +02:00
Levi Neely 74f51519f6 feat: add .desktop file and icon for task manager persistence
Installs ollie.svg to hicolor scalable apps and org.ollie.gui.desktop
to /usr/share/applications. Sets desktopFileName so Plasma can match
the running window to the .desktop entry when pinned.
2026-07-08 20:52:10 +02:00
Levi Neely 5984dec374 feat: render FA6 brain glyph as window icon 2026-07-08 20:08:00 +02:00
Levi Neely 8a644d8d7c feat: add ollie-gui QtQuick standalone application
Session list with create/kill/rename, chat view, prompt input,
folder dialogs for cwd. Reuses OllieDBusClient from plasmoid plugin.
Supports both Qt5 (KF5) and Qt6 (KF6) builds.
2026-07-08 19:46:10 +02:00