Skip to content

Improve filename parsing and title generation; add browser deploy notifications and fallback UI#11

Open
CircleCrop wants to merge 1 commit into
mainfrom
codex/-magic-compare
Open

Improve filename parsing and title generation; add browser deploy notifications and fallback UI#11
CircleCrop wants to merge 1 commit into
mainfrom
codex/-magic-compare

Conversation

@CircleCrop

Copy link
Copy Markdown
Member

Motivation

  • Make the web uploader more robust at recognizing real-world filenames (including spaced separators and explicit src/rip/flt variants) and to surface clearer frame titles for multi-volume/m2ts sources.
  • Improve operator visibility for long Cloudflare Pages deploys by using browser notifications when permitted.
  • Provide a manual fallback to show full source filenames when automatic shortening is ambiguous.

Description

  • Add browser notification helpers and request permission on public deploy clicks, and show a notification on successful public deploys via notifyBrowserPublicDeploySuccess and requestBrowserPublicDeployNotificationPermission in workspace-action-helpers.ts.
  • Relax and extend filename parsing in source-scanner.ts by accepting spaces as separators in FILENAME_RE and STRUCTURED_SOURCE_FILENAME_RE, preserve explicit variants in structured filenames, and prefer explicit variant when parsing candidates.
  • Add volumeLabel detection to infer VOL/BOX labels and incorporate volume-aware titles into formatCandidateFrameTitle, producing titles like VOL1-00000-27240 when applicable.
  • Improve variant prioritization and labeling: treat rip with its own priorities in afterPriority/alternatePriority, add sourceVariantLabel so src/source/ori produce faithful column names, and ensure assetPlan uses these labels.
  • Add a manual fallback feature to produce full m2ts-style frame titles via fallbackUploadPlanFrameTitles in web-upload-view-model.ts and wire a UI button 使用完整 m2ts-帧号 in PairingPreviewPanel plus handler wiring in WebUploadWorkbench.
  • Add and adjust unit tests to cover preserved variants, spaced-dash filenames, changed structured-title expectations, and the fallback frame title behavior (source-scanner.test.ts and web-upload-view-model.test.ts).

Testing

  • Ran the updated unit test suites for the web uploader: source-scanner tests and web-upload-view-model tests, and all new and modified tests passed.
  • Verified that existing tests updated to reflect new title formatting and variant handling succeed.

Codex Task

Copilot AI review requested due to automatic review settings July 11, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the internal web uploader’s robustness and operator UX by expanding filename parsing/title generation (including VOL/BOX-aware titles and explicit src/rip/flt handling), adding a manual “full filename” frame-title fallback, and introducing browser notifications for long-running Cloudflare Pages public deploys.

Changes:

  • Expanded source filename parsing to support spaced separators, preserve explicit variants (src/rip/flt), and generate volume-aware frame titles.
  • Added a manual fallback action to replace frame titles with full source-filename + frame number, wired through the workbench UI.
  • Added optional browser notification permission prompting on deploy clicks and success notifications after public deploy completion.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/internal-site/components/web-uploader/web-upload-workbench.tsx Wires a new “fallback frame titles” action into the uploader workbench.
apps/internal-site/components/web-uploader/web-upload-view-model.ts Adds logic to derive explicit full frame titles from source paths and apply them across the plan.
apps/internal-site/components/web-uploader/web-upload-view-model.test.ts Adds a unit test validating the fallback title formatting behavior.
apps/internal-site/components/web-uploader/web-upload-pairing-preview.tsx Adds a UI button to trigger the fallback frame-title behavior.
apps/internal-site/components/web-uploader/source-scanner.ts Updates parsing regexes, variant prioritization/labels, and adds VOL/BOX title inference.
apps/internal-site/components/web-uploader/source-scanner.test.ts Updates/adds tests covering preserved variants, spaced separators, and volume-aware titles.
apps/internal-site/components/case-workspace/workspace-action-helpers.ts Adds browser notification permission request + success notification for public deploys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +440 to +441
const volume = volumeLabel(candidate.rootHint);
return volume ? `${volume}-${candidate.episode}-${candidate.frameNumber}` : `${episode}-${candidate.frameNumber}`;

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c23b453ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

? sourceVariantLabel(candidate.variant)
: kind === "after"
? "After"
? variantLabel(candidate.variant) || "After"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep heatmap reference aligned with primary after label

When the only comparison file is an explicit rip variant (for example ...-src.png plus ...-rip.png), this now labels the primary after asset Rip, but both scan paths still initialize heatmapReferenceLabel to "After". ensureGeneratedFrames passes that stale label into generateUploadFrames, which calls heatmapAfterAsset and throws because no asset is labeled After; with only one comparison option the selector is hidden, so the upload cannot proceed unless the operator guesses to rename the column. Initialize the heatmap reference from the selected after label when preserving variant labels.

Useful? React with 👍 / 👎.

const IGNORED_BASENAMES = new Set([".ds_store", "thumbs.db"]);
const IGNORED_SUFFIXES = new Set([".json", ".yaml", ".yml", ".txt", ".md", ".csv", ".db", ".log"]);
const FILENAME_RE = /(?<prefix>.+?)[_\-.](?<frame>\d+)(?:[_\-.](?<variant>[^_\-.]+))?$/;
const FILENAME_RE = /(?<prefix>.+?)[_\-. ]+(?<frame>\d+)(?:[_\-. ]+(?<variant>[^_\-. ]+))?$/;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Strip flt when grouping parsed flat variants

With the new space-tolerant flat parser, names like clip - 001 - src.png, clip - 001 - rip.png, and clip - 001 - flt.png are accepted, but matchKeyForName only strips variants listed in MATCH_KEY_VARIANTS; since flt is not listed, the flt candidate keeps the key clip-001-flt while src/rip use clip-001, producing a separate before-count error instead of a misc asset. Add newly supported explicit comparison variants such as flt to the match-key suffix list.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants