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(web): Change default header styles for project and organization subpages #15295

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

mannipje
Copy link
Member

@mannipje mannipje commented Jun 20, 2024

Change default header styles for project and organization subpages

What

Make subpage header smaller for organization and project webs who use default header.

Why

To get content higher on subpages.

Screenshots / Gifs

Before

image

After

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Added support for subpage-specific headers with styling and layout adjustments across various components.
    • Introduced a new isSubpage boolean prop to toggle subpage-specific styles in headers.
  • Enhancements

    • Updated DefaultHeader, OrganizationHeader, and ProjectHeader components to conditionally render styles based on subpage status.
    • Improved responsiveness and layout for headers on subpages, including mobile-specific adjustments.

@mannipje mannipje requested review from a team as code owners June 20, 2024 12:17
Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Walkthrough

The updates introduced responsive and conditional styling to various components across the application to enhance the user interface for subpages. New properties were added to existing components, allowing them to adapt their layout and styling based on whether they are displayed on a subpage or not.

Changes

File Path Summary of Changes
apps/web/components/DefaultHeader/DefaultHeader.css.ts Added styles for subpages, such as gridContainerSubpage, textContainerSubpage, logoContainerSubpage, etc., to enhance layout for different screen sizes.
apps/web/components/DefaultHeader/DefaultHeader.tsx Introduced isSubpage prop to conditionally apply styles for subpages. Updated component to use new styles based on this prop.
apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx Added isSubpage prop to HeaderProps and passed it to OrganizationHeader to adjust header properties for subpages.
apps/web/screens/Project/Project.tsx Introduced isSubpage condition to control subpage header rendering.
apps/web/screens/Project/components/ProjectHeader/ProjectHeader.tsx Modified ProjectHeader to accept and use the isSubpage prop.
apps/web/screens/Project/components/ProjectWrapper/ProjectWrapper.tsx Added isSubpage prop to ProjectWrapperProps and passed it to ProjectHeader. Updated ProjectHeader invocation.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@datadog-island-is
Copy link

datadog-island-is bot commented Jun 20, 2024

Datadog Report

All test runs e41e50f 🔗

