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).
This commit is contained in:
blumia committed 2026-11-23 17:42:49 +08:00
1 parent 91bf5e5b81
commit 79221e57d7
14 files changed
+599 -32

No files matched your search

+12
View File
@@ -30,4 +30,16 @@ void main() {
test('slashPath only unifies separators', () {
expect(slashPath(r'C:\a\b\'), 'C:/a/b');
});
test('a directory is recognised under a chats root', () {
expect(isUnderDirectory('/home/me/.config/openchamber/chats/2026-11-23/x',
'/home/me/.config/openchamber/chats'), isTrue);
expect(isUnderDirectory(r'C:\Users\me\.config\openchamber\chats\a\b',
r'c:\users\me\.config\openchamber\chats'), isTrue);
expect(isUnderDirectory('/home/me/.config/openchamber/chats-other/x',
'/home/me/.config/openchamber/chats'), isFalse);
expect(isUnderDirectory('/home/me/project', '/home/me/.config/openchamber/chats'),
isFalse);
expect(isUnderDirectory('', '/x'), isFalse);
});
}