mirror of
https://github.com/block/buzz.git
synced 2026-11-02 07:22:55 +00:00
feat(desktop): plumb WorkspaceApplyResult through frontend boundary (Phase 3e)
Surfaces the degraded-apply result from the backend all the way to the UI:
tauri.ts:
- Add WorkspaceApplyResult interface { applied: boolean; degraded: string[] }
- applyCommunity() now returns Promise<WorkspaceApplyResult> instead of
Promise<void>; passes typed result through from apply_workspace command.
useCommunityInit.ts:
- Consumes applyResult from applyCommunity instead of discarding void.
- applied: false (drain-failed) → park on the loading gate so the user
can retry via a workspace switch; the specific degradation messages are
shown as the error.
- applied: true with degraded entries → console.warn (informational;
workspace IS active; post-commit step failed gracefully).
- Existing catch block still handles genuine Tauri errors (poisoned lock,
invalid nsec, etc.) unchanged.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
parent
00a3381902
commit
91859ea806
@@ -1142,14 +1142,27 @@ export async function cancelPairing(): Promise<void> {
|
||||
await invokeTauri("cancel_pairing");
|
||||
}
|
||||
|
||||
/**
|
||||
* Result from `apply_workspace` / `applyCommunity`.
|
||||
*
|
||||
* - `applied: true` — new scope committed; post-commit failures surface in
|
||||
* `degraded` (informational — workspace IS active).
|
||||
* - `applied: false` — drain failed; old scope still active; `degraded` names
|
||||
* what could not be stopped or restored by compensation.
|
||||
*/
|
||||
export interface WorkspaceApplyResult {
|
||||
applied: boolean;
|
||||
degraded: string[];
|
||||
}
|
||||
|
||||
export async function applyCommunity(
|
||||
relayUrl: string,
|
||||
nsec?: string,
|
||||
token?: string,
|
||||
reposDir?: string,
|
||||
agentManagedProfiles?: boolean,
|
||||
): Promise<void> {
|
||||
await invokeTauri("apply_workspace", {
|
||||
): Promise<WorkspaceApplyResult> {
|
||||
return invokeTauri<WorkspaceApplyResult>("apply_workspace", {
|
||||
relayUrl,
|
||||
nsec: nsec ?? null,
|
||||
token: token ?? null,
|
||||
|
||||
Reference in New Issue
Block a user