chore: sync frontend contract flow with declarative effects

This commit is contained in:
Tunglies
2026-10-04 13:45:02 +08:00
43 changed files with 810 additions and 941 deletions
@@ -28,7 +28,7 @@ import getSystem from '@/utils/get-system'
type Remedy = 'installAndRestart' | 'reinstallAndRestart' | 'restartOnly'
const remedyFor = (reason: ServiceRequestReason): Remedy =>
reason === 'serviceLocationRefused'
reason === 'serviceLocationRefused' || reason === 'serviceNotAutoStarted'
? 'reinstallAndRestart'
: reason === 'sysproxySidecarReady'
? 'restartOnly'
@@ -41,6 +41,8 @@ const EXPLANATION = {
tunNeedsService: 'layout.components.sysproxyPrivilege.tunMessage',
serviceLocationRefused:
'layout.components.serviceMigration.locationRefusedMessage',
serviceNotAutoStarted:
'layout.components.serviceMigration.notAutoStartedMessage',
} as const
const TITLE = {
@@ -48,6 +50,7 @@ const TITLE = {
sysproxySidecarReady: 'layout.components.sysproxyPrivilege.title',
tunNeedsService: 'layout.components.sysproxyPrivilege.tunTitle',
serviceLocationRefused: 'layout.components.serviceMigration.repair',
serviceNotAutoStarted: 'layout.components.serviceMigration.repair',
} as const
const stateToRestore = (