Commit 66515ead authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat(pickers): show what each repo is, not just its name

Both project pickers now render the server's CLAUDE.md-derived description under
the repo name. Picking `el-captain` when you meant
`el-captain-sports-management` is easy when the list is names alone, and the
consequence — an agent answering confidently about the wrong codebase — looks
like a bug in the app rather than a mis-tap.

Degrades cleanly: an older server sends no description, the field parses to an
empty string, and the tile falls back to the name on its own.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
parent 83322120
...@@ -57,12 +57,19 @@ dynamic _any(Map<String, dynamic> j, List<String> keys) { ...@@ -57,12 +57,19 @@ dynamic _any(Map<String, dynamic> j, List<String> keys) {
// --- projects --------------------------------------------------------------- // --- projects ---------------------------------------------------------------
class Project { class Project {
const Project({required this.name, required this.path}); const Project({required this.name, required this.path, this.description = ''});
final String name; final String name;
final String path; final String path;
factory Project.fromJson(Map<String, dynamic> j) => /// One line describing the repo, from its CLAUDE.md. Empty when the server is
Project(name: _s(j['name']), path: _s(j['path'])); /// older or the repo has none — the picker then shows the name alone.
final String description;
factory Project.fromJson(Map<String, dynamic> j) => Project(
name: _s(j['name']),
path: _s(j['path']),
description: _s(j['description']),
);
} }
// --- chats ------------------------------------------------------------------ // --- chats ------------------------------------------------------------------
......
...@@ -384,6 +384,13 @@ class _ProjectPicker extends StatelessWidget { ...@@ -384,6 +384,13 @@ class _ProjectPicker extends StatelessWidget {
itemBuilder: (_, i) => ListTile( itemBuilder: (_, i) => ListTile(
leading: const Icon(Icons.folder_outlined, color: Ember.flame), leading: const Icon(Icons.folder_outlined, color: Ember.flame),
title: Text(projects[i].name, style: const TextStyle(fontSize: 14)), title: Text(projects[i].name, style: const TextStyle(fontSize: 14)),
subtitle: projects[i].description.isEmpty
? null
: Text(projects[i].description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 11, color: Ember.textFaint)),
isThreeLine: projects[i].description.isNotEmpty,
onTap: () => Navigator.pop(context, projects[i].name), onTap: () => Navigator.pop(context, projects[i].name),
), ),
), ),
......
...@@ -382,6 +382,14 @@ class _ProjectButton extends ConsumerWidget { ...@@ -382,6 +382,14 @@ class _ProjectButton extends ConsumerWidget {
leading: Icon(Icons.folder_outlined, leading: Icon(Icons.folder_outlined,
color: projects[i].name == project ? Ember.flame : Ember.textDim), color: projects[i].name == project ? Ember.flame : Ember.textDim),
title: Text(projects[i].name, style: const TextStyle(fontSize: 14)), title: Text(projects[i].name, style: const TextStyle(fontSize: 14)),
subtitle: projects[i].description.isEmpty
? null
: Text(projects[i].description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 11, color: Ember.textFaint)),
isThreeLine: projects[i].description.isNotEmpty,
trailing: projects[i].name == project trailing: projects[i].name == project
? const Icon(Icons.check, color: Ember.flame, size: 18) ? const Icon(Icons.check, color: Ember.flame, size: 18)
: null, : null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment