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(app): fix bugs, remove some blemishes in the design #3076

Merged
merged 20 commits into from
Nov 29, 2024

Conversation

FussuChalice
Copy link
Contributor

Description

  • Fix gaps – Congregation settings page
  • Make smaller texts for red & yellow notes – registration
  • Fix Hamburger menu padding
  • Add circuit number badge to congregation(s) – Speakers catalog
  • Align "Published" icon
  • Move EXPORT S-99 to the main action button location
  • Move EXPORT S-99 to the main action button location

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
organized-app ✅ Ready (Inspect) Visit Preview Nov 29, 2024 1:08pm

Copy link
Contributor

coderabbitai bot commented Nov 29, 2024

Walkthrough

The pull request introduces several changes across multiple components, primarily focusing on styling adjustments and minor enhancements to functionality. Key modifications include changes to the borderColor in the TableHead component, updates to typography classes in the CongregationAccessCode and CongregationMasterKey components, and layout adjustments in the CongregationBasic and MeetingForms components. Additionally, the PublicTalks component removes the export button for table views, while the PublicTalksList component adds responsive export functionality. The OutgoingSpeakersHeader component now displays a circuit number, enhancing its data presentation.

Changes

File Path Change Summary
src/components/table/TableHead.tsx Updated borderColor from var(--accent-200) to var(--accent-200); in TableCell styling.
src/features/app_start/vip/congregation_create/congregation_access_code/index.tsx Changed Typography class from "body-regular" to "body-small-regular" in CongregationAccessCode.
src/features/app_start/vip/congregation_create/congregation_master_key/index.tsx Changed Typography class from "body-regular" to "body-small-regular" in CongregationMasterKey.
src/features/congregation/settings/congregation_basic/index.tsx Added sx prop with margin-top: '16px' to CardSection.
src/features/congregation/settings/meeting_forms/index.tsx Added useBreakpoints hook; updated CardSection to conditionally apply marginTop based on screen size.
src/features/congregation/settings/shared_styles/index.tsx Removed marginTop from CardSection styled component.
src/features/meeting_materials/public_talks/index.tsx Removed export button functionality from PublicTalks when view is 'table'.
src/features/meetings/schedule_publish/month_item/index.tsx Enhanced Box styling for IconPublishedSchedule with flex properties.
src/features/persons/speakers_catalog/my_congregation/header/index.tsx Added circuitNumber to useHeader return; introduced new Typography element to display circuit number.
src/features/persons/speakers_catalog/my_congregation/header/useHeader.tsx Added circuitNumber state variable using useRecoilValue and included it in the return object.
src/layouts/navbar/index.tsx Modified IconButton padding based on tabletDown state.
src/pages/meeting_materials/public_talks_list/index.tsx Added IconExport import; replaced single toggle button with two buttons, including a new export button.

Possibly related PRs

Suggested reviewers

  • rhahao

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d21e6fc and e957090.

📒 Files selected for processing (2)
  • src/components/table/TableHead.tsx (1 hunks)
  • src/features/meeting_materials/public_talks/listView/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/features/meeting_materials/public_talks/listView/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/table/TableHead.tsx

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

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: 5

🧹 Outside diff range and nitpick comments (5)
src/pages/meeting_materials/public_talks_list/index.tsx (1)

9-12: Add explicit return type to the component

While the code works correctly, adding an explicit return type would improve type safety and documentation.

