Repository navigation
Fix duplicate QR design choices while preserving saved styles - #5
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> |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |

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.