Commit Graph
59 Commits
Author SHA1 Message Date
blumia 695d27cdd7 feat: preview the host's dev servers through the dev tunnel
- loopback dev-server URLs are no longer opened on the phone's network: the
  panel binds a local 127.0.0.1 TCP listener and pipes each connection over
  an authenticated WebSocket to the host's /api/dev-tunnel, which dials its
  own loopback port; the WebView keeps the original address in the bar while
  the page, absolute URLs, cookies and HMR sockets use the tunneled origin
- the empty state lists /api/dev-servers results for the project (only ports
  that answered with a web page), with title, URL and command; tapping one
  opens it through the tunnel
- relay transports mint oc_url_token themselves; a direct connection mints
  and caches /auth/url-token and also sends the bearer
- a new loopback port opened from a tunnelled page gets its own tunnel
- version 0.7.1+701; tests cover the URL mapping and tunnel helpers
2026-12-04 12:21:09 +08:00
blumia 318276d3b9 feat: browser navigation moves into a menu, and a note on the network
- back, forward, open in the system browser and history now live in the
  address bar's three-dot menu; history is a submenu (last 20 URLs, or a
  disabled "no history" row), leaving the URL field wide enough on a phone
- the browser runs on the phone's network: localhost is the phone, not the
  OpenChamber host; the empty state says so and points at the host's LAN
  address for server-side dev servers
- version 0.7.0+700
2026-12-04 09:29:02 +08:00
blumia ce944751b4 feat: a browser page in the right sidebar, and icon tabs
- the right sidebar gains a Browser tab: address bar (back/forward, URL,
  go, stop/reload, open in the system browser), history, quick links for
  localhost:3000/5173/8080, and an embedded WebView on Android/iOS with an
  error bar and retry; desktop shows a mobile-only hint
- Android allows cleartext traffic so local dev servers over HTTP load in
  the WebView
- the tab row is now icons with tooltips (Files, Project knowledge,
  Terminal, Browser), so four tabs fit a phone without truncated labels;
  the tabs are kept alive offstage, so switching away and back keeps the
  browser page and terminal state
- webview_flutter 4.14.1; version 0.6.7+607; tests cover the tab icons and
  the desktop fallback
2026-12-04 02:02:19 +08:00
blumia c2dabbe187 feat: a full-screen, zoomable picture viewer
- conversation pictures (user attachments, generated and tool-read images)
  no longer open in a small dialog: a full-screen black viewer shows the
  title and page number, pinch zooms to 8x, double-tap toggles 2.5x around
  the touched point, and a zoomed picture pans by dragging
- multiple pictures in the same message / tool run are one gallery: swipe
  while at 1x, but once zoomed the drag pans and paging is disabled until
  the picture returns to 1x
- mirrors dsh-Go's ImageViewerPage/ImagePager/ZoomableImage behaviour
- version 0.6.5+605; tests cover zoom, pan and paging
2026-12-01 00:59:04 +08:00
blumia 9ae1e9b97a fix: clear a stale relay banner once the connection is back
- resuming from the background can fail the first relay request (DNS not
  ready yet) while a later session read and the event stream work; the
  banner stayed because only the exact "Connection lost, reconnecting…"
  text was ever cleared, and a successful session read did not clear it
- transport errors (connect, session list/search/more, archive, active,
  permissions, chat settings, projects, fs home, models) are now marked as
  such and cleared by any successful read or by an event arriving on the
  restarted stream; a pin/archive action error is left for the next action
- the sidebar Retry now reconnects the stored connection when there is no
  client, otherwise re-reads the session list and clears the stale error