4 Total Test Services: 0 Failed, 4 Passed
➡️ Test Sessions change in coverage: 5 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.72s 1 no change Link
application-system-api 0 0 0 111 2 3m 4.55s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 40.31s 1 no change Link
web 0 0 0 84 0 28s 1 no change Link

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 37.12%. Comparing base (1a2734e) to head (5f22c4a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15295      +/-   ##
==========================================
- Coverage   37.12%   37.12%   -0.01%     
==========================================
  Files        6504     6504              
  Lines      132239   132244       +5     
  Branches    37808    37812       +4     
==========================================
  Hits        49100    49100              
- Misses      83139    83144       +5     
Flag Coverage Δ
api 3.47% <ø> (ø)
application-template-api-modules 24.20% <ø> (-0.01%) ⬇️
web 1.93% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...oject/components/ProjectWrapper/ProjectWrapper.tsx 0.00% <ø> (ø)
apps/web/screens/Project/Project.tsx 0.00% <0.00%> (ø)
...nents/Organization/Wrapper/OrganizationWrapper.tsx 0.00% <0.00%> (ø)
...Project/components/ProjectHeader/ProjectHeader.tsx 0.00% <0.00%> (ø)
...pps/web/components/DefaultHeader/DefaultHeader.tsx 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a2734e...5f22c4a. Read the comment docs.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 413f400 and d121fe3.

Files selected for processing (6)
  • apps/web/components/DefaultHeader/DefaultHeader.css.ts (6 hunks)
  • apps/web/components/DefaultHeader/DefaultHeader.tsx (7 hunks)
  • apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx (4 hunks)
  • apps/web/screens/Project/Project.tsx (1 hunks)
  • apps/web/screens/Project/components/ProjectHeader/ProjectHeader.tsx (2 hunks)
  • apps/web/screens/Project/components/ProjectWrapper/ProjectWrapper.tsx (3 hunks)
Files not reviewed due to errors (2)
  • apps/web/screens/Project/components/ProjectWrapper/ProjectWrapper.tsx (no review received)
  • apps/web/components/DefaultHeader/DefaultHeader.tsx (no review received)
Additional context used
Path-based instructions (6)
apps/web/screens/Project/components/ProjectHeader/ProjectHeader.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/components/DefaultHeader/DefaultHeader.css.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/screens/Project/components/ProjectWrapper/ProjectWrapper.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/components/DefaultHeader/DefaultHeader.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/screens/Project/Project.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (13)
apps/web/screens/Project/components/ProjectHeader/ProjectHeader.tsx (3)

17-17: Ensure that the optional isSubpage prop is consistently handled in all uses of ProjectHeaderProps.


77-77: Correct implementation of passing the isSubpage prop to the DefaultHeader component. This ensures that the subpage-specific styles are applied when needed.


22-22: The inclusion of isSubpage in the props destructuring is correct. Verify its usage throughout the component to ensure it's affecting the rendering logic as intended.

Verification successful

The isSubpage prop is included in the destructuring of props in the ProjectHeader component and is used within the component's JSX. Specifically, it is passed down to another component:

  • Line 23: isSubpage is destructured from props.
  • Lines 71-73: isSubpage is passed as a prop to a child component.

This confirms that isSubpage is indeed used within the ProjectHeader component and affects its rendering logic as intended.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify `isSubpage` is used correctly throughout the component.
ast-grep --lang javascript --pattern $'export const ProjectHeader = ($$$) => { $$$ isSubpage $$$ }'

Length of output: 100



Script:

#!/bin/bash
# Description: Verify `isSubpage` is used correctly within the ProjectHeader component.
# Search for the definition of the `ProjectHeader` component and the usage of `isSubpage` within it.
ast-grep --lang tsx --pattern 'export const ProjectHeader = ({ $$$ isSubpage $$$ }) => { $$$ }'

Length of output: 97



Script:

#!/bin/bash
# Description: Locate the definition of the `ProjectHeader` component and search for the usage of `isSubpage` within it.

# Step 1: Locate the definition of the `ProjectHeader` component.
ast-grep --lang tsx --pattern 'export const ProjectHeader = ($_$$$) => { $$$ }' --json | jq -r '.[] | .range.start.line'

# Step 2: Search for the usage of `isSubpage` within the `ProjectHeader` component.
ast-grep --lang tsx --pattern 'isSubpage' --json | jq -r '.[] | .range.start.line'

Length of output: 283



Script:

#!/bin/bash
# Description: Extract and display the relevant lines of code around the occurrences of `isSubpage`.

# Extract lines around the occurrences of `isSubpage` to understand its usage.
for line in 23 71 72 73 185 212; do
  sed -n "$((line-5)),$((line+5))p" apps/web/screens/Project/components/ProjectHeader/ProjectHeader.tsx
done

Length of output: 2300

apps/web/components/DefaultHeader/DefaultHeader.css.ts (7)

17-24: Ensure that the responsive styles defined in gridContainerSubpage meet the design requirements for subpages. The use of 100fr and auto for grid layout adjustments seems appropriate for a more fluid layout.


50-67: The textContainerSubpage styles adjust text alignment and padding for responsiveness. Validate that these styles align with the intended design specifications for subpages.


134-137: The logoSubpage class reduces the logo size for subpages. This should be cross-verified with the design requirements to ensure it matches the intended smaller header design.


125-127: The adjustment in the logoContainerSubpage for the logo's vertical position is noted. Confirm this change aligns with the visual hierarchy intended for subpages.


171-175: The modifications in logoContainerMobileSubpage adjust the logo size and margin for mobile views. Ensure these changes correctly reflect the mobile-first design approach.


150-151: The contentContainerSubpage modifies the height attribute for subpages. Verify that this change is consistent with the layout requirements for content on subpages.


84-98: The textInnerContainerSubpage provides specific padding and alignment for subpages. Ensure these settings are consistent with the UI/UX guidelines for subpages.

apps/web/screens/Project/Project.tsx (1)

297-297: The logic to determine if a page is a subpage seems to be based on a dynamic namespace property. Ensure that this property ('smallerSubpageHeader') is consistently set and documented across all relevant namespace configurations to avoid unexpected behaviors.

apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx (2)

132-132: The addition of the isSubpage prop to the HeaderProps interface enables conditional rendering based on page type. Ensure that all components using HeaderProps correctly handle this new optional property to maintain robustness.


198-198: The conditional rendering logic based on isSubpage within OrganizationHeader should be thoroughly tested, especially since it affects the visual layout and potentially the user experience on organization subpages.

@mannipje mannipje added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Jun 24, 2024
@kodiakhq kodiakhq bot merged commit 52dddd2 into main Jun 24, 2024
38 checks passed
@kodiakhq kodiakhq bot deleted the feature/change-default-header-for-subpages branch June 24, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants