Skip to content

Feat: Add QR code ID display customization feature#2053

Merged
DonKoko merged 2 commits intomainfrom
2051-feat-customize-value-shown-on-shelf-qr-id
Sep 19, 2025
Merged

Feat: Add QR code ID display customization feature#2053
DonKoko merged 2 commits intomainfrom
2051-feat-customize-value-shown-on-shelf-qr-id

Conversation

@DonKoko
Copy link
Copy Markdown
Contributor

@DonKoko DonKoko commented Sep 18, 2025

Implement workspace-level setting to allow admins to choose between displaying QR code ID or SAM ID on QR code labels. This addresses issue #2051 by providing organizations flexibility in how they identify assets on QR codes.

Key changes:

  • Add qrIdDisplayPreference enum to Organization schema with QR_ID and SAM_ID options
  • Create QrIdDisplayPreferenceSelector component using popover pattern for consistent UI
  • Update QR code preview logic to use useCurrentOrganization hook instead of prop drilling
  • Add preference setting to workspace general settings page
  • Update bulk QR download to respect organization preference
  • Modify API endpoints to include sequentialId for SAM ID display
  • Add database migration for new preference field

The feature is fully backward compatible with QR_ID as the default preference.

Pending:

  • Test everything on staging app
  • Create knowledge base article about it
  • Update developer documentation if needed

Implement workspace-level setting to allow admins to choose between displaying QR code ID or SAM ID on QR code labels. This addresses issue #2051 by providing organizations flexibility in how they identify assets on QR codes.

Key changes:
- Add qrIdDisplayPreference enum to Organization schema with QR_ID and SAM_ID options
- Create QrIdDisplayPreferenceSelector component using popover pattern for consistent UI
- Update QR code preview logic to use useCurrentOrganization hook instead of prop drilling
- Add preference setting to workspace general settings page
- Update bulk QR download to respect organization preference
- Modify API endpoints to include sequentialId for SAM ID display
- Add database migration for new preference field

The feature is fully backward compatible with QR_ID as the default preference.
@DonKoko DonKoko linked an issue Sep 18, 2025 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
shelf-docs Ready Ready Preview Comment Sep 19, 2025 9:47am

@DonKoko DonKoko requested a review from Copilot September 18, 2025 16:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 implements a new workspace-level setting that allows admins to customize how asset identifiers appear on QR code labels. Organizations can now choose between displaying the traditional QR code ID or the sequential/SAM ID on their QR codes.

Key changes:

  • Added qrIdDisplayPreference enum field to Organization model with QR_ID and SAM_ID options
  • Created QrIdDisplayPreferenceSelector component with search and keyboard navigation capabilities
  • Updated QR code rendering to conditionally display preferred identifier type
  • Modified API endpoints to return sequentialId data needed for SAM ID display

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/database/schema.prisma Adds QrIdDisplayPreference enum and qrIdDisplayPreference field to Organization model
app/database/migrations/...migration.sql Creates database migration for new enum and organization field
app/modules/organization/service.server.ts Updates organization service to handle new preference field in updates and selections
app/components/workspace/qr-id-display-preference-selector.tsx New component providing dropdown selector with search functionality for QR ID display preferences
app/components/workspace/edit-form.tsx Integrates preference selector into workspace settings forms
app/components/workspace/currency-selector.tsx Minor styling update to maintain consistent height with new selector
app/components/code-preview/code-preview.tsx Updates QR label rendering to use organization preference and sequential ID
app/components/code-preview/code-preview-dialog.tsx Passes sequentialId data to code preview component
app/components/assets/bulk-download-qr-dialog.tsx Updates bulk QR download to respect organization preference
app/routes/_layout+/settings.general.tsx Adds preference handling to general settings page
app/routes/_layout+/account-details.workspace.$workspaceId.edit.tsx Adds preference handling to workspace edit page
app/routes/_layout+/assets.$assetId.overview.tsx Passes sequentialId to asset overview QR display
app/routes/api+/assets.get-assets-for-bulk-qr-download.ts Returns sequentialId and preference data for bulk operations
app/routes/api+/assets.$assetId.generate-code-obj.ts Returns sequentialId data for individual asset QR generation

Comment thread app/components/workspace/qr-id-display-preference-selector.tsx Outdated
Comment thread app/components/workspace/qr-id-display-preference-selector.tsx Outdated
Comment thread app/components/workspace/qr-id-display-preference-selector.tsx
Copy link
Copy Markdown

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

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 suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment thread app/components/code-preview/code-preview-dialog.tsx Outdated
…name support

- Replace direct fetch calls with useApiQuery for consistency
- Add callback support (onSuccess/onError) to useApiQuery hook
- Implement SAM ID prefixing in bulk download filenames when preference is SAM_ID
- Fix infinite API calls issue by using useEffect pattern instead of unstable callbacks
- Add comprehensive test coverage for useApiQuery callback functionality
- Fix act() warnings in tests by wrapping refetch calls properly
- Update API route type definitions for better type safety

This improves code consistency, adds better filename organization for bulk downloads, and ensures robust error handling throughout the QR download workflow.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

@DonKoko DonKoko merged commit e15ef1b into main Sep 19, 2025
6 checks passed
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.

Feat: Customize value shown on Shelf QR id

2 participants