feat(adminui): refresh the browse tree after a rebirth request (G2-F3)
RequestRebirthAsync now returns only once the requested births have arrived and gone quiet, but the modal still told the operator to re-expand the tree in a few seconds. ConfirmRebirthAsync re-keys the tree against the same session (as the Refresh button does) when the session and modal are still current, drops the now-stale armed scope, and keeps the outcome line. Refs #745 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
@@ -683,13 +683,29 @@
|
||||
_rebirthOutcome = null;
|
||||
_rebirthError = null;
|
||||
StateHasChanged();
|
||||
var token = _token;
|
||||
var target = _rebirthTarget;
|
||||
try
|
||||
{
|
||||
var published = await BrowserService.RequestRebirthAsync(_token, _rebirthTarget.Scope, default);
|
||||
var published = await BrowserService.RequestRebirthAsync(token, target.Scope, default);
|
||||
// The session's RequestRebirthAsync returns only once the births it asked for have arrived and
|
||||
// gone quiet (bounded by the window), so the tree can be re-read now instead of telling the
|
||||
// operator to re-expand it later (G2-F3). Skipped if the session or modal went away meanwhile.
|
||||
var refreshed = token == _token && Visible && !_disposed;
|
||||
if (refreshed)
|
||||
{
|
||||
// Re-key the tree against the SAME session (as the Refresh button does). The armed scope is
|
||||
// dropped — its node may not be in the rebuilt tree — but the outcome line is kept.
|
||||
_treeGeneration++;
|
||||
_rebirthTarget = null;
|
||||
}
|
||||
|
||||
_rebirthOutcome =
|
||||
$"Rebirth requested for {_rebirthTarget.Kind} — {published} command"
|
||||
$"Rebirth requested for {target.Kind} — {published} command"
|
||||
+ (published == 1 ? "" : "s")
|
||||
+ " published. Re-expand the tree in a few seconds to see the republished metrics.";
|
||||
+ (refreshed
|
||||
? " published. The tree was refreshed with the births that arrived; press Refresh if more appear later."
|
||||
: " published.");
|
||||
_rebirthConfirming = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user