Commit Graph

425 Commits

Author SHA1 Message Date
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 e021724c52 remove tier routing: drop route/cascade/escalate tools and prompts 2026-07-18 16:55:33 +02:00
Levi Neely be2f3b3487 tools: explicit UTF-8 encoding for file_read, file_write, file_edit 2026-07-18 16:15:10 +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 89dba79dc1 prompts: elevation requires proven failure first 2026-07-17 16:04:07 +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 8e3418c4fe kate: navigate to applied line range after Apply 2026-07-16 21:54:07 +02:00
Levi Neely 0a6299783d agent-copilot: strict response format (brief prose + change blocks) 2026-07-16 21:44:49 +02:00
Levi Neely 0fa5522673 kate: apply button uses line ranges from fence metadata
Code fences with /path:start-end on the fence line get parsed.
Apply replaces that line range in the target file.
Fallback: insert at cursor or replace selection.
agent-copilot.md instructs model to produce ranged fences.
2026-07-16 21:41:31 +02:00
Levi Neely 0599fbceb7 kate: fix diff/apply URL scheme (use path not host to avoid QUrl IPv4 normalization) 2026-07-16 21:19:40 +02:00
Levi Neely 84b3123461 kate: fix context menu (use contextMenuAboutToShow signal, deduplicate actions)
Makefile: fix BUILD_DIR, install kate plugin to kf6/ path
prompts: clarify tools-elevate does NOT run as root
2026-07-16 21:07:39 +02:00
Levi Neely abec12e09f kate: editor integration — context menu, apply button, inline annotations
Context menu: right-click selection shows Fix/Refactor/Add tests/Document
actions that submit the selection with file+line context to the agent.

Apply button: code blocks in assistant messages get a clickable Apply
button that inserts the code into the target file (detected from
preceding prose) or the active document.

Inline annotations: file:line references in agent output are highlighted
with MovingRanges in the active editor view.
2026-07-16 20:44:46 +02:00
Levi Neely a12e00e231 add gui_media tool and docs 2026-07-16 20:33:23 +02:00
Levi Neely 4a29efc121 prompts: add tools-image.md for image_read tool 2026-07-16 20:13:33 +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 483981a9cd fix(gui): include emojis.js in Qt6 resource bundle
qt_add_resources was only bundling main.qml, causing ollie-gui to fail
at startup with 'Script qrc:/gui/emojis.js unavailable'.
2026-07-16 17:26:06 +02:00
Levi Neely 167e70531a gui: add copy button to call and tool blocks 2026-07-16 16:23:56 +02:00
Levi Neely 378ea83de7 kate: add kill session button in upper right 2026-07-16 14:50:47 +02:00
Levi Neely e2d02152e4 kate: fix chat scroll not pinning to bottom
setHtml() resets the document layout. sb->setValue(sb->maximum()) was
reading a stale maximum before relayout completed. Use moveCursor(End)
+ ensureCursorVisible() which forces layout and scrolls reliably.

Also: fix session list state updates destroying delegates (rename fix)
already included in previous commit.
2026-07-16 14:45:26 +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 d3c8aece38 kate: extract chat_renderer, simplify kate plugin 2026-07-16 08:57:55 +02:00
Levi Neely 59285cda9f gitignore: add CMakeFiles/ 2026-07-16 08:44:23 +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