Repository navigation
Fix duplicate QR design choices while preserving saved styles - #5
Draft
CompleteDotTech wants to merge 2 commits into
Draft
CompleteDotTech wants to merge 2 commits into
CompleteDotTech wants to merge 2 commits into
Conversation
| import { describe, expect, it } from 'vitest'; | ||
| import { bodyShapes, defaultDesignConfig, eyeBalls, eyeFrames, normalizeDesignConfig, templates } from '../src/qr/design'; | ||
| import { renderQr } from '../src/qr/renderer'; | ||
| import type { DesignConfig } from '../src/shared/types'; |
There was a problem hiding this comment.
Finish and deletes all Designconfig.... Thanks
There was a problem hiding this comment.
🟡 Changes recommended
The SVG export hint is misleading because downloads use the selected saved design rather than the current preview, so it must clarify that users need to save changes first.
1 open issue
What changed in this PR
This PR addresses #2 by limiting the QR design picker to distinct geometries while preserving saved styles through legacy aliases.
Changes:
- Offer five body shapes, three eye frames, and two eye balls, with normalized template values.
- Add tests for distinct output, legacy aliases, invalid style inputs, and PNG behavior.
- Document export styling limits and unsupported legacy eye-flip fields.
| File | Description |
|---|---|
tests/design-styles.test.ts |
Adds geometry, compatibility, preset, and PNG regression tests. |
src/qr/renderer.ts |
Simplifies rendering branches to use canonical style names. |
src/qr/design.ts |
Defines distinct choices, maps legacy aliases, and normalizes presets. |
src/client/App.tsx |
Adds export-format guidance beside download controls. |
README.md |
Documents style counts, compatibility aliases, and rendering limitations. |
Review effort: Max
| {selected && <a className="btn btn-secondary" href={`/api/qr-codes/${selected.id}/render?file=svg`}><Download size={14} aria-hidden /> SVG</a>} | ||
| </div> | ||
| <p className="note">PDF and EPS are intentionally disabled in this MVP — print renderer is the next phase.</p> | ||
| <p className="note">SVG preserves the preview design. PNG uses standard square modules and foreground/background colors; shapes, eye colors, gradients, and logos are SVG-only. PDF and EPS export are unavailable.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The design picker exposed 22 body names, 15 eye frames, and 18 eye balls even though they produced only 5, 3, and 2 distinct geometries. Offer those distinct choices, normalize old names to visually identical aliases, and keep template values selectable. Invalid JSON style values still fall back safely.
Explain beside the download controls and in the README that PNG uses standard modules and foreground/background colors; SVG preserves shapes, eye colors, gradients, and logos. Legacy eye-flip fields remain documented as unsupported compatibility fields.
Fixes #2.
Validation:
npm run typecheck,npm test(57 passed),npm run build, andnpm run smoke:qrpassed.git diff --checkpassed.Local tests used synthetic example.com data. Hosted CI and scanner/device acceptance are not claimed.