feat: inline image previews, revert, and the official icon

- sent images keep a local copy and render as rounded thumbnails in the
  message, surviving later page reloads
- a prompt's menu can revert it and everything after it: confirm, then
  stage and commit the server-side revert
- the app icon is OpenChamber's own (packages/mobile/assets/icon-only.png)
- document a terminal assessment (native view vs Go ANSI vs xterm.js in
  a WebView) for the next decision

Bump version to 0.2.1 (build 15).
This commit is contained in:
blumia committed 2026-11-17 23:46:06 +08:00
1 parent 72119b73e8
commit dc3730eba7
9 files changed
+221 -22

No files matched your search

+26
View File
@@ -192,3 +192,29 @@ func TestPartShellsHeaderAndGetMessage(t *testing.T) {
t.Fatalf("message = %+v", msg)
}
}
func TestRevertEndpoints(t *testing.T) {
var staged map[string]any
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/api/session/ses_1/revert/stage":
_ = json.NewDecoder(r.Body).Decode(&staged)
fmt.Fprint(w, `{"data":{"messageID":"msg_1"}}`)
case "/api/session/ses_1/revert/commit":
w.WriteHeader(http.StatusNoContent)
default:
t.Errorf("unexpected path %q", r.URL.Path)
}
}))
defer srv.Close()
c, _ := New(srv.URL, Options{})
if err := c.StageRevert(context.Background(), "ses_1", "", "msg_1"); err != nil {
t.Fatal(err)
}
if staged["messageID"] != "msg_1" {
t.Errorf("staged = %v", staged)
}
if err := c.CommitRevert(context.Background(), "ses_1", ""); err != nil {
t.Fatal(err)
}
}