Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: photo form field redesign #1276

Merged
merged 7 commits into from
Jan 30, 2025
Merged

Conversation

PeterBaker0
Copy link
Contributor

@PeterBaker0 PeterBaker0 commented Jan 28, 2025

feat: photo form field redesign

JIRA Ticket

BSS-528

BSS-527

Description

Redesigns the photo form field visually to

  • When there are no photos attached make it clearer that the user needs to add photos and make the button more prominent
  • When there are photos attached, improve the styling and scaling of the photo gallery, refining the on click popup preview with improved button visibility and image scaling
  • Make the delete image button more prominent
  • Make the add a new photo button when there are existing images more prominent (rather than take photo button)
  • Improve un-downloaded attachment user help

And makes some targeted refactor to the actual code i.e. removes the deprecated atob usage.

Also improves un-downloaded attachment user help by providing a deep link to the settings tab. Introduces a new fully typed custom hook for managing query string params. E.g.

const {params, setParam} = useQueryParams<{tab: TabIndex}>({
    tab: {
      key: ROUTES.INDIVIDUAL_NOTEBOOK_ROUTE_TAB_Q,
      defaultValue: 'records',
    },
  });

In the above you are given a type safe interface into params with a useState style interface. This automatically updates the query string upon change.

How to Test

Add photos, remove them, click to preview them. Publish record with photos, then login with different user and browser, and see the un-downloaded attachment behaviour.

Additional Information

Testing this exposed an existing bug around draft saving and record publishing when editing forms with existing un-downloaded attachments. @stevecassidy has created a JIRA ticket to track this issue.

Checklist

  • I have confirmed all commits have been signed.
  • I have added JSDoc style comments to any new functions or classes.
  • Relevant documentation such as READMEs, guides, and class comments are updated.

… typing, using for tab index on notebook page, deeplinking

Signed-off-by: Peter Baker <[email protected]>
Copy link
Contributor

@stevecassidy stevecassidy left a comment

Choose a reason for hiding this comment

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

All good apart from comment on the size of thumbnails.

app/src/gui/fields/TakePhoto.tsx Show resolved Hide resolved
app/src/utils/customHooks.tsx Show resolved Hide resolved
@PeterBaker0 PeterBaker0 merged commit ed363e0 into main Jan 30, 2025
2 checks passed
@PeterBaker0 PeterBaker0 deleted the feat/photo-form-field-redesign branch January 30, 2025 01:59
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