Commit Graph

20 Commits

Author SHA1 Message Date
Levi Neely 78938cb220 gui: fix chat not reloading on session switch
The C++ connection mapping activeSessionIdChanged to chatModel->reset()
raced against the QML onActiveSessionIdChanged handler which does the
actual reload (reset → readLogForSession → appendData → trimFront).
When the C++ slot fired after the QML handler, it cleared the freshly
loaded chat data.

Remove the redundant C++ connection — the QML handler owns the full
reset+reload sequence and sequences the 9P log read correctly.
2026-08-01 16:19:59 +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 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 9cf63f67b4 gui: fix ghost process, null block.reaction crash, window counter 2026-07-27 21:32:31 +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 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 412d17dda3 krunner: open selected session in ollie-gui via SelectSession D-Bus call 2026-07-18 23:47:25 +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 5eb8f49d15 Activate the existing Ollie GUI instance 2026-07-16 19:58:15 +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 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 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 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