diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a4ac97..d78571a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.52.2 + +### Changed + +- **Dashboard: the git-credential view now reports a load summary in the status + bar** — “No git credentials for you on .” when the node has none, or + “N git credential(s) on .” — instead of silently clearing the loading + message. + ## 1.52.1 ### Fixed diff --git a/lib/src/application/client/dashboard/dashboard_app.dart b/lib/src/application/client/dashboard/dashboard_app.dart index 4c04402..04b6bd0 100644 --- a/lib/src/application/client/dashboard/dashboard_app.dart +++ b/lib/src/application/client/dashboard/dashboard_app.dart @@ -963,12 +963,15 @@ class DashboardApp { if (_credSel > _maxIndex(_credentials.length)) { _credSel = _maxIndex(_credentials.length); } - // Clear the "Loading credentials…" status now that the (possibly empty) - // list is ready. The background load finishes without a keypress, which is - // what would otherwise clear a transient message. - _message = null; - _messageHint = null; - _messageIsError = false; + // Replace the "Loading credentials…" status with a summary. The background + // load finishes without a keypress, which is what would otherwise clear a + // transient message — so an empty result would look stuck on "Loading…". + final n = _credentials.length; + _setMessage( + n == 0 + ? 'No git credentials for you on ${node.id.value}.' + : '$n git credential${n == 1 ? '' : 's'} on ${node.id.value}.', + ); } on Object catch (e) { if (_credentials.isEmpty) { _setError('Failed to list credentials', e); diff --git a/lib/src/version.dart b/lib/src/version.dart index 308d4d3..008c6e2 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -3,4 +3,4 @@ /// This is the single source of truth for "what build is this": it is rendered /// in the CLI banner and is the default a node reports as its /// [NodeConfig.agentVersion] / [PlatformInfo.agentVersion]. -const String omnyShellVersion = '1.52.1'; +const String omnyShellVersion = '1.52.2'; diff --git a/pubspec.yaml b/pubspec.yaml index c8ba14d..d427f1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: >- connect to a Hub by node identity (not host:port); the Hub authenticates, authorizes and brokers encrypted sessions to Nodes over WebSocket-on-TLS. Ships Hub, Node, Client and CLI implementations behind first-class Dart APIs. -version: 1.52.1 +version: 1.52.2 repository: https://github.com/OmnyGrid/omnyshell environment: diff --git a/test/unit/dashboard/dashboard_app_test.dart b/test/unit/dashboard/dashboard_app_test.dart index 03b4eda..bd58085 100644 --- a/test/unit/dashboard/dashboard_app_test.dart +++ b/test/unit/dashboard/dashboard_app_test.dart @@ -897,6 +897,8 @@ void main() { expect(text, contains('CREDENTIAL (yours, masked)')); expect(text, contains('github.com')); expect(text, contains('***')); // masked + // The status bar summarizes the load. + expect(text, contains('1 git credential on web-01')); // Add a PAT credential via the modal form. term.send('a'.codeUnits); @@ -924,27 +926,30 @@ void main() { }, ); - test('node credentials: an empty list clears the loading status', () async { - final term = FakeTerminal(); - final backend = connectedBackend(); // no credentials registered - final running = _app(term, backend).run(); - await pump(); - term.send(enter); // connect - await pump(); - term.send(enter); // open node web-01 - await pump(); - term.send('c'.codeUnits); // open credentials -> empty list - await pump(); + test( + 'node credentials: an empty list reports "no credentials" in the status', + () async { + final term = FakeTerminal(); + final backend = connectedBackend(); // no credentials registered + final running = _app(term, backend).run(); + await pump(); + term.send(enter); // connect + await pump(); + term.send(enter); // open node web-01 + await pump(); + term.send('c'.codeUnits); // open credentials -> empty list + await pump(); - expect(backend.calls, contains('listGitCredentials:web-01')); - final text = frameText(term.lastFrame); - expect(text, contains('No credentials')); - // The transient "Loading…" status must not linger once the load settles. - expect(text, isNot(contains('Loading credentials'))); + expect(backend.calls, contains('listGitCredentials:web-01')); + final text = frameText(term.lastFrame); + // Status summarizes the (empty) load instead of sticking on "Loading…". + expect(text, contains('No git credentials for you on web-01')); + expect(text, isNot(contains('Loading credentials'))); - term.send(ctrlQ); - await running; - }); + term.send(ctrlQ); + await running; + }, + ); test( 'node credentials: a backend error is shown and the TUI stays interactive',