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

fix: improve layout design for large screens #1231 #1437

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

RitaDee
Copy link
Contributor

@RitaDee RitaDee commented Jul 26, 2023

Description

This PR fixes the issue of Odd design for large screens #1231

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Desktop Screenshots:

Before:

8C5F2307-292D-44E7-A443-6E758D5093BD_1_105_c

After:

C96D37BA-D979-499E-BEF9-1AEBF06638EF

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

@netlify
Copy link

netlify bot commented Jul 26, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit 2f98364
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/64c7e28690740400088ca5e3
😎 Deploy Preview https://deploy-preview-1437--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jul 26, 2023

βœ… Deploy Preview for oss-insights ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit 2f98364
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/64c7e285a0f72c0008e063f5
😎 Deploy Preview https://deploy-preview-1437--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks Passed!

@bdougie
Copy link
Member

bdougie commented Jul 26, 2023

Screen cap before and after please

@RitaDee
Copy link
Contributor Author

RitaDee commented Jul 27, 2023

@bdougie, done. Thank you but it is yet to pass the checks

@RitaDee RitaDee changed the title Fix: Odd design for large screens #1231 fix: Odd design for large screens #1231 Jul 27, 2023
@OgDev-01
Copy link
Contributor

Hey @RitaDee, Thanks for taking this on πŸ• .

A few notes after review

The preview shows that the Add to Insight button is now visible on lg screens πŸ‘.

Screen.Recording.2023-07-27.at.07.01.53.mov

in line with setting the width in lg to display the button, we should as well hide the LAST 30 DAYS column of the table to avoid overflow. We should also switch to tailwind styles as that is what is used across the application

@RitaDee
Copy link
Contributor Author

RitaDee commented Jul 29, 2023

Closing this as the solution seems a little scope crept to me 😊🫠!

@RitaDee RitaDee closed this Jul 29, 2023
@RitaDee RitaDee deleted the PR/odd-design branch July 29, 2023 21:47
@a0m0rajab
Copy link
Contributor

@RitaDee if you want to keep working on this and get some help, I would be more than happy to walk through with you in this PR.

It might be worth taking a look at these codes if you are still interested.

https://github.com/open-sauced/insights/blob/932568ffe78b810b68fa0f053e62c87f7f9ceb9d/components/molecules/RepoRow/repo-row.tsx#L191-L200

https://github.com/open-sauced/insights/blob/932568ffe78b810b68fa0f053e62c87f7f9ceb9d/components/molecules/RepoRow/repo-row.tsx#L263-L268

@RitaDee
Copy link
Contributor Author

RitaDee commented Jul 30, 2023

Hello @a0m0rajab, I will be glad to receive the walkthrough. Kindly let me know what time works best for you. Thank you

@a0m0rajab
Copy link
Contributor

Awesome, to set expectations, this is a bit of a tricky task (you might need to change around 6-7 files till you get it fixed), there is a lot of complexity in it, and that's okay to find it hard, yet it's a bit of a great way to get familiar with the code.

To implement this, you can do the next:

  • Get Identifier: go to the insight page, use your browser's page inspector, and get the related class/identifier of the item you want to change.
  • Understand the code: After getting that identifier, you will need to check it from the code and see where it has been used,
  • Make changes: Since we checked the code, we will make some changes based on our knowledge to see if it works or not,
  • Review the changes: we need to review the changes and see how the result, and if there is anything else broken,
  • Repeat the steps: if there is anything broken and not working as expected, we need to redo the whole steps till we get the needed result.

Each iteration will teach you about the code, the logic, and how it works.

As for this task,

Get Identifier

Here is how you can do this:

www_screencapture_com_2023-7-31_03_05.mp4

From this at the end, you can see that I got; flex-1 lg:min-w-[150px] hidden lg:flex

I will go to my code editor right now or GitHub to find these classes.

I am using VsCode so here is how to do it with it:

www_screencapture_com_2023-7-31_03_14.mp4

Here is how to do it with GitHub:

  • open the repo page
  • write the search term
  • check the results
www_screencapture_com_2023-7-31_03_13.mp4

GitHub Result:

https://github.com/search?q=repo%3Aopen-sauced%2Finsights%20flex-1%20lg%3Amin-w-%5B150px%5D%20hidden%20lg%3Aflex&type=code

Understand the code

Since we got the related code right now, we will need to understand it. The first thing to notice is that it has a comment saying it's a column and it's using tailwind:

 {/* Column Last 30 Days */}
        <div className={clsx("flex-1 lg:min-w-[150px] hidden lg:flex justify-center")}>
          {last30days ? <Sparkline data={last30days} width="100%" height={54} /> : "-"}
        </div>

https://github.com/open-sauced/insights/blob/932568ffe78b810b68fa0f053e62c87f7f9ceb9d/components/molecules/ContributorListTableRow/contributor-list-table-row.tsx#L171C1-L175

Tailwind

If you need to become more familiar with it, it's just a short style of writing CSS as a class. It has a special identifier as well. For example:

sm:m-50 lg:w-100

The previous code is converting to: if small screen, then the width should be 50% if large screens, then the width is 100%

https://tailwindcss.com/docs/responsive-design