- version 0.6.4+604; tests cover the stale-error clearing and rollback
2026-11-27 18:37:19 +08:00
blumia ba3c820186 feat: the files panel uses the server's gitignored setting
- OpenChamber keeps filesViewShowGitignored in its profile settings (the web
  UI's "Display gitignored files"); the client now reads it in
  refreshChatSettings instead of starting from a local false, so a server
  that shows ignored files shows them here too
- toggling "Show git-ignored files" writes the same key back through
  PUT /api/config/settings (surface=mobile) and reloads the listing; a
  failed save restores the previous value and reports the error
- while the panel is open, a change to the setting from another client
  reloads the list with the new filter
- version 0.6.3+603; tests cover reading, writing and rollback
2026-11-27 17:44:36 +08:00
blumia 8ac36b1fb1 feat: the archive picker offers only projects that hold archived sessions
- the archive page passes its project set to the shared picker, built from
  the archived sessions' directories (deduped and sorted by name), so the
  sheet no longer lists every server project
- the restricted picker hides the add-project action: the archive page never
  archives anything, so adding a project there would be pointless
- the picker gained an optional onlyProjects argument; chat archives remain
  reachable through the Chat row
- version 0.6.2+602
2026-11-27 13:36:11 +08:00
blumia 83e09e8e25 feat: archive filter uses the shared project sheet, with search
- the archive page's horizontal project chips become the same project
  scope row as new-session / scheduled tasks / stats: tapping it opens the
  shared project bottomsheet (all projects, chat, every project with its
  icon, path and checkmark) and filters the archive
- the shared project sheet gains a search field over project name and path,
  so a long project list can be narrowed; it shows "no matching projects"
  when nothing matches
- version 0.6.1+601
- archive test covers filtering through the sheet
2026-11-27 12:14:44 +08:00
blumia a7e4ed8dd7 feat: an archive page, and the sidebar drops archived sessions
- 全部功能 gains an 归档 entry: the new page lists every archived session
  with a count, search over title / id / project, project chips (all plus
  each project with its count), and a row that opens the chat; each row
  restores the session or opens a menu to open, restore, copy the id or
  delete it
- the sidebar's 显示已归档 button and archived list are gone; the sidebar
  now lists only active sessions, while the archive page owns the archived
  ones (matching OpenChamber's archive page)
- version 0.6.0+600
- tests cover the archive list, project chips, search and restore
2026-11-27 11:10:51 +08:00
blumia c6b5a870c6 feat: add a project from the picker, and keep the context ring
- the project picker has an "Add project" action: a folder browser starts
  at the server user's home, navigates (typed path, up, new folder) and
  adds the chosen folder through POST /api/openchamber/directory; the new
  project becomes the draft's target at once
- refreshProjects merges settings-only projects (newest added first), so a
  project added before its first session still appears in the picker; the
  first session moves it into /api/project as usual
- usageReading no longer hides the composer's context ring when the
  session's model has left the server catalog: a 200K window is assumed,
  the percentage is prefixed with "~", and the usage sheet says the window
  is estimated. A failed model fetch at connect is retried when a chat
  opens, so a normal session shows the real percentage
- tests: the add-project browser flow, settings-only projects, and the
  estimated/known context readings
2026-11-27 09:26:14 +08:00
blumia bd8afeb686 fix: give token bars a height so their fills paint
A Row lays a childless ColoredBox out at zero height (the cross axis is
loose), so the token segments in the model bars, the token-composition bar
and the tool success bars painted nothing, while the single-ColoredBox
steps/cost bars worked. Stretching those rows makes the fills visible; the
stats test now asserts a token segment's height, not only its width.
2026-11-26 20:54:03 +08:00
blumia 2e0308f232 fix: keep a token-model bar visible even at a tiny share
- model bars are 8px tall and a nonzero share paints at least 8px, so a
  model that is a fraction of a percent of the report still reads as a
  sliver on the full-width track instead of an empty bar
- an emulator check of the live report showed the shares were correct
  (the top model is 1.0 and renders full width); the many near-zero rows
  came from the real data, where eight of ten models are under a percent
- widget test covers the tokens bar width and the metric grid
2026-11-26 19:56:31 +08:00
blumia b65498d73e feat: stats page, and the client becomes Chamber Go
- 全部功能 gains 统计 (Stats): ranges Today/7/30/90 days/all time, a
  project scope (reusing the shared project sheet, plus "All projects"),
  session/prompt/token/cost/active-days/streak tiles, a daily activity
  chart (weekly past 92 days), token composition, efficiency tiles, model
  ranking by tokens/cost/steps and on-request tool-call stats; data comes
  from /api/experimental/session/stats and the day buckets use the device's
  IANA zone (a small platform channel; desktop falls back to UTC)
- the model bars draw a full-width track with a left-aligned fill, so a
  small token share reads as a sliver instead of an empty bar
- AI token strings read 词元 (not 令牌) in Chinese
- the client's display name is Chamber Go (launcher, iOS, Linux window,
  About), package unchanged; pairing/login labels and the user-agent
  follow, so a newly paired device shows "Chamber Go" on the web client's
  "Connect to this server" list
- bump to 0.5.6
2026-11-26 17:18:09 +08:00
blumia a70e9290ef feat: one project sheet for sessions and scheduled tasks
- the scheduled-task scope dropdown becomes the same project sheet the
  new-session composer opens: Chat row, project icons, paths, the current
  check mark, and one row per checkout
- a filesystem root ("/") no longer reads as a blank row: pathLeaf falls
  back to the path itself instead of an empty last segment
- the sheet opens at once and refreshes the project list behind it; an
  empty list shows "Loading projects…" until the answer arrives, so the
  project chip no longer waits before anything appears
- bump to 0.5.5
2026-11-26 14:00:35 +08:00
blumia 545778c6f3 feat: show real download progress in the files sidebar
- the download dialog starts from the size fs/stat reported, so the bar is
  determinate even when the response has no Content-Length (the relay
  forwards the body chunked); the server's own total wins when it has one
- the line reads "512.0 KB / 20.0 MB (2.5%)": below 10% one decimal
  shows that the transfer is moving
- bump to 0.5.4
2026-11-26 12:46:25 +08:00
blumia 511c3b006b feat: write the UI in English, select only conversation content
- source strings are English again; Chinese comes from lib/l10n/zh.dart
  through tr()/trArgs() and AppText, and a language without a table
  (Spanish, ...) reads English instead of Chinese
- server and user data (titles, messages, file names, notes, task names)
  is drawn with plain Text, so it is never looked up in the table
- SelectionArea moved from the whole message list to the messages, the
  answer text, an opened tool call's details and the turn footer; status
  lines and folded tool rows no longer start a selection
- a message the transcript does not know (its start event was lost while
  the stream was down) fetches the tail once, so a turn continued from
  another client comes in with its prompt
- bump to 0.5.3
2026-11-26 11:48:16 +08:00
blumia 7b5bccf28f feat: English and Chinese, and selectable chat text
- settings → general → language picks system, Chinese or English; the
  choice is stored on the device and read before the first frame
- our Chinese strings are translated through tr()/trArgs() and AppText,
  with the English in lib/l10n/en_*.dart; a missing entry falls back to
  Chinese and a test checks that every literal in lib has one
- AppText rebuilds on a language change (it depends on the resolved
  locale), so const text and whole pages switch at once; the built-in
  date/time pickers and selection menu follow the same language
- server and user data (titles, messages, prompts, paths) is never
  translated
- the chat list sits in a SelectionArea: long-press selects message text
  and shows the copy/select-all menu
- bump to 0.5.2
2026-11-26 09:04:25 +08:00
blumia da4bfb6826 feat: add scheduled tasks behind a 全部功能 button
- the sidebar footer gains 全部功能 left of 设置; its page lists the
  features the server offers, planned tasks for now
- 计划任务 follows the web client: a project (or the chats scope) picked
  at the top, then its tasks with schedule, last result, next run, model
  and error; the switch pauses, the menu runs now, edits or deletes
- the editor covers name, prompt, daily/weekly/once/cron schedules
  (Chinese date and time pickers), several times a day, weekdays, cron
  examples, enabled, and either the session defaults or a fixed model
  and agent
- the same /api/projects/:id/scheduled-tasks endpoints the web uses; a
  server without them says so instead of failing silently
- the app now pins zh_CN localizations, so the built-in pickers and
  menus are Chinese too
- bump to 0.5.1
2026-11-26 00:36:27 +08:00
blumia 2f5ce61692 feat: add the 通用 settings page and rename the group to 常规
- 常规 now holds two pages: 通用 (the agent's tools and what it may know,
  as the web client's General page) and 聊天 (the follow-up behavior)
- 通用 covers diagrams/prototypes, images with their model, secrets,
  notifications, memory with its background tidying (model and thinking
  level), project knowledge and usage limits
- every switch reads and writes /api/config/settings, the same keys the
  web UI uses; keys the server does not store take its defaults
- image models come from /api/model?types=image and the tidying model
  from the chat model list, both chosen in a sheet and clearable
- bump to 0.5.0
2026-11-25 14:30:29 +08:00
blumia 2185054aab feat: split settings into category pages and add an about page
- the settings screen is now an index: 通用 → 聊天, 外观 → 主题 / 宠物,
  帮助与关于 → 关于; each row opens its own page, the controls moved
  there unchanged
- 关于 shows the app version, the server's OpenCode (/api/info) and
  OpenChamber (/api/version) versions with a refresh, and the open-source
  licenses, listed per package with their full text on tap
- the app version is read from the platform at startup
  (package_info_plus), so pubspec.yaml is the only place it is written;
  the pairing/relay handshake now sends it too instead of a constant that
  had drifted
2026-11-25 12:39:48 +08:00
blumia 9564019a91 fix: match the background task bar to the activity strip
- draw the task bar in the activity strip's capsule (8px margins, 14px
  padding, 36px min height, stadium radius) so the two read as one stack
- drop the stop button from the bar: its padding pushed the clock off the
  right edge shared with the strip above; the row opens the sheet instead
- in the sheet, show only the clock while running, a stop button with a
  stop icon, and "已结束" once the command ends; no "运行中" label and no
  close x (the drag handle and the scrim already close it)
- say "读取输出…" while the first page loads instead of claiming the
  command has printed nothing
- rest the pet's feet on the status capsule's edge (4px top margin)
  instead of sinking 2px into it
2026-11-24 23:19:47 +08:00
blumia c4de5e84d8 feat: watch background commands, open their output and stop them
A command the agent detached keeps running after its tool call returns;
the chat now shows it above the composer: one row per command with its
clock and a stop, folded under "正在执行 N 条命令" when there are
several, with a subagent tag for a child session's command.

Tapping a row opens the live output in a sheet (a page a second from
shell.output, tail kept), following the tail with a way back to the
newest line. The tool row that started it carries a 后台 tag and shows
the same output when expanded, falling back to the completion note once
the shell is gone; a command stopped from the app says so instead of
showing the Shell.NotFoundError it leaves behind.

The list comes from opencode's own shell jobs (experimental/job,
descendants included), so a foreground command never appears, and an
older server falls back to the shell list narrowed by the detached
calls in the transcript. Stopping confirms, removes the shell, and
leaves the model a note that the stop was the user's, as the
first-party client does.

