Commit Graph

31 Commits

Author SHA1 Message Date
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 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 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 7f93543e56 gui: theme manager with KDE color schemes, font settings, and native folder dialogs 2026-07-09 00:07:47 +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