feat(jobs): register the autotag apply, and ask before quitting

The apply was a bare goroutine whose progress lived in a component
field discarded on navigation, with no cancel and no record of where
it stopped if the app quit while it was rewriting tags — beside a
registry that gives every other long-running operation exactly those
things.

`jobs.KindAutotagApply` now carries progress, a cancel wired to the
apply's context, and a terminal state that tells cancelled from
failed. `OnBeforeClose` returns false unconditionally today; it now
asks while a file-writing job is in flight.

Still not durable: quitting cancels cleanly but nothing records where
it stopped for the next launch. That belongs with the deferred
download/jobs work.
This commit is contained in:
2026-08-12 01:18:07 -04:00
parent 1d335c5180
commit 952c25c3d3
7 changed files with 341 additions and 7 deletions
+5
View File
@@ -2,6 +2,7 @@
// This file is automatically generated. DO NOT EDIT
import {autotagservice} from '../models';
import {context} from '../models';
import {jobs} from '../models';
export function AckLibraryWarning(arg1:number):Promise<void>;
@@ -35,6 +36,8 @@ export function SelectSearchCandidate(arg1:string,arg2:string,arg3:string):Promi
export function SetContext(arg1:context.Context):Promise<void>;
export function SetJobRegistry(arg1:jobs.Registry):Promise<void>;
export function Skip(arg1:string):Promise<void>;
export function SplitMixedFolder(arg1:string):Promise<Array<autotagservice.PendingItem>>;
@@ -42,3 +45,5 @@ export function SplitMixedFolder(arg1:string):Promise<Array<autotagservice.Pendi
export function StartAutotagQueue(arg1:number):Promise<void>;
export function StartBackgroundPrefetch():Promise<void>;
export function WritesInFlight():Promise<boolean>;
@@ -66,6 +66,10 @@ export function SetContext(arg1) {
return window['go']['autotagservice']['Service']['SetContext'](arg1);
}
export function SetJobRegistry(arg1) {
return window['go']['autotagservice']['Service']['SetJobRegistry'](arg1);
}
export function Skip(arg1) {
return window['go']['autotagservice']['Service']['Skip'](arg1);
}
@@ -81,3 +85,7 @@ export function StartAutotagQueue(arg1) {
export function StartBackgroundPrefetch() {
return window['go']['autotagservice']['Service']['StartBackgroundPrefetch']();
}
export function WritesInFlight() {
return window['go']['autotagservice']['Service']['WritesInFlight']();
}