0.4.14 (414).
2026-11-24 19:31:22 +08:00
blumia 809e0a747a feat: show short paths and generated images in the chat
A file tool's row keeps only the part of the path under the session's
directory (lib/screens/chat_screen.dart instead of the whole absolute
path), as the first-party client does, so a phone still shows the file
name; the diff card's file headings drop the same prefix.

A finished openchamber_image call is lifted out of the folded run and
drawn as the picture it saved, in place, as ShownToolCard does through
GeneratedImages: tap opens the full-screen preview, and the card and
preview share an in-memory cache of the bytes.

0.4.13 (413).
2026-11-24 01:05:00 +08:00
blumia d533bc95ef feat: show edit and write tools as line diffs
Expanding an edit, write or patch call now renders the change as tinted
diff lines instead of an old/new text blob: added lines green, removed
lines red, @@ hunk headers marked, and file header noise hidden. The
patch comes from the server's metadata.files[].patch; older servers fall
back to a line diff of the edit's old/new strings, and a write with only
content shows as added lines.

The tool row also shows +N −M for these calls, as dsh-Go does, and a
phone-sized preview stops at 600 lines.

0.4.12 (412).
2026-11-23 22:36:05 +08:00
blumia 0f850b6191 style: align sidebar tree chevrons and give titles more room
The project band no longer adds inner padding, so its folder chevron and +
sit on the same two vertical lines as the session rows' subagent chevron
and ⋮. Every session row now reserves the same 18px chevron column, so a
session without subagents starts its title exactly where a parent does,
and the compact left/right insets leave the title more width.

