Desktop: tab row measures the room inside the sticky bar's padding (the More button was clipped); editor saves skip the in-app preview (their Review step already showed the dry run)
This commit is contained in:
parent
83bb9a621e
commit
26ebb64458
3 changed files with 13 additions and 6 deletions
|
|
@ -557,7 +557,8 @@ export interface ReadState<T> {
|
|||
refresh: () => Promise<void>;
|
||||
}
|
||||
|
||||
export interface WriteRun { method: string; args: Record<string, unknown>; title: string; done: string; after?: () => void }
|
||||
/** preview: false when the screen already showed this dry run (the editors' Review step); the native dialog still follows. */
|
||||
export interface WriteRun { method: string; args: Record<string, unknown>; title: string; done: string; after?: () => void; preview?: false }
|
||||
|
||||
/**
|
||||
* Writes of one app folder: dry run, the native dialog that shows it (Apply / Cancel, or the owner action's own
|
||||
|
|
@ -575,9 +576,11 @@ export function useWrite(projectId: string | null) {
|
|||
const tid = d.toast({ id: job, kind: 'job', title: w.title, detail: t('write.dryRunning'), progress: null, job });
|
||||
try {
|
||||
// the in-app preview of the dry run first (readable, styled); the host's native dialog stays the real gate
|
||||
const dry = await api.call<ToolResult>(w.method, projectId, { args: w.args }, job);
|
||||
if (!dry.ok) { d.updateToast(tid, { kind: 'bad', title: t('write.dryFailed'), detail: withHint(failureText(dry)), progress: undefined, job: undefined }); return null; }
|
||||
if (!(await askPreview(w.title, dry))) { d.updateToast(tid, { kind: 'info', title: t('write.notApplied'), detail: t('write.notAppliedDetail'), progress: undefined, job: undefined }); return null; }
|
||||
if (w.preview !== false) {
|
||||
const dry = await api.call<ToolResult>(w.method, projectId, { args: w.args }, job);
|
||||
if (!dry.ok) { d.updateToast(tid, { kind: 'bad', title: t('write.dryFailed'), detail: withHint(failureText(dry)), progress: undefined, job: undefined }); return null; }
|
||||
if (!(await askPreview(w.title, dry))) { d.updateToast(tid, { kind: 'info', title: t('write.notApplied'), detail: t('write.notAppliedDetail'), progress: undefined, job: undefined }); return null; }
|
||||
}
|
||||
const o = await api.writeWithConfirm(w.method, projectId, w.args, job);
|
||||
if (o.stage === 'dry-run') d.updateToast(tid, { kind: 'bad', title: t('write.dryFailed'), detail: withHint(failureText(o.dryRun)), progress: undefined, job: undefined });
|
||||
else if (o.stage === 'dialog') d.updateToast(tid, { kind: 'info', title: t('write.notApplied'), detail: t('write.notAppliedDetail'), progress: undefined, job: undefined });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue