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).
This commit is contained in:
1 parent
d9d5424318
commit
6ced914757
9 files changed
+272
-56
No files matched your search
+25
-4
@@ -167,13 +167,34 @@ class ProjectInfo {
|
||||
|
||||
String get label {
|
||||
if (name.trim().isNotEmpty) return name.trim();
|
||||
final trimmed =
|
||||
canonical.replaceAll(RegExp(r'/+$'), '');
|
||||
final index = trimmed.lastIndexOf('/');
|
||||
return index >= 0 ? trimmed.substring(index + 1) : trimmed;
|
||||
return pathLeaf(canonical);
|
||||
}
|
||||
}
|
||||
|
||||
/// The last segment of a path, treating `\` and `/` alike: a Windows server
|
||||
/// sends `C:\...` and a project has to read as its folder name, not the path.
|
||||
String pathLeaf(String path) {
|
||||
final trimmed = path.replaceAll(RegExp(r'[/\\]+$'), '');
|
||||
final index = trimmed.lastIndexOf(RegExp(r'[/\\]'));
|
||||
return index >= 0 ? trimmed.substring(index + 1) : trimmed;
|
||||
}
|
||||
|
||||
/// A path with `\` written as `/` and no trailing slash, for comparing and
|
||||
/// grouping directory names from a Windows or a POSIX server.
|
||||
String slashPath(String path) =>
|
||||
path.replaceAll('\\', '/').replaceAll(RegExp(r'/+$'), '');
|
||||
|
||||
/// Whether two directory paths name the same place. Separators are unified;
|
||||
/// a drive-letter path compares case-insensitively, as Windows does.
|
||||
bool samePath(String a, String b) {
|
||||
final x = slashPath(a);
|
||||
final y = slashPath(b);
|
||||
if (x == y) return true;
|
||||
final windows = RegExp(r'^[A-Za-z]:').hasMatch(x) ||
|
||||
RegExp(r'^[A-Za-z]:').hasMatch(y);
|
||||
return windows && x.toLowerCase() == y.toLowerCase();
|
||||
}
|
||||
|
||||
class ContentPart {
|
||||
final String type;
|
||||
final String text;
|
||||
|
||||
Reference in new issue
Block a user