style: format web apps with prettier and sort imports
Apply repo-wide Prettier/lint normalization across admin-web, desktop-client and ops-web: single quotes, no semicolons, trailing commas, consistent line wrapping, and import ordering. Also drop an unused brand-logo import in DesktopShell.vue. No behavior changes — formatting only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,10 +231,12 @@ function isDoubaoMojibakeRepairableCharacter(value: string): boolean {
|
||||
}
|
||||
|
||||
function containsDoubaoMojibakeSignal(value: string): boolean {
|
||||
return /[\u0080-\u009f]/.test(value) ||
|
||||
return (
|
||||
/[\u0080-\u009f]/.test(value) ||
|
||||
/(?:Ã.|Â[\u0080-\u017f]|â[\u0080-\u017f\u2000-\u20ff]|[åæèéäãï][\u0080-\u017f\u02c0-\u02ff\u2000-\u20ff]|ã[\u0080-\u017f\u02c0-\u02ff\u2000-\u20ff])/.test(
|
||||
value,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
function repairDoubaoMojibakeSegment(value: string): string {
|
||||
@@ -467,9 +469,10 @@ function selectBestDoubaoText(primary: string | null, secondary: string | null):
|
||||
return secondaryScore > primaryScore ? secondaryText : primaryText
|
||||
}
|
||||
|
||||
function resolveDoubaoSubmissionAnswer(input: {
|
||||
function resolveDoubaoSubmissionAnswer(input: { answer: string | null }): {
|
||||
answer: string | null
|
||||
}): { answer: string | null; source: 'sse' | null } {
|
||||
source: 'sse' | null
|
||||
} {
|
||||
const answer = normalizeOptionalString(input.answer)
|
||||
if (answer && !containsDoubaoMojibakeSignal(answer)) {
|
||||
return { answer, source: 'sse' }
|
||||
@@ -867,12 +870,11 @@ function collectAnswerFragments(
|
||||
return result
|
||||
}
|
||||
|
||||
function appendDoubaoChunkDeltaAnswer(
|
||||
summary: DoubaoStreamSummary,
|
||||
payload: unknown,
|
||||
): void {
|
||||
function appendDoubaoChunkDeltaAnswer(summary: DoubaoStreamSummary, payload: unknown): void {
|
||||
const text =
|
||||
isRecord(payload) && typeof payload.text === 'string' ? normalizeOptionalString(payload.text) : null
|
||||
isRecord(payload) && typeof payload.text === 'string'
|
||||
? normalizeOptionalString(payload.text)
|
||||
: null
|
||||
if (text) {
|
||||
summary.answer = mergeAnswerText(summary.answer, text)
|
||||
}
|
||||
@@ -994,7 +996,10 @@ function isDoubaoRecoverablePageError(error: string): boolean {
|
||||
return error === 'doubao_query_timeout' || error === 'doubao_page_navigation_interrupted'
|
||||
}
|
||||
|
||||
function buildDoubaoPageNavigationResult(page: PlaywrightPage, detail: string): DoubaoPageQueryFailureResult {
|
||||
function buildDoubaoPageNavigationResult(
|
||||
page: PlaywrightPage,
|
||||
detail: string,
|
||||
): DoubaoPageQueryFailureResult {
|
||||
return {
|
||||
ok: false,
|
||||
error: 'doubao_page_navigation_interrupted',
|
||||
@@ -2852,8 +2857,7 @@ const doubaoQueryInPage = async (
|
||||
title: normalize(document.title),
|
||||
modelLabel: resolveModelLabel(),
|
||||
modeLabel,
|
||||
thinkingModeApplied:
|
||||
modeKind === 'thinking' ? true : (modeSnapshot.applied ?? null),
|
||||
thinkingModeApplied: modeKind === 'thinking' ? true : (modeSnapshot.applied ?? null),
|
||||
deepThinkEnabled: toggleState(deepThinkButton),
|
||||
domAnswer: snapshot.answerText,
|
||||
domReasoning: snapshot.reasoningText,
|
||||
@@ -2869,11 +2873,7 @@ const doubaoQueryInPage = async (
|
||||
}
|
||||
|
||||
if (hasLoginGate()) {
|
||||
return fail(
|
||||
'doubao_login_required',
|
||||
bodyText(),
|
||||
composer?.getBoundingClientRect().top ?? null,
|
||||
)
|
||||
return fail('doubao_login_required', bodyText(), composer?.getBoundingClientRect().top ?? null)
|
||||
}
|
||||
|
||||
if (!composer) {
|
||||
@@ -3036,9 +3036,9 @@ export const doubaoAdapter: MonitorAdapter = {
|
||||
if (!isDoubaoExecutionContextNavigationError(error)) {
|
||||
throw error
|
||||
}
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: DOUBAO_PAGE_READY_TIMEOUT_MS }).catch(
|
||||
() => undefined,
|
||||
)
|
||||
await page
|
||||
.waitForLoadState('domcontentloaded', { timeout: DOUBAO_PAGE_READY_TIMEOUT_MS })
|
||||
.catch(() => undefined)
|
||||
await page.waitForLoadState('networkidle', { timeout: 3_000 }).catch(() => undefined)
|
||||
pageResult = buildDoubaoPageNavigationResult(page, formatUnknownError(error))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user