0.4.11 (411).
2026-11-23 21:37:16 +08:00
blumia 9cbd97d532 feat: fold subagent trees and open them from Agent Task rows
Subagent sessions now render as a collapsed tree in the sidebar: parents with
workers get an expand/collapse chevron, expanded child rows sit behind a guide
line, and the parent keeps its worker count. The parent of the open subagent
expands once so its child is visible.

Subagent tool rows in the parent chat (subagent or task) are labeled 子代理,
show the description and open the child session on tap; a child outside the
loaded page is fetched by id first.

Subagent chats are read-only by default with the first-party notice;
allowPromptingSubagentSessions permits ordinary subagents, while a Lead's
operator-child worker stays read-only until takeover.

0.4.10 (410).
2026-11-23 21:15:18 +08:00
blumia cebf09048e feat: browse subagent sessions nested under their parent
Sessions with a parentID were filtered out of the sidebar, so a subagent's
conversation was unreachable. They now render indented under the session that
started them (robot marker, "子代理 ·" subtitle), the parent shows its worker
count, and tapping one opens its full chat. Opening a parent also fetches its
children with parentID=<id>, so older workers missing from the loaded page
appear.

A subagent's app bar gets a back arrow to its parent session.

Builds now produce a universal APK plus per-ABI arm64/armv7/x86_64 splits; the
packaging preference is kept in project memory.

0.4.9 (409).
2026-11-23 20:35:21 +08:00
blumia 79221e57d7 feat: group the server's chats and use OpenChamber's project icons
Sessions under the server's managed chats root (chats/<date>/session-…) were
grouped per directory, so each one appeared as its own session-xxxxx band.
GET /api/fs/home now supplies the chats root plus its canonical and legacy
aliases; every chat folder becomes the single 聊天 group. The new-session
picker can target 聊天 too: the first send creates a fresh chat directory
before creating the session, and a new session started from an existing chat
gets a new one instead of sharing its folder.

Projects merge their OpenChamber settings row (label, icon key, colour,
iconBackground and uploaded/auto icon image) with /api/project. Group
headers, the picker and the draft chip draw the chosen icon in its colour,
and custom images are fetched through the client transport (SVG included)
with a themed fallback to the glyph. The chat group uses a chat bubble rather
than a folder.

0.4.8 (408).
2026-11-23 17:42:49 +08:00
blumia 91bf5e5b81 fix: make the pairing QR scanner actually see dense codes
The scanner read frames at 480p, which is thin for the web UI's dense
pairing QR (1024px, low error correction, a two-module quiet zone), and it
rejected a Y plane whose last row has no padding even though some cameras
return exactly rowStride * (height - 1) + width bytes — on those devices
every frame was dropped, so nothing ever reacted.

