From 752857e74dbb6ac41d6f9df678df747096bf5594 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Mon, 8 Jun 2026 18:36:51 +0800 Subject: [PATCH] update --- .../DoWorkbench/workbenchTabConstants.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/components/DoWorkbench/workbenchTabConstants.ts diff --git a/src/components/DoWorkbench/workbenchTabConstants.ts b/src/components/DoWorkbench/workbenchTabConstants.ts new file mode 100644 index 0000000..07b31e6 --- /dev/null +++ b/src/components/DoWorkbench/workbenchTabConstants.ts @@ -0,0 +1,19 @@ +/** Tab index for「Finished Good Record (mine)」— used by post-pick redirect. */ +export const WORKBENCH_TAB_FINISHED_GOOD_RECORD_MINE = 2; + +/** Map legacy tab indices to current 7-tab layout (Etra at 1). */ +export function normalizeWorkbenchTabFromUrl(raw: number): number | null { + const allowed = new Set([0, 1, 2, 3, 4, 5, 6]); + if (allowed.has(raw)) return raw; + /** Hidden-Etra 6-tab layout: mine was at 1 */ + const legacyWithoutEtra: Record = { + 0: 0, + 1: WORKBENCH_TAB_FINISHED_GOOD_RECORD_MINE, + 2: 3, + 3: 4, + 4: 5, + 5: 6, + }; + const mapped = legacyWithoutEtra[raw]; + return mapped != null && allowed.has(mapped) ? mapped : null; +}