We can see that the keyword hidden is being used as well. Here we can have three questions:

  • what would happen if we removed hidden?
  • When is it hidden, and when it's shown?
  • How to hide it on the screen that I want

Make changes

Since we get that, we can now change the code and see the results. We can change the lg to xl since we want to hide the things in the large screen and see the result, if it is okay we can move forward.

The result

After doing changes in code, you need to run it on your local machine to test it, get the screen, and see if you need to fix/change anything else.

Repeat

You can repeat the same steps for a 4-5 times till you get the full expected result, again this is a bit tricky task though.

If you need any help or if you feel stuck and like to pair program then I would be happy to do that on discord: contributors channel.

@a0m0rajab a0m0rajab mentioned this pull request Jul 31, 2023
2 tasks
@RitaDee
Copy link
Contributor Author

RitaDee commented Jul 31, 2023

Thank you, @a0m0rajab I will check it out.

@RitaDee RitaDee restored the PR/odd-design branch July 31, 2023 13:51
@RitaDee RitaDee reopened this Jul 31, 2023
@a0m0rajab
Copy link
Contributor

I just had a 30-40 minutes call with @RitaDee to apply the d1d76f1 commit.

Thank you for your time!

As for my opinion, I think that this PR is good right now but, I have two things in consideration:

  • the feed is a bit out of the scope of the issue
  • there are some changes that is a bit confusing for review.

@a0m0rajab
Copy link
Contributor

This is how it looks right now:
image

Copy link
Contributor

@a0m0rajab a0m0rajab left a comment

Choose a reason for hiding this comment

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

@RitaDee Thank you for your effort and force pushing the PR,

LGTM! πŸ‘

@a0m0rajab
Copy link
Contributor

@OgDev-01 the thing you are mentioning is a bit out of scope for this PR, you can check the issue: #1231

The screenshot is a bit misleading

@OgDev-01
Copy link
Contributor

@OgDev-01 the thing you are mentioning is a bit out of scope for this PR, you can check the issue: #1231

The screenshot is a bit misleading

Thanks, I already deleted that... sorry about the misconceptions >:

Copy link
Contributor

@OgDev-01 OgDev-01 left a comment

Choose a reason for hiding this comment

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

LGTM πŸ• πŸ• ... Thanks for this fix @RitaDee. Welcome to the community πŸ‘

Copy link
Contributor

@brandonroberts brandonroberts left a comment

Choose a reason for hiding this comment

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

πŸ•

@brandonroberts brandonroberts changed the title fix: Odd design for large screens #1231 fix: improve layout design for large screens #1231 Jul 31, 2023
@OgDev-01 OgDev-01 merged commit d8ae808 into open-sauced:beta Jul 31, 2023
14 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 31, 2023
## [1.58.0-beta.3](v1.58.0-beta.2...v1.58.0-beta.3) (2023-07-31)

### πŸ› Bug Fixes

* improve layout design for large screens [#1231](#1231) ([#1437](#1437)) ([d8ae808](d8ae808))
@github-actions
Copy link

πŸŽ‰ This PR is included in version 1.58.0-beta.3 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Aug 2, 2023
## [1.58.0](v1.57.0...v1.58.0) (2023-08-02)

### πŸ§‘β€πŸ’» Code Refactoring

*  merge `authSession` function into `useSession` hook ([#1391](#1391)) ([d6c230d](d6c230d))

### 🎨 Styles

* add width and max width for created at in contributor-profile-tab ([#1429](#1429)) ([5614886](5614886))
* remove irrelevant padding in page divider ([#1427](#1427)) ([5faaa4e](5faaa4e))

### πŸ• Features

* add devcard button to user profile ([#1339](#1339)) ([6a1dbdc](6a1dbdc))
* new contributor highlight card ([#1443](#1443)) ([c88000b](c88000b))
* update redirect to feed page for unauthenticated users ([#1464](#1464)) ([6d8505f](6d8505f))

### πŸ› Bug Fixes

* add checkbox id name if not available based on label ([#1466](#1466)) ([68f66a7](68f66a7))
* add navigation to improve accessibility ([#1436](#1436)) ([d1d85f7](d1d85f7))
* contributor profile tab click state flicker ([#1432](#1432)) ([c9cf8ed](c9cf8ed))
* Deleted page button changed to delete highlight ([#1419](#1419)) ([d502605](d502605))
* fixed bug on chatbot button overlay ([#1420](#1420)) ([2a94583](2a94583))
* hide onboarding button on mobile ([#1460](#1460)) ([f63f240](f63f240))
* Improve Keyboard Accessibility for Notification Icon ([#1435](#1435)) ([05291c0](05291c0))
* improve layout design for large screens [#1231](#1231) ([#1437](#1437)) ([d8ae808](d8ae808))
* misaligned chat button close icon ([#1422](#1422)) ([60f22bd](60f22bd))
* mismatched selection color ([#1430](#1430)) ([8a1d37b](8a1d37b))
* reduce tab font size in contributors profile page ([#1413](#1413)) ([238dc2f](238dc2f))
* show repo filters on initial `feeds` route visit ([#1426](#1426)) ([833ee30](833ee30))
* tab inconsistency in user profile matching the url ([#1403](#1403)) ([f8c6766](f8c6766))
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

πŸŽ‰ This PR is included in version 1.58.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Odd design for large screens
5 participants