Commit Graph

66 Commits

Author SHA1 Message Date
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