Frames are now requested at 720p and fall back to 480p only when the device
refuses the higher analysis size; a stream that fails to start reports an
error instead of leaving a silent preview. Decoding runs with zxing's
tryHarder hint and retries an inverted frame for light-on-dark codes.

The screen also reports what it sees: resolution/format and a live
"frames scanned / decode attempts" line, a one-time log of the first frame's
planes, row stride and byte count, a no-frames hint after four seconds, and a
"move closer" hint when frames decode but no QR is found.

0.4.6 (406).
2026-11-23 12:26:16 +08:00
blumia 8f6fd99103 feat: scan the pairing QR code with the camera
The pairing dialog gained a "扫码" button: a full-screen scanner points the
back camera at the QR that OpenChamber's connect-a-device dialog shows, and a
decoded pairing link connects straight away.

Frames are decoded with zxing2 (pure Dart, no ML Kit or Play services): the
YUV420 Y plane is already luminance, BGRA frames are converted green-weighted,
and each frame is decoded in a background isolate so camera frames never block
the UI. Only an openchamber://connect payload ends the scan; any other QR code
shows a short hint and scanning continues. A torch button, a denied-permission
message with retry, and camera-less devices are handled.

The recorder audio permission the camera plugin declares for video is removed
from the merged manifest: the scanner reads frames only.

0.4.5 (405).
2026-11-22 17:52:47 +08:00
blumia 902f1e18bb feat: connect through the OpenChamber private relay
A server can now be added by pasting an openchamber://connect pairing link.
The one-time secret is redeemed over the first reachable candidate (direct
addresses first, then the relay), and the device token is stored with the
connection, so later launches reconnect without the link.

The relay candidate carries the relay WebSocket URL, the host's routing id
and its P-256 public key. The new transport opens one encrypted tunnel to the
relay: P-256 ECDH + HKDF-SHA256 derive one AES-256-GCM key per direction;
frames carry a version, a 12-byte IV and the GCM tag; a small mux carries
HTTP, SSE and WebSocket sub-streams with fragmentation and ping/pong. Every
request and the terminal socket ride it; WebSocket upgrades first mint the
short-lived oc_url_token over the tunnel, since upgrades cannot send headers.

Only the host's legacy path is negotiated (no batching, downstream flow
control or body gzip). Pairing while connected switches servers like picking
one in the list, which exposed and fixes a ChatScreen crash when app.chat is
cleared during the switch.

0.4.4 (404).
2026-11-22 16:51:44 +08:00
blumia a7bc380ac0 feat: several terminal tabs per project, with a dropdown
A directory now has a TerminalWorkspace holding a list of tabs instead of a
single session. The status bar's left side became a dropdown: it shows the
active tab and its state ("终端 2 · 运行中") and lists the other tabs (the
active one checked) plus "新建终端". New tabs take the smallest free number,
so closing one frees its name.

Only the active tab keeps a socket: switching detaches the old tab and
attaches the new one, whose screen is replayed from the server snapshot; the
shell itself keeps running. The tab's model stays in memory, so switching
back is immediate.

The tab list (ids, labels, active one) is saved per connection and directory.
On the first open the server's sessions for the directory are reconciled with
it: saved labels and order are kept for sessions that still exist, sessions
opened elsewhere (web UI) are appended in creation order, and tabs whose
session is gone are dropped. Project-action command runners are not shown as
tabs. The 0.4.2 single-session value is read as one tab.

0.4.3 (403).
2026-11-22 15:23:21 +08:00
blumia 675d19d563 fix: reattach the terminal after an app restart
The terminal session id lived only in memory, so the first time the panel
opened after a launch it always created another PTY. The old shell stayed on
the server (unattached shells live for half an hour) but the client could no
longer find it.

The id is now remembered per connection and directory. On first open the
panel lists /api/terminal/sessions?cwd=<dir> and attaches to the remembered
session while the server still has it, showing its replayed history. Without
that id it adopts the newest running session of the directory, and only when
the directory has nothing does it create one. An explicit "close terminal"
forgets the id and forces a fresh shell, and a fatal SESSION_NOT_FOUND clears
it and recovers, so a server restart cannot leave a dead panel.

The panel is still one terminal per project, not a tab strip.

0.4.2 (402).
2026-11-22 14:53:33 +08:00
blumia d25167de58 fix: float the pet over the messages and let it be dragged
The pet used to sit in the column above the composer, reserving a strip of
its own: the message list ended there, which read as an opaque band cutting
off the last row. It is now a layer over the message area, so the list keeps
its full height and shows through around the sprite. Only the body of the
sheet takes touches (contentBox, 4dp out); taps and drags on the transparent
canvas still reach the messages underneath.