-const PublicTalksList = () => {
+const PublicTalksList: React.FC = () => {
src/features/meeting_materials/public_talks/index.tsx (2)

Line range hint 26-35: Simplify the getTableHeight function

The current implementation can be more concise by using a ternary operator.

 const getTableHeight = () => {
-  let height: string;
-
-  if (laptopUp) {
-    height = '80vh';
-  }
-
-  if (!laptopUp) {
-    height = '75vh';
-  }
-
-  return height;
+  return laptopUp ? '80vh' : '75vh';
 };

Line range hint 1-1: Document breaking change: Export button removal

The removal of the export functionality from this component is a breaking change. Please ensure this is documented in:

  1. Component documentation
  2. Migration guide (if applicable)
  3. Release notes

This change should be communicated to users who might rely on the export functionality in its previous location.

src/features/congregation/settings/meeting_forms/index.tsx (2)

39-43: Consider using theme-based spacing for better maintainability

While the current implementation works, consider using MUI's theme spacing system for more consistent and maintainable spacing values. This would better align with Material-UI best practices.

 <CardSection
   sx={{
-    marginTop: laptopDown ? '0' : '16px',
+    marginTop: laptopDown ? 0 : 2,
   }}
 >

This approach:

  • Uses MUI's spacing units (where 1 = 8px)
  • Maintains consistency with MUI's theming system
  • Makes it easier to adjust spacing globally through theme customization

Line range hint 1-93: Consider breaking down the component for better maintainability

The component handles multiple responsibilities (auto-updates, display preferences, date formats). Consider splitting it into smaller, focused sub-components for better maintainability and testing.

Suggested structure:

// AutoUpdateSettings.tsx
const AutoUpdateSettings = () => {
  // Auto-update related logic and UI
};

// DisplaySettings.tsx
const DisplaySettings = () => {
  // Display and name format related UI
};

// MeetingForms.tsx
const MeetingForms = () => {
  return (
    <CardSection>
      <CardSectionHeader />
      <CardSectionContent>
        <AutoUpdateSettings />
        <DisplaySettings />
      </CardSectionContent>
    </CardSection>
  );
};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 32a1058 and a482f1f.

⛔ Files ignored due to path filters (1)
  • src/locales/en/general.json is excluded by !**/*.json
📒 Files selected for processing (12)
  • src/components/table/TableHead.tsx (1 hunks)
  • src/features/app_start/vip/congregation_create/congregation_access_code/index.tsx (1 hunks)
  • src/features/app_start/vip/congregation_create/congregation_master_key/index.tsx (1 hunks)
  • src/features/congregation/settings/congregation_basic/index.tsx (1 hunks)
  • src/features/congregation/settings/meeting_forms/index.tsx (3 hunks)
  • src/features/congregation/settings/shared_styles/index.tsx (0 hunks)
  • src/features/meeting_materials/public_talks/index.tsx (1 hunks)
  • src/features/meetings/schedule_publish/month_item/index.tsx (1 hunks)
  • src/features/persons/speakers_catalog/my_congregation/header/index.tsx (2 hunks)
  • src/features/persons/speakers_catalog/my_congregation/header/useHeader.tsx (2 hunks)
  • src/layouts/navbar/index.tsx (1 hunks)
  • src/pages/meeting_materials/public_talks_list/index.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • src/features/congregation/settings/shared_styles/index.tsx
✅ Files skipped from review due to trivial changes (3)
  • src/features/app_start/vip/congregation_create/congregation_access_code/index.tsx
  • src/features/app_start/vip/congregation_create/congregation_master_key/index.tsx
  • src/features/congregation/settings/congregation_basic/index.tsx
🔇 Additional comments (9)
src/features/persons/speakers_catalog/my_congregation/header/useHeader.tsx (3)

3-7: LGTM! Clean import organization

The new import is properly grouped with related imports from '@states/settings' and maintains good organization.


14-14: LGTM! Consistent state management

The circuit number state is properly integrated using the same pattern as other congregation-related states.


25-25: Verify the impact on consuming components

The addition of circuitNumber to the return object is correct. However, let's verify that all components using this hook properly handle the new property.

✅ Verification successful

The new circuitNumber property is properly handled

The code inspection shows that the circuitNumber property is only used in src/features/persons/speakers_catalog/my_congregation/header/index.tsx, where it's correctly destructured from the hook and properly displayed in the UI with proper translation handling: t('tr_circuit', { circuitNumber: circuitNumber }). The other components importing useHeader are using different versions of the hook with different return objects, as they belong to different features (other congregations and field service groups).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all components that import and use this hook to ensure they handle the new circuitNumber property correctly

# Search for files importing useHeader
echo "Files importing useHeader:"
rg -l "import.*useHeader" --type tsx

# Search for usage of the hook to examine the destructuring patterns
echo "\nUsage patterns of useHeader:"
rg "const.*=.*useHeader\(\)" -A 2 --type tsx

Length of output: 275


Script:

#!/bin/bash
# Let's try with .ts and .tsx extensions explicitly since the file type is not recognized
echo "Files importing useHeader:"
rg -l "import.*useHeader" --glob "*.ts" --glob "*.tsx"

echo -e "\nUsage patterns of useHeader:"
rg "const.*=.*useHeader\(\)" -A 2 --glob "*.ts" --glob "*.tsx"

# Also search for direct references to circuitNumber from useHeader
echo -e "\nUsages of circuitNumber from hook:"
rg "useHeader.*circuitNumber|circuitNumber.*useHeader" --glob "*.ts" --glob "*.tsx"

Length of output: 960


Script:

#!/bin/bash
# Let's examine the content of the files that import useHeader to see their full implementation
echo "Content of other_congregations header:"
cat "src/features/persons/speakers_catalog/other_congregations/header/index.tsx"

echo -e "\nContent of my_congregation header:"
cat "src/features/persons/speakers_catalog/my_congregation/header/index.tsx"

echo -e "\nContent of field_service_groups header:"
cat "src/features/congregation/field_service_groups/group_item/header/index.tsx"

Length of output: 8747

src/features/meetings/schedule_publish/month_item/index.tsx (1)

26-32: LGTM! Clean implementation of icon alignment.

The flex layout properties effectively center the published icon, addressing the alignment issue mentioned in the PR objectives. The implementation follows MUI best practices and maintains accessibility with the title prop.

src/pages/meeting_materials/public_talks_list/index.tsx (1)

2-2: LGTM: Import changes are well-structured

The new imports for IconExport and useBreakpoints are appropriately added and align with the component's enhanced functionality.

Also applies to: 6-6

src/features/meeting_materials/public_talks/index.tsx (1)

9-9: Verify removal of export functionality

The removal of the IconExport import aligns with the removal of export functionality from the table view. However, let's verify that this functionality is properly relocated as mentioned in the PR objectives about "EXPORT S-99".

✅ Verification successful

Export functionality correctly relocated to public_talks_list page

The removal of IconExport import is correct as the export functionality has been properly relocated to the public_talks_list page (src/pages/meeting_materials/public_talks_list/index.tsx), which now handles the S-99 export feature. This aligns with the PR objectives and represents a clean separation of concerns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that export functionality is properly relocated
# and not completely removed from the codebase

# Check for any remaining references to IconExport
rg "IconExport"

# Check for export-related functionality in public talks related files
fd -e tsx -e ts "public_talks" | xargs rg -l "export"

Length of output: 1061


Script:

#!/bin/bash
# Check the content of public_talks_list page to understand where export functionality is moved
rg -A 10 "IconExport" src/pages/meeting_materials/public_talks_list/index.tsx

# Check if there are any export-related functions or handlers in both files
ast-grep --pattern 'function $FUNC_NAME($$$) { $$$ export $$$ }'
ast-grep --pattern 'const $FUNC_NAME = ($$$) => { $$$ export $$$ }'

# Check for export-related strings in both components
rg -i "export" src/features/meeting_materials/public_talks/index.tsx src/pages/meeting_materials/public_talks_list/index.tsx

Length of output: 1557

src/features/congregation/settings/meeting_forms/index.tsx (2)

2-6: LGTM! Clean import organization

The addition of useBreakpoints is properly grouped with related hooks and follows the project's import style.


29-30: LGTM! Proper hook usage for responsive design

The useBreakpoints hook is correctly implemented for responsive layout control.

src/features/persons/speakers_catalog/my_congregation/header/index.tsx (1)

28-28: LGTM! Clean hook integration.

The addition of circuitNumber to the destructured values from useHeader is well-integrated with the existing pattern.

src/components/table/TableHead.tsx Outdated Show resolved Hide resolved
src/layouts/navbar/index.tsx Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 29, 2024
@rhahao rhahao merged commit c6b346a into sws2apps:main Nov 29, 2024
10 checks passed
Copy link

cypress bot commented Nov 29, 2024

organized-app    Run #1664

Run Properties:  status check passed Passed #1664  •  git commit c6b346ae50: fix(app): fix bugs, remove some blemishes in the design
Project organized-app
Branch Review main
Run status status check passed Passed #1664
Run duration 00m 05s
Commit git commit c6b346ae50: fix(app): fix bugs, remove some blemishes in the design
Committer Max Makaluk
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 1
View all changes introduced in this branch ↗︎

@rhahao
Copy link
Member

rhahao commented Nov 30, 2024

🎉 This PR is included in version 2.130.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants