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(web): alignment issue in “Collaboration made easy” section #178

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

PriyobrotoKar
Copy link
Contributor

@PriyobrotoKar PriyobrotoKar commented Apr 7, 2024

User description

Description

Fixed the issue where the “Approval before Commit” section was overflowing from the main grid.

Fixes #177

Dependencies

Mention any dependencies/packages used

Future Improvements

Mention any improvements to be done in future related to any file/feature

Mentions

Mention and tag the people

Screenshots of relevant screens

Add screenshots of relevant screens

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

Type

enhancement, bug_fix


Description

  • Improved the layout and responsiveness of the "Collaboration made easy" section by transitioning to a grid layout and adjusting card components for better alignment.
  • Introduced the ability to add custom styling to Card components through a new className prop, enhancing flexibility and customization.

Changes walkthrough

Relevant files
Enhancement
index.tsx
Improved Layout and Responsiveness in "Collaboration made easy"
Section

apps/web/src/components/colabEasy/index.tsx

  • Changed the layout from flex to grid for better alignment and
    responsiveness.
  • Adjusted the Card components to span multiple rows or columns as
    needed.
  • Added className props to Card and FollowerPointerCard components for
    custom styling.
  • +35/-39 
    index.tsx
    Added Custom Styling Capability to Card Component               

    apps/web/src/components/shared/card/index.tsx

  • Introduced className prop to allow custom styling.
  • Utilized cn utility function for conditional class name concatenation.
  • +8/-2     

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    PR Description updated to latest commit (3ae097e)

    Copy link
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the changes are mostly related to CSS classes and structure adjustments in the React components. The logic seems straightforward, focusing on layout improvements and adding a className prop to the Card component for better customization.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Styling Consistency: The introduction of className props to Card components might lead to inconsistent styling if not properly managed across the project.

    Grid Layout Responsiveness: The switch to a grid layout with hardcoded column spans (col-span-2, col-start-3 col-end-4) might cause responsiveness issues on different screen sizes if not thoroughly tested.

    🔒 Security concerns

    No


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Improve readability by using responsive classes directly.

    Consider using TailwindCSS's responsive classes for translate-x and py directly instead of
    conditional classes within className. This will improve readability and maintainability of
    your code.

    apps/web/src/components/colabEasy/index.tsx [42]

    -<CustomrollSVG className="w-[18rem] translate-x-[8vw] py-12 md:w-[21rem] md:translate-x-[4rem] md:py-0 md:pt-10" />
    +<CustomrollSVG className="w-[18rem] md:w-[21rem] translate-x-[8vw] md:translate-x-[4rem] py-12 md:py-0 md:pt-10" />
     
    Allow dynamic sizing of the Card component via props.

    To enhance the flexibility of the Card component, consider allowing the width and height
    properties to be passed as props. This approach provides more control over the component's
    size without relying solely on conditional classes.

    apps/web/src/components/shared/card/index.tsx [18-19]

    +// Assuming width and height props are added and their types are string | undefined
     <div
       className={cn(
    -    `flex ${widthFull ? 'w-[20rem] md:w-full' : 'w-[20rem] md:w-[25rem]'} h-full flex-col justify-end rounded-2xl backdrop-blur-2xl`,
    +    `flex ${width ? width : 'w-[20rem]'} ${height ? height : 'h-full'} flex-col justify-end rounded-2xl backdrop-blur-2xl`,
         className
       )}
     
    Best practice
    Add explicit row-span values for grid consistency.

    To ensure consistency and avoid unexpected layout shifts, consider adding explicit
    row-span values for all Card components within the grid. This will help maintain a uniform
    appearance across different screen sizes.

    apps/web/src/components/colabEasy/index.tsx [26]

     <Card className="row-span-2">
    +<Card className="row-span-1"> <!-- Example for other cards -->
     
    Maintainability
    Use a more descriptive boolean prop name for clarity.

    For better maintainability and to avoid potential future errors, consider using a more
    descriptive prop name than widthFull. A name like isFullWidth would more clearly convey
    that the prop is a boolean controlling whether the card should be full width.

    apps/web/src/components/shared/card/index.tsx [5]

    -widthFull?: boolean
    +isFullWidth?: boolean
     
    Accessibility
    Wrap Card components in tags for better accessibility.

    To improve the semantic structure and accessibility of your content, consider wrapping
    each Card component with an

    tag. This change would help screen readers and other
    assistive technologies understand and navigate the content more effectively.

    apps/web/src/components/colabEasy/index.tsx [26]

    -<Card className="row-span-2">
    +<article>
    +  <Card className="row-span-2">
    +  ...
    +  </Card>
    +</article>
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    @kriptonian1
    Copy link
    Contributor

    @PriyobrotoKar can you add a screenshot

    @PriyobrotoKar
    Copy link
    Contributor Author

    @PriyobrotoKar can you add a screenshot

    Yes , here's the screenshot

    screenshot

    @PriyobrotoKar
    Copy link
    Contributor Author

    @kriptonian1 I have found another way to fix this alignment issue by taking care of these possible issues mentioned in this PR Review.

    Should I push this new fix or the previous fix was good enough?

    This is how it looks after this new fix:

    image

    @rajdip-b
    Copy link
    Member

    rajdip-b commented Apr 8, 2024

    @PriyobrotoKar we would be really glad if you can make those fixes!

    Copy link

    sonarcloud bot commented Apr 8, 2024

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    No data about Coverage
    No data about Duplication

    See analysis details on SonarCloud

    @rajdip-b
    Copy link
    Member

    rajdip-b commented Apr 8, 2024

    @kriptonian1 can you drop in your reviews?

    Copy link
    Contributor

    @kriptonian1 kriptonian1 left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @rajdip-b rajdip-b merged commit df5ca75 into keyshade-xyz:develop Apr 8, 2024
    5 checks passed
    @rajdip-b
    Copy link
    Member

    rajdip-b commented Apr 8, 2024

    @PriyobrotoKar Congrats on your first successful MR at keyshade!!

    @PriyobrotoKar
    Copy link
    Contributor Author

    @PriyobrotoKar Congrats on your first successful MR at keyshade!!

    Thanks!! Infact this is my first ever successful MR in any open source project. Will be trying to contribute more in future.

    @rajdip-b
    Copy link
    Member

    rajdip-b commented Apr 8, 2024

    Looking forward to it!

    P.S. you can try a few API issues aswell!

    rajdip-b pushed a commit that referenced this pull request May 12, 2024
    ## [1.3.0](v1.2.0...v1.3.0) (2024-05-12)
    
    ### 🚀 Features
    
    * Add approval support ([#158](#158)) ([e09ae60](e09ae60))
    * **api:** Add configuration live update support ([#181](#181)) ([f7d6684](f7d6684))
    * **api:** Add feature to export data of a workspace ([#152](#152)) ([46833aa](46833aa))
    * **api:** Add Integration support ([#203](#203)) ([f1ae87e](f1ae87e))
    * **api:** Add note to [secure] and variable ([#151](#151)) ([2e62351](2e62351))
    * **api:** Add OAuth redirection and polished authentication ([#212](#212)) ([d2968bc](d2968bc))
    * **api:** Add support for storing and managing variables ([#149](#149)) ([963a8ae](963a8ae))
    * **api:** Added GitLab OAuth ([#188](#188)) ([4d3bbe4](4d3bbe4))
    * **api:** Added validation for reason field ([#190](#190)) ([90b8ff2](90b8ff2))
    * **api:** Create default workspace on user's creation ([#182](#182)) ([3dc0c4c](3dc0c4c))
    * **api:** Reading `port` Dynamically ([#170](#170)) ([fd46e3e](fd46e3e))
    * **auth:** Add Google OAuth ([#156](#156)) ([cf387ea](cf387ea))
    * **web:** Added waitlist ([#168](#168)) ([1084c77](1084c77))
    * **web:** Landing revamp ([#165](#165)) ([0bc723b](0bc723b))
    
    ### 🐛 Bug Fixes
    
    * **web:** alignment issue in “Collaboration made easy” section ([#178](#178)) ([df5ca75](df5ca75))
    * **workspace:** delete duplicate tailwind config ([99d922a](99d922a))
    
    ### 📚 Documentation
    
    * add contributor list ([f37569a](f37569a))
    * Add integration docs ([#204](#204)) ([406ddb7](406ddb7))
    * Added integration docs to gitbook summary ([ab37530](ab37530))
    * **api:** Add swagger docs of API key controller ([#167](#167)) ([2910476](2910476))
    * **api:** Add swagger docs of User Controller ([#166](#166)) ([fd59522](fd59522))
    * fix typo in environment-variables.md ([#163](#163)) ([48294c9](48294c9))
    * Remove supabase from docs ([#169](#169)) ([eddbce8](eddbce8))
    * **setup:** replace NX with Turbo in setup instructions ([#175](#175)) ([af8a460](af8a460))
    * Update README.md ([b59f16b](b59f16b))
    * Update running-the-api.md ([177dbbf](177dbbf))
    * Update running-the-api.md ([#193](#193)) ([3d5bcac](3d5bcac))
    
    ### 🔧 Miscellaneous Chores
    
    * Added lockfile ([60a3b9b](60a3b9b))
    * Added lockfile ([6bb512c](6bb512c))
    * **api:** Added type inference and runtime validation to `process.env` ([#200](#200)) ([249e07d](249e07d))
    * **api:** Fixed prisma script env errors ([#209](#209)) ([8762354](8762354))
    * **API:** Refactor authority check functions in API ([#189](#189)) ([e9d710d](e9d710d))
    * **api:** Refactor user e2e tests ([b38d45a](b38d45a))
    * **ci:** Disabled api stage release ([97877c4](97877c4))
    * **ci:** Update stage deployment config ([868a6a1](868a6a1))
    * **codecov:** update api-e2e project coverage ([1e90d7e](1e90d7e))
    * **dockerfile:** Fixed web dockerfile ([6134bb2](6134bb2))
    * **docker:** Optimized web Dockerfile to reduct image size ([#173](#173)) ([444286a](444286a))
    * **release:** Downgraded package version ([c173fee](c173fee))
    * **release:** Fix failing release ([#213](#213)) ([40f64f3](40f64f3))
    * **release:** Install pnpm ([1081bea](1081bea))
    * **release:** Updated release commit ([b8958e7](b8958e7))
    * **release:** Updated release commit ([e270eb8](e270eb8))
    * Update deprecated husky Install command ([#202](#202)) ([e61102c](e61102c))
    * Upgrade @million/lint from 0.0.66 to 0.0.73 ([#172](#172)) ([dd43ed9](dd43ed9))
    * **web:** Updated fly memory config ([4debc66](4debc66))
    
    ### 🔨 Code Refactoring
    
    * **api:** Made events central to workspace ([#159](#159)) ([9bc00ae](9bc00ae))
    * **api:** Migrated to cookie based authentication ([#206](#206)) ([ad6911f](ad6911f))
    * **monorepo:** Migrate from nx to turbo ([#153](#153)) ([88b4b00](88b4b00))
    @rajdip-b
    Copy link
    Member

    🎉 This PR is included in version 1.3.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
    Labels
    type: enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    Alignment issue in “Collaboration made easy” section
    3 participants