Dragging the body moves the pet along the composer's top edge (or the
activity cap's) with a small lift while held and the pack's drag reaction.
The spot is stored as a fraction of the width in pet.x.v1, so a restart or a
change in width puts it back in the same place. Taps now react on tap-up so a
drag does not fire a left/right reaction.

0.4.1 (401).
2026-11-22 14:30:30 +08:00
blumia d72af036a1 feat: imported input-box pets, with dsh-Go's sprite packs
Nothing is built in: Settings → 宠物 shows "尚未导入宠物" until a zip is
picked. The zip holds a dsh-Go pack.json and PNG sheets; it is validated
(pack.json, every named sheet) and unpacked under the app's private files
directory, with enable, size (40/52/64) and remove kept on the device.

A pack's canvas, anchor, per-animation box and frame list drive rendering:
PetSlot reserves the area above the baseline and stands the sprite on the
composer's top edge (or on the activity cap while a turn runs). Idle,
thinking, working and error follow the chat's state, and a tap plays the
pack's react-left/react-right. Only one sheet is decoded at a time.

path_provider's JNI binding does not load on this engine, so MainActivity
exposes the files directory over a tiny method channel instead.

dist/deepy-whale-pet.zip is the Deepy whale for testing. Tests cover the
real pack manifest, frame/state mapping and zip import.

0.4.0 (400).
2026-11-22 13:39:49 +08:00
blumia ff0dbf1b37 ui: make the sidebar rows compact again
Both the project band and the session rows are dense 56px list tiles now
(measured 54), down from 72. Session titles are 14 and project names 14.5,
so the list stays readable while the hierarchy keeps its tinted band. The
project + and the session ⋮ still share one vertical line.

0.3.21 (321).
2026-11-22 12:53:45 +08:00
blumia 73af9d851b ui: one row height and one trailing line in the sidebar, and a dsh-Go activity cap
- The project header is a ListTile now, like a session row: both are 72 high
  (title + subtitle). A Material 3 list tile ends at 24, so the band's 8px
  inset gets 16 more, putting the project + and the session ⋮ on one line
  (a widget test asserts both the heights and the x centres).
- The running status is a full-width stadium like dsh-Go's activity strip:
  title and current-step summary on the left, a tabular m:ss clock on the
  right, translucent surface, 36 minimum height. The spinner inside is gone;
  the cap's top edge is where the future input-box pet will perch.
- 0.3.20 (320).
2026-11-22 12:32:59 +08:00
blumia 6ced914757 fix: centre the context ring, show a live status while running, and settle project rows
- The folded composer aligns to its bottom edge, so the 16px usage ring sat
  below the 36px keys; a 10px bottom padding puts it on their centre line (the
  two-row layout was already centred).
- A running turn no longer shows the finished turn's footer (model · mode ·
  time, with its copy/fork menu). Above the input there is now an activity
  strip like dsh-Go's: "思考中 / 正在回复 / 正在读取 · …" with the current
  step's summary and a clock that ticks each second.
- Project headers in the sidebar are tinted bands at least a session row tall,
  with a folder icon, a bolder name and the path beneath, so the project and
  its sessions read as different levels.
