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

Enhancement add responsive mobile view for documents table#606 #665

Conversation

joshua-cornett
Copy link
Contributor

@joshua-cornett joshua-cornett commented Jul 22, 2024

This PR:

Resolves #606

1. Documents have a proper mobile view
2. Is consistent with Contacts style/methodology

Additionally:

  • Documents now have unique IDs (at least on the front end)

Screenshots (if applicable):

image
image
image

Future Steps/PRs Needed to Finish This Work (optional):

…mponents/cards. Currently no document utilites reimplemented; i.e Share, Replace, Remove, and View.
…ated eventHandlers for cards to use DocumentTable logic. Delete doesn't work, but preview does.
…w ' ' -> '%20' convention. All buttons functional.
…lement mobile switch to document cards and responsiveness.
…ponents (DocumentsDesktop, DocumentsMobile). Remove redundant handler redefinitions.
…ments components. Adopt Contacts stylization methodology for desktop documents.
… mobile documents. Actions follow same dropdown effect with appropriate icons and remain functional.
@andycwilliams andycwilliams added enhancement Enhancement of existing features MVP Issues related to MVP labels Jul 22, 2024
@andycwilliams
Copy link
Member

Getting some errors as soon as I log in. I can't access any of the pages

2024-07-23 2024-07-23 (1)

…nature of hooks, using UUID instead of useId() to avoid changes in hook order.
Copy link
Member

@andycwilliams andycwilliams left a comment

Choose a reason for hiding this comment

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

Quick preliminary review. Will be more thorough later.

The app starts up correctly now. Good work so far.

  1. Looks like the header names in the column titles were changed or removed.
2024-07-24 2024-07-24 (1)
  1. The mobile card lists the file name but nothing else. I'd like all the other information listed as well. Can just list out the rest, like the type, description, etc.?

  2. Also, could we use the same icon for "Preview File"? Right now it uses a different one on the mobile version

@andycwilliams
Copy link
Member

Hi Josh. Any updates?

Copy link
Contributor

@leekahung leekahung left a comment

Choose a reason for hiding this comment

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

Doesn't appear to impact functionality, but there are some React warnings related to the mobile Drawers that does not exist for the desktop Modals.

Screenshot 2024-08-13 at 4 26 39 PM

Screenshot 2024-08-13 at 4 24 23 PM

Another bug is related to the text fields themselves where the previous value remains in the Drawer text fields despite being edited to be an empty string:

Screenshot 2024-08-13 at 4 33 21 PM

Screenshot 2024-08-13 at 4 31 22 PM

Seems to leak over to the Modal as well in the desktop version:

Screenshot 2024-08-13 at 4 36 15 PM

I'm guessing the state did not reset after the edit submission?

@leekahung leekahung self-requested a review August 14, 2024 01:11
@leekahung
Copy link
Contributor

leekahung commented Aug 14, 2024

Doesn't appear to impact functionality, but there are some React warnings related to the mobile Drawers that does not exist for the desktop Modals.

Screenshot 2024-08-13 at 4 26 39 PM

Screenshot 2024-08-13 at 4 24 23 PM

Another bug is related to the text fields themselves where the previous value remains in the Drawer text fields despite being edited to be an empty string:

Screenshot 2024-08-13 at 4 33 21 PM

Screenshot 2024-08-13 at 4 31 22 PM

Seems to leak over to the Modal as well in the desktop version:

Screenshot 2024-08-13 at 4 36 15 PM

I'm guessing the state did not reset after the edit submission?

Not related to this PR specifically, so I'll move this into an issue instead.

@andycwilliams
Copy link
Member

Planning on going over this issue tonight and working out a timetable for MVP

@leekahung
Copy link
Contributor

For the description, let's set a max character limit to 140 characters with client-side validation. From Solid's perspective, I don't think there's a limit, but we could have CSS cap the visual length. That should be enough give a decent enough description of what the file is about without needing to preview the document and not making the card too larget.

@andycwilliams
Copy link
Member

@leekahung

Had a check in with Josh and Andrew tonight. MVP is very close now. Styling should be pretty much done and most of what remains is just writing tests.

When you have time, would appreciate a review. It's super possible to get MVP done and dusted by end of the month.

Also I saw you approved the Oliver's PR. Haven't had a chance to look at that myself but if you think it's good to go then merge it.

Copy link
Contributor

@leekahung leekahung left a comment

Choose a reason for hiding this comment

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

Nothing too major, but there are a few things to note, especially with the file name for the document cards. See feedback.

src/components/Documents/DocumentTable.jsx Outdated Show resolved Hide resolved
src/components/Documents/DocumentsDesktop.jsx Outdated Show resolved Hide resolved
src/components/Documents/DocumentCard.jsx Outdated Show resolved Hide resolved
src/components/Documents/DocumentCard.jsx Outdated Show resolved Hide resolved
src/components/Documents/DocumentsMobile.jsx Show resolved Hide resolved
@joshua-cornett
Copy link
Contributor Author

I believe all aesthetic and functional concerns expressed have been addressed. Working on getting the tests out.

Copy link
Contributor

@leekahung leekahung left a comment

Choose a reason for hiding this comment

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

Think I can approve after the unit tests pass

@joshua-cornett
Copy link
Contributor Author

image

Copy link
Member

@andycwilliams andycwilliams left a comment

Choose a reason for hiding this comment

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

Haven't had time to review every bit yet but looking pretty good so far. Couple of requests for the time being

const dataStyling = {
...rowStyling,
color: 'text.secondary',
fontSize: '.875rem',
Copy link
Member

Choose a reason for hiding this comment

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

Is there a particular reason rem is used here when px is used almost every other time?

Copy link
Contributor Author

@joshua-cornett joshua-cornett Sep 1, 2024

Choose a reason for hiding this comment

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

Not really, I think at the time it was just a little easier for me to scale font sizes to each other that way. I can change it to px for consistency.

src/components/Documents/DocumentCard.jsx Outdated Show resolved Hide resolved
expect(screen.getByTestId('loading-animation')).toBeInTheDocument();
});

it('renders DocumentsDesktop for larger screens', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these two tests very similar to the final two?

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 was wondering where our conventional balance between redundancy and thoroughness lies. I may have opted for the latter in more cases than necessary. I'll look into filtering moot redundancy out.

Copy link
Contributor Author

@joshua-cornett joshua-cornett Sep 1, 2024

Choose a reason for hiding this comment

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

Yes I see it now, they were actually nearly identical. Just something I'd overlooked. I removed the redundant final two in question.

test/components/Documents/DocumentTable.test.jsx Outdated Show resolved Hide resolved
… cards. Remove redundant test cases. Align test names with convention. Align CSS units with convention.
@leekahung leekahung merged commit 527610f into Development Sep 4, 2024
3 checks passed
@andycwilliams andycwilliams deleted the enhancement-add-responsive-mobile-view-for-documents-table#606 branch September 4, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing features MVP Issues related to MVP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] - add responsive mobile view for documents table
4 participants