Skip to content

fix: preserve structured upload variants#15

Open
CircleCrop wants to merge 1 commit into
mainfrom
codex/-parsecandidate-variant-fallback
Open

fix: preserve structured upload variants#15
CircleCrop wants to merge 1 commit into
mainfrom
codex/-parsecandidate-variant-fallback

Conversation

@CircleCrop

Copy link
Copy Markdown
Member

Motivation

  • Structured VSEditor-style filenames include an explicit variant in the regex match and that explicit variant must never be overridden by directory-level variantOverride hints.
  • Non-structured filenames may omit an explicit variant, so the existing fallback order should still allow directory hints to supply a variant before defaulting to output.

Description

  • In parseCandidate the structured branch now uses structured.variant.trim().toLowerCase() and includes a short comment explaining that directory variantOverride must not replace the structured regex variant.
  • Kept the ordinary filename branch fallback order as match.groups.variant ?? variantOverride ?? "output" so explicit filename variants still take precedence.
  • Added the test preserves explicit rip and flt variants inside an after directory to apps/internal-site/components/web-uploader/source-scanner.test.ts to cover explicit structured variants inside a nested after directory.
  • Modified files: apps/internal-site/components/web-uploader/source-scanner.ts and apps/internal-site/components/web-uploader/source-scanner.test.ts.

Testing

  • Ran pnpm --filter @magic-compare/internal-site test -- source-scanner.test.ts and the internal-site test suite completed with all tests passing, including the updated source-scanner.test.ts.
  • Ran pnpm --filter @magic-compare/internal-site lint and ESLint reported no errors.

Codex Task

Copilot AI review requested due to automatic review settings July 15, 2026 05:08

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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