- Project names take the last path segment with either separator, and path
  comparisons unify `\`/`/` (case-insensitively for drive-letter paths); the
  grouping key does too, so a Windows server no longer shows a full path or
  splits one project in two.
- 0.3.19 (319).
2026-11-22 11:59:33 +08:00
blumia d9d5424318 fix: a new server could not be given its password
The form only rendered the password field when editing a saved server
(!_editNew). Adding a password-protected instance therefore failed with
"需要密码或已保存的凭据" and offered nowhere to type it. The field is now
always shown ("密码(如果需要)", empty for a passwordless server); a failed
connect that asks for a password focuses it, and a rejected password reads
as "密码错误,请重试".

Adds test/servers_form_test.dart. 0.3.18 (318).
2026-11-22 11:38:24 +08:00
blumia e646130d1f feat: a settings page, a server footer in the sidebar, and follow-up behaviour
- The sidebar's server switch moves to a footer bar: the connected server's
  name on the left (tap for the server sheet) and a settings key on the
  right, matching the first-party phone layout.
- Settings has three groups: 外观 (theme mode and seed colour, stored on the
  device only in shared_preferences), 聊天 (the server's followUpBehavior:
  steer or queue) and a 宠物 placeholder. The app theme now reads the seed
  and mode.
- The chat's short send while a turn runs uses the configured follow-up
  behaviour; the long-press sheet offers both and marks the default. The
  value is read from GET /api/config/settings?surface=mobile on connect, on
  resume and when the page opens, and written back with PUT.
- Tests: settings page groups and choice, sidebar footer naming the server
  and opening settings, follow-up normalization.
- 0.3.17 (317).
2026-11-21 19:17:22 +08:00
blumia 1aa84a53e5 feat: queue a message for the running turn, and fold the composer when the IME closes
- A send while a turn runs joins it (delivery "steer") on a short press; a
  long press offers steer or queue. Queue/steer prompts wait in the server's
  inbox and show as a pending bubble at the end of the transcript, with
  改为排队/转为转向 and 撤回 (which puts the text back into the composer).
  The inbox is read on open and resume and kept current by the
  session.inbox.* events; delivery reloads the tail.
- The send key is stop only while running with an empty draft; with text it
  sends (as dsh-Go does), leaving the long press for the delivery choice.
- The composer also folds to one line when the phone's back gesture closes
  the keyboard while the field keeps focus: the page passes the keyboard
  height (a Scaffold strips the bottom inset from its body) and the composer
  treats a fall below half the peak as a dismissal.
- The Build/Plan chip now opens a bottom sheet with icons, hints and a check,
  instead of a popup menu.
- Tests: composer_box_test (focus opens, IME dismissal folds, typing reopens)
  and inbox_item_test (list items, enqueued events, delivery changes).
- 0.3.16 (316).
2026-11-21 18:32:57 +08:00
blumia ea3b1f0f5e ui: fold the composer to one line until it has focus
dsh-Go opens the input into two rows only while focused: the text above, the
model / mode / keys below, folding back when focus leaves. ComposerBox keeps
the field across the two layouts with a GlobalKey and animates the swap.

Model and thinking level are now one control (ModelPill shows "model · effort"
and the sheet offers the level after choosing a model); Build/Plan is a
separate ModeChip. The draft page uses the same box, with its project chip
above it. 0.3.15 (315).
2026-11-21 17:47:04 +08:00
blumia 7f2f454539 fix: switching a session's model, and put the model row in the composer
- POST /api/session/:id/model takes the reference under `model`; sending it
  at the top level was rejected with "Missing key at [model]".
- The chat now shows the model/agent row above the input (revealed while
  typing or running, as dsh-Go does) instead of in the app bar; the draft
  keeps the same row, with its project chip first.
- Thinking levels: /api/model's variants become a 思考 chip and sheet; the
  choice travels as ModelRef.variant on the switch or the create, and the
  last level per model is remembered on the device.
- The model picker groups providers, adds 收藏 and 最近 (device-local), shows
  each model's context size and reasoning mark, and collapses sections.
- The `/` palette is shared by the chat and the draft (new slash_palette
  widget); the draft lists commands and skills but not the client-local
  /compact, which needs an existing session.
- 0.3.14 (314).
2026-11-21 17:03:22 +08:00
blumia fff6562cbc feat: a new-session draft and a sidebar grouped by project
- Starting a session opens NewSessionScreen instead of a title sheet: a
  project chip (GET /api/project, one row per canonical), a model/agent
  chip, attachments and the composer. Nothing is created on the server
  until the first send, which posts the session with its directory, model
  and agent and then sends that message.
- The draft lives in AppState (memory only): leaving it keeps it; the
  sidebar shows a draft row with its first line and a discard button; a
  failed create stays on the draft with its text.
- The session list groups by project (chat folders under 聊天), dates the
  rows (今天/昨天/本周早些时候/更早), pins through
  session.metadata.openchamber.pinned, archives on demand, pages with
  "载入更多", and swipes to pin/archive/delete (flutter_slidable).
- Child sessions are hidden; a parent's row shows its children's activity.
- The chat app bar follows the live session list, so the title the server
  generates from the first message appears at once.
- Attachments and the model picker move to shared widgets, used by the
  chat and the draft.
- 0.3.13 (313).
2026-11-21 14:29:52 +08:00
blumia 5a371e4faf feat: tabs own the panel header, a Termux key bar, and agent memory
- The panel's top row is now the tab group plus the close button; each tab
  keeps its own header: the files tab has the breadcrumb with new/more (or
  the name and edit/download while previewing), knowledge its search and
  refresh, the terminal its status.
- The key bar is Termux's two rows of seven: ESC / — HOME ↑ END PGUP, then
  TAB CTRL ALT ← ↓ → PGDN; the modifiers still apply to what the phone
  keyboard types.
- The panel is a dialog, so it gives the IME's height back itself
  (viewInsets.bottom). The key bar and the terminal stay above the
  keyboard, and the PTY reflows to the smaller terminal.
- Project knowledge gains the memory tab: both scopes from
  /api/agent-memory/all, absent when the server has memory switched off,
  with type, edit and delete.
- File preview editing passes minLines: null alongside expands.
- 0.3.12 (312).
2026-11-21 11:09:44 +08:00
blumia 5f95e2da97 feat: the terminal, project knowledge, and downloads that can be cancelled
- lib/api/terminal.dart: the PTY protocol (create/resize/restart/close, and
  the /api/terminal/ws binary control frames) with a reconnecting socket
  that replays the server snapshot at the size it was drawn for.
- lib/terminal_state.dart: an xterm model plus that socket, kept per
  workspace on AppState, so closing the panel or switching tabs keeps the
  shell; the app reattaches when it returns from the background.
- lib/screens/terminal_panel.dart: TerminalView, a status bar (keyboard,
  restart, clear, close) and a Termux-style key bar whose CTRL/ALT/SHIFT
  modifiers also apply to what the phone keyboard types.
- lib/screens/knowledge_panel.dart: notes, todos and plans from
  /api/project-context, searchable, with a full page for a plan's Markdown
  and its raw editor.
- Downloads stream with a progress dialog (bytes, total, percent) and a
  cancel that aborts the request; the save dialog only opens on success.
  The request asks for `accept-encoding: identity` so Content-Length exists.
- MarkdownView renders task lists as ✅/⬜ instead of material_ui's
  Checkbox, which wants a material_ui Material ancestor the app lacks.
- Dialogs own their TextEditingControllers, so closing one no longer
  trips a framework assertion in debug builds.
- 0.3.11 (311).
2026-11-21 02:49:07 +08:00
blumia 60d02083d3 feat: a transport seam, image previews, native forms, a phone drawer
- lib/api/transport.dart: TransportRequest/TransportResponse/Transport, with
  DirectTransport holding the old behaviour (HTTP CONNECT, SOCKS5/socks5h,
  self-signed and pinned certificates). Client goes through it, so a relay
  tunnel only adds an implementation.
- User rows decode the server's inline attachment data and open the shared
  image preview on tap; the local path stays the fallback.
- The agent's native forms: models from @opencode/client, the form list,
  replies and cancels, form.* events, and a dock above the composer with
  when-rules and required-field validation (a switch must be on).
- HomeScreen: the session list is the phone's left drawer and a persistent
  column from 840 px, the chat beside it; the newest session opens on start.
- 0.3.10 (310).
2026-11-21 01:16:10 +08:00
blumia 9b53338908 feat: the files sidebar, Markdown thinking, a banner that clears
- The chat's top-right menu only repeated the per-turn menu. It now opens a
  files sidebar that slides in from the right, the way the official client's
  right panel does: browse the session directory with a breadcrumb and an up
  key, filter the current directory, search its subdirectories (bounded,
  skipping .git/node_modules/build and friends), preview text/code/Markdown/
  images, edit and save text files, create files and folders, and download
  any file through the system save dialog.
- The panel's "..." menu carries the official client's "显示被 git 忽略的文件"
  toggle (the listing asks the server to respect gitignore by default) and a
  refresh. 项目知识 and 终端 have their tabs, marked as coming later.
- Thinking blocks are Markdown too (headings, lists, inline code), rendered
  with the shared MarkdownView at a smaller, quieter size.
- The reconnect banner stayed forever: the stream loop sets it when the SSE
  connection drops and nothing cleared it. Any event proves the stream is
  back (the server greets every connection with server.connected), so it now
  clears the message then.
- Markdown rendering moved to lib/widgets/markdown_view.dart, shared by
  messages, thinking, compaction summaries and file previews.
Version 0.3.9 (code 309).
2026-11-20 18:25:28 +08:00
blumia b9433c30cb feat: built-in /compact and compaction rows in the transcript
- /compact is not one of the directory's commands: OpenChamber's own
  client supplies it and runs POST /api/session/:id/compact. The palette now
  starts with that local command (压缩), so picking it compacts without the
  model seeing anything.
- A compaction message (status running/completed/failed, reason, summary,
  tokens) is part of the timeline. It now shows as the official client's
  row: a scissors glyph and "正在压缩对话" / "对话已压缩", a 显示摘要 toggle,
  and the summary as Markdown (revealed with the same height animation as
  the other folds). Failed compactions keep the error block.
- Live compaction events are subscribed: started adds the running record
  (or refreshes the tail when it names no id), delta appends the streaming
  summary, ended/failed fetch the server's settled record.
- Version 0.3.8 (code 308).
2026-11-20 12:26:15 +08:00
blumia fbadf6f858 fix: keep loaded tool output when the tail page only has its shell
List responses ask the server to elide large tool output
(`x-openchamber-part-shells: v1`): the part comes back as an empty text
plus an `openchamberContentShell` marker, and the full text is fetched
when a step is expanded. Every tail refresh (a turn starting, the app
returning) then replaced the loaded message with that shell again, so an
expanded step fell back to "无输出" — the more the session was used, the
more it looked like shell steps never had output.

reloadTail now keeps an already-loaded tool part when the server's copy of
that part is a shell (matched by position and call id), and the pending
state reads "输出较大,正在载入…" instead of claiming there was no output.
Version 0.3.7 (code 307).
2026-11-20 09:18:04 +08:00