Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(ui): 危险操作的确认框读作 alertdialog 并关联说明文字

longmeidaobd3a9e932d93
diff --git a/frontend/src/ui-kit/modal.ts b/frontend/src/ui-kit/modal.ts
index 4bb55e3f4..405d6f4a0 100644
--- a/frontend/src/ui-kit/modal.ts
+++ b/frontend/src/ui-kit/modal.ts
@@ -97,9 +97,12 @@ export function confirmModal({title,body,items=[],confirmLabel,cancelLabel='取
dialog.className='ui-geist-modal';
const titleId=`geist-modal-title-${++modalSeq}`;
dialog.setAttribute('aria-labelledby',titleId);
+ dialog.setAttribute('aria-describedby',`${titleId}-body`);
+ // 不可撤销的确认读作 alertdialog:读屏进来先念标题和那句后果,而不是当成普通对话框(同 BoardUI Modal)。
+ if(danger)dialog.setAttribute('role','alertdialog');
dialog.innerHTML=`<header class="ui-geist-modal-header"><h3 id="${titleId}"></h3></header>
<div class="ui-geist-modal-scroll"><div class="ui-geist-modal-body">
- <p></p><div data-modal-error></div></div></div>
+ <p id="${titleId}-body"></p><div data-modal-error></div></div></div>
<footer class="geist-modal-footer">
<div><button type="button" class="geist-button" data-modal-cancel></button></div>
<div><button type="button" class="geist-button primary" data-modal-confirm></button></div>
diff --git a/frontend/test/confirm-modal.test.ts b/frontend/test/confirm-modal.test.ts
index 5c1c796b9..27850dc2a 100644
--- a/frontend/test/confirm-modal.test.ts
+++ b/frontend/test/confirm-modal.test.ts
@@ -18,6 +18,9 @@ it('危险操作聚焦取消,取消不写入,关闭归还焦点', async () =
const pending = confirmModal({title:'清理记录',body:'清理 2 项',confirmLabel:'清理记录',danger:true,onConfirm:write});
const cancel = document.querySelector<HTMLButtonElement>('[data-modal-cancel]')!;
expect(document.activeElement).toBe(cancel);
+ const dialog = document.querySelector('dialog')!;
+ expect(dialog.getAttribute('role')).toBe('alertdialog');
+ expect(document.getElementById(dialog.getAttribute('aria-describedby')!)?.textContent).toBe('清理 2 项');
cancel.click();
expect((await pending).confirmed).toBe(false);
expect(write).not.toHaveBeenCalled(); expect(document.activeElement).toBe(trigger);
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index c5898225a..dd331816b 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -2,7 +2,7 @@
(function() {
try {
var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "2ae721fa-c2a9-483e-9d8c-5b9bebdaecf4", e._sentryDebugIdIdentifier = "sentry-dbid-2ae721fa-c2a9-483e-9d8c-5b9bebdaecf4");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d1b7d4c8-5cb7-4187-9894-40c71bb5fdce", e._sentryDebugIdIdentifier = "sentry-dbid-d1b7d4c8-5cb7-4187-9894-40c71bb5fdce");
} catch {}
})();
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {
@@ -13923,9 +13923,9 @@ function ll({ title: e, body: t, items: n = [], confirmLabel: r, cancelLabel: i
let s = document.activeElement, c = document.createElement("dialog");
c.className = "ui-geist-modal";
let l = `geist-modal-title-${++cl}`;
- c.setAttribute("aria-labelledby", l), c.innerHTML = `<header class="ui-geist-modal-header"><h3 id="${l}"></h3></header>
+ c.setAttribute("aria-labelledby", l), c.setAttribute("aria-describedby", `${l}-body`), o && c.setAttribute("role", "alertdialog"), c.innerHTML = `<header class="ui-geist-modal-header"><h3 id="${l}"></h3></header>
<div class="ui-geist-modal-scroll"><div class="ui-geist-modal-body">
- <p></p><div data-modal-error></div></div></div>
+ <p id="${l}-body"></p><div data-modal-error></div></div></div>
<footer class="geist-modal-footer">
<div><button type="button" class="geist-button" data-modal-cancel></button></div>
<div><button type="button" class="geist-button primary" data-modal-confirm></button></div>
@@ -84204,4 +84204,4 @@ if (!$9) throw Error("主界面宿主缺失");
Jze($9);
export { VL as $2ec61d1d4f780267$export$a8a3e93435678ff9, YL as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, fz as $542a13ca2fa5b484$export$5b6b19405a83ff9d, wD as $72abaeab4d80592f$export$78efe591171d7d45, iB as $76d00c5a4edb230a$export$76ccd210b9029917, tB as $76d00c5a4edb230a$export$816b5d811295e6bc, sB as $76d00c5a4edb230a$export$b59bdbef9ce70de2, lB as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, eB as $76d00c5a4edb230a$export$f850895b287ef28e, Ahe as $b4f18e3395fe64d7$export$3d96ec278d3efce4, khe as $b4f18e3395fe64d7$export$3e41faf802a29e71, Ehe as $b4f18e3395fe64d7$export$b2539bed5023c21c, pB as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Nhe as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, dE as $ea3928288112382f$export$439d29a4e110a164, Tz as $f2ff30fde7b014be$export$3ddf2d174ce01153, Mz as $fe21c36db05242bb$export$a98f0dcb43a68a25, Nz as $fe21c36db05242bb$export$d7b12c4107be0d61, fge as $l, Kj as ACCENTS, pAe as AMANE_BRIDGE_CHECK_URL, R$ as AMANE_BRIDGE_KEY, mAe as AMANE_BRIDGE_REBUILD_URL, sr as ApiError, qU as ArtSlot, g2 as BATCH_DELETE_TEXT, J as Button, yL as ButtonLink, GB as Bx, p$ as CLEANUP_ENTRY, f$ as CLEANUP_ENTRY_GRID, Zf as CLEANUP_HASH_REDIRECTS, Yf as CLEANUP_TOOLS, vn as CLOUD_LOCATIONS, U1 as CLOUD_PROXY_HELP, Kr as COLUMN_SORT, t1 as CONFIGURATION_KEY, qY as CONFIGURATION_URL, hAe as COOKIE_TEXT_LIMIT, L$ as COVER_JOB_KEY, Yi as CREDENTIAL_STATE, N$ as CUSTOM_SOURCES_KEY, M$ as CUSTOM_SOURCES_URL, dG as CatalogViewToggle, zV as Checkbox, RV as CheckboxGlyph, kV as ChevronSortDown, KU as Chip, nW as CloudDownloadDialog, NH as CollapseChevron, MH as CollapseRegion, o$ as CollectionSummary, Kwe as DEFAULT_CATEGORY, dr as DEFAULT_SORT, MQ as DIAGNOSTICS_KEY, GTe as DIRECTORY_TEMPLATE_ERROR, lW as DISCOVERY_SORTS, YU as DOWNLOADS_KEY, JU as DOWNLOADS_URL, pY as DUPLICATES_KEY, qJ as DataTableFooter, UJ as DataTableFrame, KJ as DataTableSort, zH as Disclosure, oye as DownloadsPanel, rge as E3, qwe as ENTITY_REVIEW_KINDS, V1 as ENTRY_LINKS_HELP, H1 as ENTRY_LINKS_HINT, LB as Ea, Lge as EmptyFocusButton, dV as EmptyState, LH as ErrorText, $_e as ExternalLink, Vr as FEEDS_KEY, tX as FEED_SCHEDULE_KEY, u$ as FIELDSET_FOOT, NFe as FLOW_LABEL_X, X3 as FLOW_VIEWBOX, zr as FOLLOW_CHECK_KEY, Rr as FOLLOW_CREDENTIALS_KEY, N8 as FOLLOW_INITIAL_RANGE_OPTIONS, Lr as FOLLOW_MANAGE_KEY, FZ as FOLLOW_MANAGE_NAV, Br as FOLLOW_RESOLVE_KEY, eX as FOLLOW_SCHEDULE_KEY, nve as Fact, tve as FactList, RH as FieldLabel, C$ as Fieldset, S$ as FieldsetTitle, Dpe as FilterGlass, fL as FilterGlassRows, dL as FilterIconButton, pL as FilterPill, Q_e as Footer, HB as Gg, mL as GlassPill, YB as HN, IH as Help, nV as HintText, TFe as IDLE_POLL_MS, Fwe as IDLE_REPAIR, sL as IconButton, PQ as IndexSearch, sV as Input, oV as InputBase, T$ as IssueRow, uM as JAV_LAYOUTS, F0 as JAV_RECOMMENDATION_GRID, EX as JUNK_KEY, vW as JavHeader, kwe as KEEP_LABELS, Ur as LAYOUTS, B1 as LIBRARY_FOLDER_HELP, QV as LIBRARY_PROCESSING_KEY, zY as LINKS_KEY, BY as LINK_CHECK_KEY, _Te as LINK_KINDS, VY as LINK_PRUNE_KEY, nr as LOC, tV as Label, O$ as LibraryProcessingCard, OV as LibraryShortcuts, mH as LinkButton, mge as Lo, DH as LoadingDots, ige as M6, STe as MEDIA_PROCESSING_KEY, rX as MEDIA_PROCESSING_URL, vY as MEDIA_REPAIR_KEY, _Y as MEDIA_REPAIR_URL, yr as MEDIA_SOURCES_KEY, _s as MEDIA_SOURCE_ICONS, gn as MEDIA_SOURCE_OPTIONS, NV as MENU_ITEM, PV as MENU_ITEM_INTERACTIVE, MV as MENU_POPOVER_SURFACE, gge as Ma, vH as MenuDialog, xK as MixCard, cV as ModalFrame, xx as MotionConfigContext, $B as NR, w$ as NameLink, uV as Note, Nge as OA, oX as ORGANIZE_KEY, p2 as ORGANIZE_PARAMETER_HINT, f2 as ORGANIZE_SCOPE_HINT, d2 as ORGANIZE_TEXT, lX as ORPHAN_RECORDS_KEY, h2 as ORPHAN_RECORDS_TEXT, BB as OV, TB as P7, CX as PERFORMER_DELETE_KEY, hye as PHASES, JY as PICK_FOLDER_URL, h$ as PLAIN_STAT_STRIP, A$ as PLAYLISTS_KEY, bje as POLICY_COLUMNS, Sje as POLICY_COVER_NOTE, xje as POLICY_MATRIX, z1 as POLICY_SUMMARY, GJ as Pagination, D$ as PathLine, ZB as Pf, II as PillTabList, Fke as PlainStat, kH as Progress, CY as QUALITY_GOALS_KEY, XB as RB, M0 as RELEASE_COLUMN_VISIBILITY_KEY, j0 as RELEASE_COLUMN_WIDTHS_KEY, uW as RELEASE_SORTS, Xje as RELEASE_SORT_COLUMNS, _$ as REPAIR_CARD_TEXT, yY as REPAIR_LIBRARIES_KEY, mX as RESOURCE_APPLY_KEY, pX as RESOURCE_SCAN_KEY, m2 as RESOURCE_SYNC_TEXT, Vke as RESULT_PANEL, Hke as RESULT_SECTION, Gwe as REVIEW_CATEGORIES, TX as REVIEW_COUNTS_KEY, Jwe as REVIEW_DECISION_LABELS, EY as REVIEW_KEY, DY as REVIEW_LABELS, kY as REVIEW_QUEUES, AY as REVIEW_QUEUE_LABELS, HG as RetryNote, Mge as Rf, eV as Rk, Y_e as Rows, dAe as SCRAPING_CHECK_URL, F$ as SCRAPING_COVER_URL, I$ as SCRAPING_KEY, uAe as SCRAPING_SETTINGS_URL, aU as SEGMENT, iU as SEGMENTED_TRACK, $Y as SETTINGS_KEY, YY as SETTINGS_URL, fr as SORT_DEFAULT_DIR, ur as SORT_OPTIONS, yn as SOURCE_LABELS, x3 as STATS_KEY, Nke as STAT_STRIP, Pke as STAT_STRIP_SIX, J_e as Section, Uke as SectionHeading, Z_e as SectionSkeleton, rU as SegmentedRadioGroup, _ve as SegmentedTabList, FG as Segments, WJ as Select, UU as Select$1, a1 as SelectField, WU as SelectItem, eY as SelectionActions, wj as SelectionDock, tY as SelectionPopover, PH as SettingsCard, q_e as SettingsRow, FH as SettingsSectionLabel, IG as Shuffle, ove as SiteLabel, pG as SortDirectionIcon, LG as SortKeys, hQ as SourceAvatar, UH as SourceLabel, BH as SourceMark, X_e as Stack, Ike as StatCard, E$ as StatusLabel, kge as Su, $2 as Switch, GI as TASKS_KEY, mFe as TASTE_REFRESH_KEY, hFe as TASTE_WINDOWS, nX as THUMBNAIL_JOBS_KEY, OX as TRASH_KEY, ope as TRIGGER_LABELS, MJ as Table, nY as TableColumnControls, rY as TableColumnResizer, aY as TableSelectionHeader, t$ as TagManager, eve as TaskCenterLink, AH as TaskProgress, iV as TextField, rV as TextFieldContext, RB as Un, iW as WANTS_KEY, m4 as WantMagnets, Kg as WithPromise, kB as Wt, IB as Xc, QB as Xf, jB as Xl, AB as Xt, DB as _8, o as __commonJSMin, s as __exportAll, l as __toESM, jge as aB, Ei as addAlias, Ti as addSource, oW as addWant, uS as animate, B as apiGet, V as apiSend, iM as appSettingsStore, uEe as applyConfirmText, SX as applyLeftovers, lEe as applyPlanText, fEe as applyText, cM as applyTheme, vy as asNumber, QTe as attachOrphan, ci as authorAvatar, ui as authorGroups, si as authorInitial, oi as authorName, bq as autoResetPageIndex, _o as avatarInner, D3 as bandRows, KTe as baseName, Pwe as batchOperate, wue as beginPlayerGuidePreview, kj as boundedPreference, jwe as bulkCloudPreferences, hV as busyProps, Age as cB, UNe as cachedMagnetStates, Bg as calcGeneratorVelocity, tTe as canApprove, mg as cancelFrame, rEe as candidateText, CU as cardClass, CM as cardRatio, BJ as catalogListSkeletonCellHtml, FB as cc, Gi as checkEvidenceGap, Wi as checkFailures, Fi as checkFeeds, xTe as checkLine, Hi as checkReceipt, Ui as checkSummary, _Ae as checkText, Ki as checkedText, cK as clickedBlank, K5 as closeDrawerAfterNav, Cwe as cloudLocations, b0 as cloudProxySkeleton, WC as clsx, yge as cn, sv as collectMotionValues, Bq as columnVisibilityFeature, DJ as column_getCanSort, CJ as column_getSortFn, $we as commonReviewSources, tW as composingKey, Af as configurationSection, yFe as configureTasteBrowser, ll as confirmModal, ipe as controlTask, nq as copyInstancePropertiesWithoutMemos, lo as coverUrl, jq as createColumnHelper, iAe as createPlaylist, Xi as credentialDone, g0 as credentialsSkeleton, uTe as currentReviewRow, q as cx, WB as dZ, sTe as decisionPayload, cTe as decisionReceipt, oTe as defaultChoice, mEe as deletePerformerVideos, oAe as deletePlaylist, x as diagnosticHeaders, R1 as diagnosticsSkeleton, wye as discoveryArtwork, dW as discoveryKey, xye as discoveryScore, r9 as disposeStage, Dwe as distinctName, Bi as dropSources, Oge as du, Mwe as duplicateVictims, QI as elapsedText, nn as entityDisplayName, go as entityFaceImg, Pn as entityPath, ti as errorHeadline, lr as errorMessage, z as esc, yq as expandRowModel, vB as f1, bo as facePos, ei as feedIntervalText, V$ as fetchAmaneBridge, vi as fetchCheckJob, n1 as fetchConfiguration, B$ as fetchCoverJob, _i as fetchCredentials, P$ as fetchCustomSources, wX as fetchDeletePerformers, pEe as fetchDeletePlan, NQ as fetchDiagnostics, fW as fetchDiscoveries, hY as fetchDuplicates, epe as fetchEarlier, TTe as fetchFeedSchedule, Mi as fetchFeeds, gi as fetchFollow, wTe as fetchFollowSchedule, AX as fetchJunkSummary, oH as fetchLibraryProcessing, WY as fetchLinkCheck, GY as fetchLinkPrune, UY as fetchLinkStats, CTe as fetchMediaProcessing, bY as fetchMediaRepair, br as fetchMediaSources, sX as fetchOrganize, RTe as fetchOrganizeExample, uX as fetchOrphanRecords, ji as fetchPending, j$ as fetchPlaylists, wY as fetchQualityGoals, hW as fetchReleases, xY as fetchRepairLibraries, yi as fetchResolveJob, gX as fetchResourceApply, hX as fetchResourceScan, IY as fetchReview, kX as fetchReviewCounts, iX as fetchSettings, z$ as fetchSources, S3 as fetchStats, bi as fetchSuggestions, qI as fetchTasks, q3 as fetchTaste, bFe as fetchTasteJob, ETe as fetchThumbnailJobs, jX as fetchTrashSummary, aW as fetchWants, Zwe as filterReviewRows, er as firstGrapheme, RK as flexRender, FFe as flowGraph, IFe as flowLabel, PPe as fmtCount, Jn as fmtDur, Xn as fmtSize, $fe as foldByKind, gpe as foldRoutine, Li as followFeedByName, Hr as followSuggestKey, vpe as followupDetail, Qfe as followupTally, pg as frame, CB as g4, Uq as getDefaultPaginationState, SM as gridLayout, li as groupByAuthor, hpe as groupFollowups, NY as groupReviewRows, sEe as hasChanges, _X as hasResourceRoots, YI as hasResultProblems, EFe as historySpan, yB as i2, wFe as importTasteExport, _0 as indexersSkeleton, Ig as interpolate, cW as invalidateWants, ZI as isActive, $r as isBroken, qr as isLayout, vv as isMotionValue, OY as isReviewCategory, _pe as isRoutine, v0 as javBrowserSkeleton, L0 as javContentSkeleton, hM as javLayout, I0 as javTagSkeleton, yEe as junkBreakdown, sAe as keepPlaylist, ke as keepPreviousData, pi as keepSelected, C3 as known, $he as l7, mpe as latestOfKind, $n as leadingGraphemes, KPe as lengthRows, Cr as localTime, po as logoUrl, Ii as lookupFeedActor, wB as m7, UB as mM, Dn as mapLimit, Ai as markItem, O3 as max, WPe as mediumRows, tpe as mergeFinished, k3 as min, hTe as mirrorText, Rwe as missingToolText, gY as mixedCloudPreferences, nL as momentText, dS as motion, lv as motionValue, rn as nameFallback, Ue as notifyManager, age as oe, JTe as organizeOutcome, $0 as overlayHost, Jr as pageSizeOf, fi as pageWindow, hr as paginationRange, zi as patchSource, Op as peachHistory, Op as peachHistory$1, aTe as pendingGenres, IPe as percentText, VTe as pickOrganizeFolder, m$ as plainStatClass, qTe as planSummary, w3 as playedFor, RPe as playedItemUrl, KI as pollInterval, Ys as popCount, rAe as posterUrl, qbe as previewLibraryColor, BTe as previewOrganize, Vwe as previewUrl, fpe as problemDestination, tH as processingActive, $I as progressText, HH as providerIcon, bTe as pruneText, yX as purgeCount, $Te as purgeOrphan, KB as pv, Dge as qE, H as queryClient, bB as r2, MFe as radarRows, VPe as radialArc, HPe as radialBarSize, BPe as radialCeiling, zPe as radialSlices, RN as randomId, AFe as rankDetail, jFe as rankShares, E3 as reachedShare, eL as readableErrorHeadline, Sye as recommendationScore, dTe as recordGenre, tEe as recordsText, cAe as recreatePlaylist, tAe as refreshPlaylists, El as relayoutCovers, N0 as releaseColumns, pW as releaseFilters, mW as releaseKey, Vi as reloadFollowManage, mTe as reloadReview, Tje as rememberShape, UTe as rememberTemplates, Di as removeAlias, Pi as removeFeed, wi as removeSource, CFe as removeTasteSource, sW as removeWants, Oi as renameAliasGroup, aAe as renamePlaylist, Se as replaceEqualDeep, JPe as replayRows, re as require_jsx_runtime, A as require_react, N as require_react_dom, QK as require_with_selector, vye as resetWants, mr as resolveFollowSort, Ug as resolveStartTime, k_e as restartEffectText, nAe as resumeAssetId, Xwe as reviewGroupingOptions, MY as reviewQueueData, jY as reviewQueueOf, vEe as reviewSummary, Qwe as reviewWindow, rTe as rowEvidence, FY as rowFieldName, Xq as rowPaginationFeature, _J as rowSelectionFeature, AJ as rowSortingFeature, PY as rowSubject, iTe as rowTags, nTe as rowTitle, Xhe as s5, ki as saveCredential, cEe as scanLine, jTe as schedulePollInterval, bye as searchNote, eTe as selectReviewRange, mi as selectionState, Ni as setFeedEnabled, Ci as setSourceEnabled, Pf as settingsPath, pTe as settleReviewRows, Ewe as sharedNamePrefix, kp as shellNavigate, x8 as showToast, Bn as siteMarkUrl, uq as skipFirstRun, PI as sortCx, Xr as sortLabel, bn as sourceDefaultCost, Ji as sourceIconUrl, dEe as sourceMeta, Bs as spinnerHtml, Pg as spring, pV as spriteGlyph, xi as startCheck, vTe as startLinkCheck, yTe as startLinkPrune, HTe as startOrganize, Si as startResolve, aEe as startResourceApply, iEe as startResourceScan, SFe as startTasteRefresh, Mke as statCardClass, cpe as statusLabel, Lwe as statusLine, Qr as statusText, wM as storeJavLayout, lTe as submitDecision, rL as summaryItems, Mq as tableFeatures, dq as tableMemo, di as tableRows, dpe as taskIssues, ppe as taskSubject, J3 as tasteDate, OFe as tasteDimensions, DFe as tasteHours, K3 as tasteKey, _Fe as tasteRefetchInterval, vFe as tasteTime, BI as textLang, A0 as tierPlaceholdersHtml, rh as time, uge as tl, hi as toggleGroup, Y3 as topScores, xge as um, hge as uo, hH as useAction, AZ as useBackgroundJob, uG as useCatalogView, FU as useClientUpdates, hm as useConstant, iL as useEntityNames, uL as useHorizontalScroller, gm as useIsomorphicLayoutEffect, sK as useLibraryTints, It as useMutation, BV as useOverlayScrollbar, Ft as useQuery, ae as useQueryClient, $x as useReducedMotion, ATe as useRunSchedule, OTe as useSaveFollowSchedule, aX as useSaveSettings, MTe as useSaveThumbnailMode, jJ as useTable, XJ as useTablePreferences, _L as useViewGlide, Nwe as victimBytes, dge as vl, yye as wantName, LPe as watchNote, T3 as watchedShare, Ac as wireHorizontalScroller, WTe as withOrganizeJob, Cye as writeJavQuery };
-//# debugId=2ae721fa-c2a9-483e-9d8c-5b9bebdaecf4
\ No newline at end of file
+//# debugId=d1b7d4c8-5cb7-4187-9894-40c71bb5fdce
\ No newline at end of file