-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Simple Homepage] Activity view - Recent Spaces + mobile support #7116
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes in this pull request include significant updates to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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
Documentation and Community
|
@coderabbitai review. Please, skip redundant comments related to error handling (we have global error handling). |
@bobbykolev: Understood, I will skip redundant comments related to error handling as you have global error handling in place. I will review the changes. ✏️ Learnings added
✅ Actions performedReview triggered.
|
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: 4
🧹 Outside diff range and nitpick comments (2)
src/core/i18n/en/translation.en.json (2)
Line range hint
1-2199
: Consider adding documentation for translation patterns.While the translations follow consistent patterns, consider adding a comment block at the top of the file documenting:
- Variable interpolation using {{variable}} syntax
- Pluralization using _plural suffix
- HTML tag handling in translations
This would help maintainers follow the established patterns.
Line range hint
1-2199
: Consider externalizing URLs from translation strings.URLs are currently hardcoded in translation strings (e.g., "https://welcome.alkem.io/..."). Consider:
- Moving URLs to a separate configuration file
- Using URL keys in translation strings
- Interpolating URLs during runtime
This would make it easier to:
- Update URLs across the application
- Support different environments (staging, production)
- Maintain URL consistency
Example approach:
{ "urls": { "welcome": "https://welcome.alkem.io", "blog": "{{welcome}}/blog/", "contact": "{{welcome}}/contact/" }, "pages": { "home": { "sections": { "tipsAndTricks": { "findMoreUrl": "{{urls.blog}}" } } } } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (2)
src/core/apollo/generated/apollo-hooks.ts
is excluded by!**/generated/**
src/core/apollo/generated/graphql-schema.ts
is excluded by!**/generated/**
📒 Files selected for processing (7)
src/core/i18n/en/translation.en.json
(1 hunks)src/main/topLevelPages/myDashboard/DashboardWithMemberships/DashboardActivity.tsx
(1 hunks)src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneyCard.tsx
(0 hunks)src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneyHydrator.tsx
(0 hunks)src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneysList.tsx
(1 hunks)src/main/topLevelPages/myDashboard/recentSpaces/RecentSpace.graphql
(0 hunks)src/main/topLevelPages/myDashboard/recentSpaces/RecentSpaces.graphql
(1 hunks)
💤 Files with no reviewable changes (3)
- src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneyCard.tsx
- src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneyHydrator.tsx
- src/main/topLevelPages/myDashboard/recentSpaces/RecentSpace.graphql
🧰 Additional context used
📓 Path-based instructions (4)
src/core/i18n/en/translation.en.json (1)
Pattern src/**/*.json
: Review the JSON files for correct syntax and structure.
Ensure that the configuration and data are accurate and follow the project's standards.
Check for sensitive data exposure and ensure that the data is properly validated.
src/main/topLevelPages/myDashboard/DashboardWithMemberships/DashboardActivity.tsx (1)
Pattern src/**/*.{ts,tsx,js}
: Review the React.js/TypeScript/JavaScript code for best practices and potential bugs.
Ensure that the code adheres to TypeScript's typing system and modern standards.
Ensure sufficient error handling and logging is present.
Check for common security vulnerabilities such as:
- SQL Injection
- XSS (Cross-Site Scripting)
- CSRF (Cross-Site Request Forgery)
- Insecure dependencies
- Sensitive data exposure
src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneysList.tsx (1)
Pattern src/**/*.{ts,tsx,js}
: Review the React.js/TypeScript/JavaScript code for best practices and potential bugs.
Ensure that the code adheres to TypeScript's typing system and modern standards.
Ensure sufficient error handling and logging is present.
Check for common security vulnerabilities such as:
- SQL Injection
- XSS (Cross-Site Scripting)
- CSRF (Cross-Site Request Forgery)
- Insecure dependencies
- Sensitive data exposure
src/main/topLevelPages/myDashboard/recentSpaces/RecentSpaces.graphql (1)
Pattern src/**/*.{graphql,gql}
: Review the GraphQL schema and queries for best practices, potential bugs, and adherence to the project's GraphQL standards.
Ensure that the schema is well-defined and queries are optimized.
Check for security vulnerabilities.
🔇 Additional comments (8)
src/main/topLevelPages/myDashboard/recentSpaces/RecentSpaces.graphql (2)
6-8
: LGTM! Efficient profile data fetching.
The inclusion of the profile field with fragment spread optimizes data fetching by including all necessary fields in a single query, eliminating the need for separate hydration requests.
15-22
: Verify the VisualUri fragment dependency.
The fragment definition looks good and includes all necessary fields for the profile. However, let's verify the existence and implementation of the referenced VisualUri fragment.
✅ Verification successful
VisualUri fragment dependency is properly implemented
The VisualUri fragment is correctly defined in src/domain/common/visual/graphql/visualUri.graphql
with all necessary fields (id, uri, name) and is properly referenced in the RecentSpaceProfile fragment.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the existence and implementation of VisualUri fragment
# Expected: Find the fragment definition in the codebase
# Search for VisualUri fragment definition
ast-grep --pattern 'fragment VisualUri on $_ {
$$$
}'
# Alternatively, search using ripgrep
rg 'fragment\s+VisualUri\s+on'
Length of output: 247
Script:
#!/bin/bash
# Let's check the implementation of VisualUri fragment
cat src/domain/common/visual/graphql/visualUri.graphql
Length of output: 107
src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneysList.tsx (3)
34-34
: 🛠️ Refactor suggestion
Remove redundant slice operation.
The slice operation is unnecessary since the query already limits the results using the limit
parameter.
- {data?.me.mySpaces.slice(0, visibleSpaces).map(result => (
+ {data?.me.mySpaces.map(result => (
Likely invalid or redundant comment.
38-44
: Verify journey object structure completeness.
The journey object seems to contain only basic profile information. Verify if this matches the expected JourneyTile
props interface and if additional properties are required.
✅ Verification successful
Journey object structure is complete and correct
The provided journey object structure matches the expected JourneyTileProps
interface exactly. From the interface definition found in src/domain/journey/common/JourneyTile/JourneyTile.tsx
, the journey prop requires only:
- profile.displayName (string)
- profile.url (string)
- profile.cardBanner (Visual, optional)
All these properties are correctly included in the implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for JourneyTile usage patterns
ast-grep --pattern 'JourneyTile $props={$_}'
Length of output: 130
Script:
#!/bin/bash
# Search for JourneyTile component definition and its props interface
ast-grep --pattern 'interface JourneyTileProps {
$$$
}'
# Also search for JourneyTile component usage with journey prop
ast-grep --pattern '<JourneyTile journey={$_}'
# Backup search using ripgrep
rg "JourneyTile.*journey" -A 5
Length of output: 6475
25-25
: Remove TODO comment after verification.
The comment suggests that the logic for calculating the limit needs verification. This should be resolved before merging.
✅ Verification successful
The limit calculation logic is correct and can be verified
The visibleSpaces
calculation (columns / 2 - 1
) is used consistently with the responsive layout logic where cardColumns
is calculated as columns / 2
for mobile and columns / 4
for desktop. The limit is appropriately used to fetch the exact number of spaces needed for the grid layout. You can safely remove the TODO comment.
- The calculation ensures proper grid alignment with the responsive layout
- Similar pattern is used in other space-related views (
SpaceExplorerView.tsx
,ExploreSpacesView.tsx
) where visible spaces are limited based on layout requirements
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any related limit calculations in space queries
rg -A 5 "limit.*space" --type ts
Length of output: 130
Script:
#!/bin/bash
# Search for limit calculations in the component and related files
rg -g "*.{ts,tsx}" -A 5 "limit.*visibleSpaces"
# Search for visibleSpaces calculations
rg -g "*.{ts,tsx}" -A 5 "visibleSpaces.*columns"
# Look for JourneyTile usage patterns
ast-grep --pattern 'const visibleSpaces = $_'
Length of output: 1782
src/main/topLevelPages/myDashboard/DashboardWithMemberships/DashboardActivity.tsx (1)
29-35
: Layout changes look good!
The responsive layout implementation using blockColumns
is clean and effectively handles both mobile and desktop views. The structure maintains consistency across different screen sizes.
src/core/i18n/en/translation.en.json (2)
2199-2199
: LGTM! Clear and consistent translation text.
The translation text "Explore all your Spaces" is clear, action-oriented, and follows the established pattern for similar "see more" actions throughout the application.
Line range hint 1-2199
: LGTM! Well-structured JSON.
The JSON structure is valid and follows proper nesting conventions, making it maintainable and easy to navigate.
src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneysList.tsx
Outdated
Show resolved
Hide resolved
src/main/topLevelPages/myDashboard/recentSpaces/RecentJourneysList.tsx
Outdated
Show resolved
Hide resolved
src/main/topLevelPages/myDashboard/DashboardWithMemberships/DashboardActivity.tsx
Outdated
Show resolved
Hide resolved
src/main/topLevelPages/myDashboard/DashboardWithMemberships/DashboardActivity.tsx
Outdated
Show resolved
Hide resolved
[Simple Homepage] My resources block
#7054
I'll leave the extension of JourneyTile to support a spaceLevel icon in front, for a separate task.
Summary by CodeRabbit
New Features
RecentSpaceProfile
fragment to enrich space information in queries.Bug Fixes
Chores