Commit Graph

92 Commits

Author SHA1 Message Date
Levi Neely b13dc6064b gui: make session tree fully expanded by default and responsive
- Remove 300ms click delay (timer-based single/double-click disambiguation)
- Use native QML onDoubleClicked for rename instead of timer hack
- Capture model index as delegate property to fix rename targeting all nodes
- Remove dead rename code that was orphaned by the timer removal
- Clean up Escape shortcut handler
2026-08-01 16:40:45 +02:00
Levi Neely 120e4a4bd6 gui: revert reasoning block suppression in QML (handled server-side now) 2026-08-01 16:28:21 +02:00
Levi Neely 9ba1de0c1c gui: preserve session tree expansion across agent switches
buildSessionTree() was clearing the tree and setting expanded=true
only for the active session, collapsing all other sessions whenever
an agent in a different session was selected.

Now snapshot expanded state before clearing and restore it, so manually
expanded sessions stay open across agent switches.
2026-08-01 16:16:55 +02:00
Levi Neely cd0f92e16d session rename: fix renameSession, use setProgram/setArguments 2026-08-01 15:53:03 +02:00
Levi Neely 4bd7a60e78 session rename: clean up comment, use ollie-9p mv 2026-08-01 15:50:31 +02:00
Levi Neely 63cf13b891 session rename: double-click to rename sessions in tree 2026-08-01 15:47:23 +02:00
Levi Neely 95cf201f4c remove inline autocomplete state machine from prompt input 2026-08-01 13:07:43 +02:00
Levi Neely 9bab0e73c2 fix: use promptInput.text instead of bare text in root-level autocomplete functions 2026-08-01 13:00:24 +02:00
Levi Neely 1d26552675 fix: remove duplicate property declarations from TextArea 2026-08-01 12:59:19 +02:00
Levi Neely 7358e10667 fix: missing closing brace for ApplicationWindow 2026-08-01 12:58:56 +02:00
Levi Neely 2af7d65f4e convert slash autocomplete to inline text expansion with LCP and arg completion 2026-08-01 12:56:32 +02:00
Levi Neely cb5ddc6e1a fix: remove non-existent elevation property from completion popup 2026-08-01 12:49:55 +02:00
Levi Neely 64afb587e3 add slash command autocomplete: popup, model/backend completions, keyboard nav 2026-08-01 12:47:37 +02:00
Levi Neely 3a33c4e42a add retry block support: Retry type, header color, expanded default 2026-08-01 12:45:33 +02:00
Levi Neely 80b5b1dd5d gui: expand info blocks by default 2026-08-01 12:26:38 +02:00
Levi Neely 3255522144 gui: replace backend/model text fields with editable ComboBoxes, make chat blocks collapsible
- New session dialog: Backend and Model now use proper ComboBoxes with
  editable=true so users can type or select from dropdown
- Backend picker and model picker dialogs removed (no longer needed)
- Model list populated reactively via Connections on backend selection
- Fix model caching: m_rootModels[be].toStringList() returns a copy;
  extract to local QStringList, append, store back into map
- Session creation uses correct path 'session/new' instead of 'new'
- Chat blocks are now collapsible: user/assistant/tool expanded by default,
  reasoning/call/error/info/default collapsed
- Fix chat history on session switch: readLogForSession() reads from the
  explicit session/agent path instead of relying on active state
- Fix delegate layout: use plain ColumnLayout instead of Item-wrapped
  ColumnLayout so ListView calculates implicit heights correctly
2026-08-01 12:25:36 +02:00
Levi Neely 65dee58a6a gui: remove Stop button (ESC handles it) and debug logs 2026-08-01 12:05:34 +02:00
Levi Neely 5615f69d11 gui: use Shortcut for ESC key instead of Keys handler
- Keys.onEscapePressed doesn't fire when child items have focus
- Shortcut element provides proper global key handling
- Added console.log debugging to track ESC activation and activeState
2026-08-01 12:04:27 +02:00
Levi Neely ef63dfd398 gui: ESC key interrupts active agent (Stop action) 2026-08-01 12:03:29 +02:00
Levi Neely cc472da496 gui: sessions pane 15% of window (min 300px) 2026-08-01 12:01:40 +02:00
Levi Neely da31ca05f1 gui: make sessions pane width 30% of window (min 150px) 2026-08-01 12:01:16 +02:00
Levi Neely ff9bf89bcc gui: increase sessions pane default/min width to 240px 2026-08-01 12:00:52 +02:00
Levi Neely 7d75ba8524 gui: preserve original indentation in fenced code/diff blocks
- C++: Use <pre style="white-space:pre-wrap;"> instead of <div> with <br>
  so raw newlines are preserved through to the HTML renderer
- QML: Use TextEdit (preserves whitespace) instead of Label (collapses it)
  for rendering blockRenderedHtml
