Skip to content

[WC-3181] Barcode Generator: Complete app#2059

Open
yordan-st wants to merge 14 commits intomainfrom
barcode-widget
Open

[WC-3181] Barcode Generator: Complete app#2059
yordan-st wants to merge 14 commits intomainfrom
barcode-widget

Conversation

@yordan-st
Copy link
Contributor

@yordan-st yordan-st commented Feb 9, 2026

Pull request type

New feature (non-breaking change which adds functionality)\


Description

  • Complete Barcode generator app with:
  • comprehensive configuration for all barcode types;
  • improved runtime UI display
  • realistic design preview inside Studio Pro
  • design-time and runtime error handling for incompatible barcode values
  • comprehensive tests matching the current feature set

r0b1n and others added 11 commits February 17, 2026 14:16
- remove unnecessary context, use props instead
- split config, make it more typed
- add class and style to the widget
- remove unnecessary hooks, use simple utils instead
- update icons and tiles
- hide ean128 for qrcode
- change code value to expression
- add button position and card view config
- implement layout, styling and icon
- static value consistency checks
- dynamic value warnings and runtime error alert
- enable displayValue for addons
- improve conditional visibility for certain configurations
- improve descriptions
- added svg assets for barcode preview
- add asset resolver for image sources
- encapsulate svg logic into hook
- cleaner main preview component
@yordan-st yordan-st marked this pull request as ready for review February 17, 2026 16:55
@yordan-st yordan-st requested a review from a team as a code owner February 17, 2026 16:55
return (
<div className="barcode-renderer">
<div className="alert alert-danger" role="alert">
<strong>Barcode Error:</strong> {error}
Copy link
Collaborator

@r0b1n r0b1n Feb 18, 2026

Choose a reason for hiding this comment

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

I think the error messages (I see them in config/validation.ts) are more targeted to the developers, like EAN-13 requires 12 or 13 numeric digits (12 data digits + optional checksum).. So they make less sense for the end user, they are likely not in control of this even. So a more generic error would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get what you mean, the end user will view it as well. But my intended purpose for the runtime messages is to intercept and show what exactly is wrong to developers testing their app with dynamic values.

Will make it so that

  • users receive a generic alert
  • developers see more specific error logs in the console
  • developers get a SP warning, to double check the format and runtime value match

return (
<div className="barcode-renderer">
{restProps.buttonPosition === "top" && downloadButton}
<div className="barcode-preview-barcode-container" style={{ height: displayHeight }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want to have the same DOM structure and class names in both, preview and real world. Ideally, via react components reuse, but reuse can introduce additional complexity we don't always want, so it should be reasonable effort.
Bit having different classes defeats the purpose of design preview, we don't want to maintain two different stylesheets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplified it as much as possible, but we need additional DOM elements to preview how an overlay image would look like. So those are still in there.

- simplified preview DOM
- removed redundant css classes
- merged remaining preview styles into main stylesheet
- renamed qr overlay property and css classes
- updated tests error messages to check for new messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments