Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <node>.” when the node has none, or
“N git credential(s) on <node>.” — instead of silently clearing the loading
message.

## 1.52.1

### Fixed
Expand Down
15 changes: 9 additions & 6 deletions lib/src/application/client/dashboard/dashboard_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
43 changes: 24 additions & 19 deletions test/unit/dashboard/dashboard_app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand Down
Loading