-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update layout auth after significant changes in upstream #10
Conversation
WalkthroughThis pull request introduces several changes to the Husky Git hooks, converting them to shell script format for improved structure and functionality. It also updates various components to reflect a branding change from "Graasp" to "LNCO.ai," including modifications to localization files in multiple languages. Additionally, the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (1)
.husky/pre-commit (1)
4-4
: Consider separating prettier and lint checksCurrently, the lint check only runs if prettier check passes. Consider running them independently to see all issues at once:
-yarn prettier:check && yarn lint +yarn prettier:check +yarn lint
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (9)
.husky/commit-msg
(1 hunks).husky/post-commit
(1 hunks).husky/pre-commit
(1 hunks).husky/pre-push
(1 hunks)src/components/BrandingLogo.tsx
(2 hunks)src/components/LeftContentContainer.tsx
(1 hunks)src/components/register/Register.tsx
(2 hunks)src/langs/en.json
(2 hunks)src/langs/fr.json
(2 hunks)
✅ Files skipped from review due to trivial changes (3)
- .husky/commit-msg
- .husky/post-commit
- src/components/register/Register.tsx
🔇 Additional comments (9)
.husky/pre-commit (2)
1-2
: Verify script permissions
The shell script requires executable permissions to function properly.
✅ Verification successful
Pre-commit hook has correct executable permissions (755)
The pre-commit hook has the correct executable permissions (-rwxr-xr-x
), allowing it to be executed by Git during the commit process.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the pre-commit hook has executable permissions
# Expected: File should have executable bit set (755 or similar)
ls -l .husky/pre-commit
Length of output: 90
1-4
: Verify Husky installation and configuration
The script looks correct, but let's verify the complete Husky setup.
✅ Verification successful
Husky setup is properly configured and functional
The pre-commit hook and overall Husky setup is correctly configured:
- All required dependencies (husky, prettier, eslint) are properly installed
- Necessary scripts (lint, prettier:check) are defined in package.json
- Configuration files (.prettierrc, .eslintrc) exist
- All git hooks have correct structure with proper shebang and husky source
- The pre-commit hook correctly runs prettier and lint checks
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify Husky installation and configuration
# Expected:
# - package.json should have Husky configuration
# - Git hooks should be properly installed
# - Other hook files should exist with similar structure
# Check Husky in package.json
echo "Checking package.json for Husky configuration:"
cat package.json | jq '.husky'
# List all Husky hooks
echo -e "\nListing all Husky hooks:"
ls -la .husky/
# Check content structure of other hooks
echo -e "\nChecking other hooks for consistent structure:"
for hook in .husky/*; do
if [ -f "$hook" ] && [ "$hook" != ".husky/_" ]; then
echo -e "\n=== $hook ==="
head -n 3 "$hook" # Show first 3 lines to verify shebang and husky source
fi
done
Length of output: 1674
Script:
#!/bin/bash
# Let's verify if the required dependencies are properly configured in package.json
echo "Checking package.json for Husky and related dev dependencies:"
cat package.json | jq '.devDependencies | {husky, prettier, eslint}'
# Check if the lint and prettier scripts are defined
echo -e "\nChecking package.json for lint and prettier scripts:"
cat package.json | jq '.scripts | {lint, "prettier:check"}'
# Verify the existence of prettier and eslint config files
echo -e "\nChecking for config files:"
ls -la .prettierrc* .eslintrc* 2>/dev/null || echo "No config files found"
Length of output: 771
src/components/BrandingLogo.tsx (2)
1-1
: LGTM on the AccentColors import
The addition of AccentColors from @graasp/ui is appropriate for the new color scheme.
12-12
: Verify color scheme alignment
The change from primary
to AccentColors.builder
represents a significant styling update. Please ensure this aligns with the design system's color guidelines.
Let's check for consistent usage of this color scheme:
✅ Verification successful
Color scheme usage is consistent with design system
The usage of AccentColors.builder
is consistent with the design system as evidenced by:
- It's imported from the official
@graasp/ui
design system package - It's used consistently across components for builder-related UI elements
- The same pattern is followed for other platform sections (player, analytics) using their respective accent colors
- The component maintains visual hierarchy with the primary theme color still used for the logo fill
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other usages of AccentColors.builder to verify consistency
rg "AccentColors\.builder"
# Look for any color-related documentation
fd -g "**/COLORS.md" -g "**/THEME.md" -g "**/STYLING.md"
Length of output: 424
Script:
#!/bin/bash
# Let's check the AccentColors enum/constant definition and its usage context
ast-grep --pattern 'export $_ AccentColors'
# Let's also check for any theme or color-related constants/types
rg -i "theme|color" --type=typescript -g "!*.test.*" -g "!*.spec.*" -A 3
Length of output: 155
Script:
#!/bin/bash
# Let's check for the AccentColors definition and color-related constants
rg -t ts -t tsx "export.*AccentColors"
# Let's also look for any theme or styling configuration files
fd -e ts -e tsx -e js -e jsx . | rg -i "theme|color|style"
# Check the specific files where AccentColors.builder is used for more context
rg -A 5 -B 5 "AccentColors\.builder"
Length of output: 1871
Script:
#!/bin/bash
# Let's check the content of the styles file we found
cat src/components/styles.ts
# And check for any theme configuration
cat src/components/common/StyledTextField.tsx
# Let's also check if there are any other color-related imports in these files
rg -B 2 "AccentColors" src/components/LeftContentContainer.tsx src/components/BrandingLogo.tsx
Length of output: 1967
src/components/LeftContentContainer.tsx (3)
1-1
: LGTM! Import statement properly updated
The consolidated import statement correctly reflects the removal of LibraryIcon
while maintaining necessary imports.
Line range hint 52-69
: LGTM! Platform sections maintain consistent structure
The remaining platform sections (Builder, Player, Analytics) maintain a clean and consistent layout after the removal of the Library section.
Line range hint 52-69
: Verify cleanup of Library-related resources
While the Library section has been cleanly removed from this component, we should verify that all related resources have been properly cleaned up.
src/langs/en.json (1)
58-59
: LGTM: Analytics text change is clear and focused
The simplified message better emphasizes the key functionality of data export, which aligns well with the research-oriented focus.
src/langs/fr.json (1)
53-53
: LGTM! Note the shift in messaging context.
The updated text changes the focus from student engagement to reaching subjects through experiments, which aligns with the broader context shift in the application.
@@ -89,5 +89,5 @@ | |||
"INVALID_TOKEN_PROVIDED_DESCRIPTION": "No token was provided or the provided token is expired. Click the button below to generate a request to reset your password.", | |||
"REDIRECTION_TITLE": "Welcome back, {{name}}", | |||
"REDIRECTION_DESCRIPTION": "You are logged in.", | |||
"REDIRECTION_BUTTON": "Go to Graasp" | |||
"REDIRECTION_BUTTON": "Go to LNCO.ai" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Branding inconsistencies found in German translation and package metadata
Several instances still reference "Graasp" and need to be updated to "LNCO.ai":
src/langs/de.json
: "REDIRECTION_BUTTON" still shows "Gehe zu Graasp"src/langs/ar.json
: Two strings still contain "Graasp" references- Package metadata files still use Graasp branding:
package.json
: package name, author, and dependenciespublic/manifest.json
: app name and short namerenovate.json
: configuration reference
The LNCO.ai branding is consistently capitalized as "LNCO.ai" in all translated strings where it has been updated.
🔗 Analysis chain
Verify complete rebranding from Graasp to LNCO.ai
While this button text has been updated, we should ensure all Graasp references have been updated to LNCO.ai for consistency.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining "Graasp" references that might need updating
rg -i "graasp" --type json
# Also check for consistency in LNCO.ai capitalization
rg -i "lnco" --type json
Length of output: 3303
@@ -85,5 +85,5 @@ | |||
"INVALID_TOKEN_PROVIDED_DESCRIPTION": "Aucun jeton n'a été fourni ou le jeton fourni a expiré. Cliquez sur le bouton ci-dessous pour générer une demande de réinitialisation de votre mot de passe.", | |||
"REDIRECTION_TITLE": "Bienvenue, {{name}}", | |||
"REDIRECTION_DESCRIPTION": "Vous êtes connecté.", | |||
"REDIRECTION_BUTTON": "Aller à Graasp" | |||
"REDIRECTION_BUTTON": "Aller à LNCO.ai" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Branding update requires attention: Multiple "Graasp" references need to be updated
The branding change from "Graasp" to "LNCO.ai" is incomplete. Several files still contain references to "Graasp" that need to be updated:
- Configuration files still use "Graasp" in environment variables and package names
- UI components are still importing and using
GraaspLogo
component - Translation files contain mixed branding ("Graasp" in Arabic translations while "LNCO.ai" in others)
- Test files and fixtures contain "Graasp" references
- Mobile app links and manifest still use "Graasp" branding
Please update all these references to maintain consistent branding across the codebase.
🔗 Analysis chain
Verify branding consistency across the codebase.
The branding update from "Graasp" to "LNCO.ai" is correct. Let's verify the consistency of this branding change across all files.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining references to "Graasp" that might need updating
# Search for "Graasp" in all files
echo "Searching for remaining 'Graasp' references:"
rg -i "graasp" --type json --type typescript --type javascript --type tsx
# Search for inconsistent "LNCO.ai" capitalization
echo -e "\nChecking for inconsistent 'LNCO.ai' capitalization:"
rg -i "lnco\.ai" --type json --type typescript --type javascript --type tsx
Length of output: 451
Script:
#!/bin/bash
# Let's try with simpler commands without file type restrictions
# Search for any remaining references to "Graasp"
echo "Searching for remaining 'Graasp' references:"
rg -i "graasp"
# Search for all variations of LNCO.ai
echo -e "\nChecking for 'LNCO.ai' variations:"
rg -i "lnco\.ai"
Length of output: 67251
Script:
#!/bin/bash
# Let's check for any remaining references to "Graasp" in the UI components and translations
# that might need to be updated to "LNCO.ai"
# Search for "Graasp" in UI components and translation files
echo "Searching for 'Graasp' in UI components and translations:"
fd -e tsx -e ts -e json | xargs rg -i "graasp" -l
# Check for inconsistent capitalization of "LNCO.ai" in UI components and translations
echo -e "\nChecking for inconsistent capitalization of 'LNCO.ai':"
fd -e tsx -e ts -e json | xargs rg -i "lnco\.ai" -A 1 -B 1
Length of output: 7726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just some very minor changes.
Note that the single test that is failing passes locally and works already deployed, not sure why it fails here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
vite.config.ts.timestamp-1732185774164-b07524006208d.mjs (2)
14-15
: Enhance port configuration robustnessThe port configuration could be more robust by:
- Adding a fallback port if parsing fails
- Validating the port range
Consider this enhancement:
- port: parseInt(process.env.VITE_PORT || "3001", 10), + port: (() => { + const port = parseInt(process.env.VITE_PORT || "3001", 10); + return isNaN(port) || port < 1024 || port > 65535 ? 3001 : port; + })(),
40-43
: Enhance ESLint configurationThe current ESLint configuration could be more comprehensive to catch common issues.
Consider enhancing the ESLint configuration:
checker({ typescript: true, - eslint: { lintCommand: 'eslint "./**/*.{ts,tsx}"' } + eslint: { + lintCommand: 'eslint "./**/*.{ts,tsx}" --max-warnings=0', + dev: { + logLevel: ['error'] + } + } })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
.husky/commit-msg
(1 hunks).husky/post-commit
(1 hunks).husky/pre-commit
(1 hunks).husky/pre-push
(1 hunks)vite.config.ts.timestamp-1732185774164-b07524006208d.mjs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- .husky/commit-msg
- .husky/post-commit
- .husky/pre-commit
- .husky/pre-push
🔇 Additional comments (2)
vite.config.ts.timestamp-1732185774164-b07524006208d.mjs (2)
54-57
: LGTM: Export statement is well-structured
The export statement follows the standard pattern and is correctly implemented.
1-57
: Verify Husky integration compatibility
Since the PR mentions Husky re-enablement, let's verify that this Vite configuration supports the Husky integration.
✅ Verification successful
Let me gather more information about the Husky hooks content to better understand their configuration.
Vite configuration is compatible with Husky integration
The Vite configuration aligns perfectly with the Husky integration:
- Husky is properly configured with all necessary hooks (commit-msg, post-commit, pre-commit, pre-push)
- The pre-push hook runs
yarn build
which uses the Vite configuration correctly - The pre-commit hook runs linting which is supported by the Vite checker plugin in dev mode
- All required scripts referenced in the hooks are properly defined in package.json
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check Husky configuration and related scripts
# Check if Husky is properly configured in package.json
echo "Checking package.json for Husky configuration..."
cat package.json | jq '.scripts | select(contains({prepare: "husky install"}))'
# Check if Husky hooks are present and executable
echo "Checking Husky hooks..."
ls -la .husky/* 2>/dev/null || echo "No Husky hooks found"
# Check if the hooks reference any commands configured in this file
echo "Checking hooks for Vite-related commands..."
grep -r "vite" .husky/ 2>/dev/null || echo "No Vite commands found in hooks"
Length of output: 777
Script:
#!/bin/bash
# Check the content of Husky hooks
echo "Content of commit-msg hook:"
cat .husky/commit-msg
echo -e "\nContent of post-commit hook:"
cat .husky/post-commit
echo -e "\nContent of pre-commit hook:"
cat .husky/pre-commit
echo -e "\nContent of pre-push hook:"
cat .husky/pre-push
# Check package.json scripts that might be referenced by these hooks
echo -e "\nPackage.json scripts:"
cat package.json | jq '.scripts'
Length of output: 1691
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question about a file that seems to have paths from your computer.
PS. Make sure you always squash and merge precisely to get rid of "middle" commits.
@@ -0,0 +1,58 @@ | |||
// vite.config.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file need to be committed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, it was generated running the tests locally, removed it in a new commit now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check online whether these sorts of files should be added to the gitignore? If so, add them, please to avoid future issues.
These files should be automatically deleted when running tests, but it appears something went wrong. I added it to the gitignore in the latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
Remember to squash and merge!
This PR contains a number of changes that I made to the lay-out after the auth design was updated in the upstream. I also re-enabled Husky, which was running into issues before but is working now.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores
.gitignore
to exclude Vite configuration files.