2026-08-01 12:00:14 +02:00
Levi Neely 7f083c0d7a gui: replace backend/model ComboBoxes with TextField + picker dialogs
- Backend: TextField with '...' button opens ListView of available backends
- Model: TextField with '...' button opens ListView filtered by selected backend
- Auto-populate model placeholder when backend text changes
- Model picker also works on manual click for re-selection
- Update onAccepted to use field.text instead of combo.currentText
2026-08-01 11:59:11 +02:00
Levi Neely e86b09447b gui: use FileDialog instead of QtQuick.Dialogs 1.15
- Remove import of QtQuick.Dialogs 1.15 (not available on Gentoo)
- Replace FolderDialog with FileDialog { selectFolder: true }
- FileDialog is part of QtQuick.Controls 2.x which is already imported
2026-08-01 11:56:37 +02:00
Levi Neely 774c3d4d77 gui: new session dialog with directory, backend, model, agent, remote fields
- Add C++ methods: loadRootBackends(), loadRootAgents(), getAvailableModels(), createSession()
- Add Q_PROPERTYs for root data state (backends, agents, models)
- Add '+' button to sessions toolbar
- Create New Session Dialog with:
  - Directory field + Browse button (FolderDialog)
  - Name field (optional, auto-generated if empty)
  - Backend combo (populated from /backends)
  - Model combo (filtered by selected backend)
  - Agent combo (populated from /agents)
  - Remote field (user@host:port)
- Root data loaded lazily on startup
- OK creates session via 'write new' 9P call and refreshes list
2026-08-01 11:55:17 +02:00
Levi Neely 69458631dc gui: fix session tree view delegate crashes and scrollable input
- Guard delegate against undefined properties during initial render
- Use || 0 fallbacks for optional model properties
- Remove broken ScrollBar.vertical.value assignment (not assignable)
- Fix Keys.onReturnPressed to use explicit function(event) parameter
- Call buildSessionTree() on Component.onCompleted
2026-08-01 11:48:59 +02:00
Levi Neely 3cedf602be gui: session tree view with agent sub-elements
- Add getAgents() to Ollie9pClient for listing agents per session
- Add switchAgent() for switching sessions+agents atomically
- Add activeAgentId property and activeAgentIdChanged signal
- Replace flat ListView with tree-aware model (session → agents)
- Session nodes expandable/collapsible with ▶/▼ indicator
- Agent nodes indented, clickable to activate that agent
- Active agent highlighted, active session auto-expanded
- State dots on both session and agent rows
2026-08-01 11:43:55 +02:00
Levi Neely a0f71a01c2 gui: wrap prompt input in ScrollView for scrollable multi-line text area
- TextArea grows from 5 rows up to 200px as content increases
- Auto-scrolls to bottom on text change
- Uses Math.min(contentHeight, max) to avoid unnecessary space
2026-08-01 11:39:21 +02:00
Levi Neely 24edd5941a gui: syntax-highlight fenced code/diff blocks at stream end
- Add fence state machine (NoFence → InFence) to ChatBlockModel
- On closing ```, render via KSyntaxHighlighting or inline diff colorizer
- Store rendered HTML in ChatBlock.renderedHtml, emit dataChanged on RenderedHtmlRole
- QML shows RichText Label when renderedHtml is populated, falls back to PlainText
- Add KF6::SyntaxHighlighting dependency for ollie-gui target
2026-08-01 11:36:43 +02:00
Levi Neely 95d6da75f6 fix scroll: use named Timer instead of Timer.singleShot (scope issue) 2026-08-01 10:23:24 +02:00
Levi Neely 50c3b5979c fix streaming scroll: use Timer.singleShot + positionViewAtIndex 2026-08-01 10:20:50 +02:00
Levi Neely df41aad5cb trim chat to last 30 blocks on initial load and session switch 2026-08-01 10:19:22 +02:00
Levi Neely 2d2ba1eeaf fix scroll: defer positionViewAtEnd to after layout 2026-08-01 10:17:52 +02:00
Levi Neely 2bd7a2dca0 apply full theme palette to ApplicationWindow for system-wide consistency 2026-08-01 10:15:04 +02:00
Levi Neely 207eaf4f9d header colors derive from base background, light/dark aware 2026-08-01 10:13:27 +02:00
Levi Neely 68e7dfa7c2 chat blocks use theme palette colors instead of hardcoded 2026-08-01 10:11:53 +02:00
Levi Neely 873ad9ae23 chat blocks respect font setting; use pointSize for DPI scaling 2026-08-01 10:04:49 +02:00
Levi Neely e03488e6bb add settings dialog (color scheme, font family/style/size) 2026-08-01 10:02:16 +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 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 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 d183b489d5 gui: add Ctrl+Q shortcut to quit 2026-07-27 09:42:13 +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 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 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