-
Notifications
You must be signed in to change notification settings - Fork 588
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 return to index page #4478
Fix return to index page #4478
Conversation
WalkthroughThe recent updates span multiple files, enhancing functionality and usability. Key changes include the introduction of new props and CSS styling, improved conditional rendering, and added test logic for end-to-end testing. Additionally, a new Page Object Model (POM) class was created to streamline page-related operations and assertions in tests. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as User Interface
participant Router as RouterContext
participant Backend as Backend Service
User->>UI: Interacts with Dataset Selector
UI->>Router: Calls get(true)
Router->>Backend: Fetches data with next=true
Backend-->>Router: Returns data
Router-->>UI: Provides fetched data
UI-->>User: Displays updated data
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 0
Outside diff range and nitpick comments (1)
app/packages/app/src/components/DatasetSelector.tsx (1)
Line range hint
11-11
: Add ahref
attribute to improve accessibility.- <a className={className} title={value}> + <a className={className} title={value} href={`#dataset-${value}`}>
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (8)
- app/packages/app/src/Renderer.tsx (1 hunks)
- app/packages/app/src/components/DatasetSelector.tsx (1 hunks)
- app/packages/app/src/pages/IndexPage.tsx (2 hunks)
- app/packages/app/src/pages/datasets/DatasetPage.tsx (1 hunks)
- app/packages/app/src/routing/RouterContext.ts (2 hunks)
- app/packages/app/src/useEvents/useStateUpdate.ts (1 hunks)
- e2e-pw/src/oss/poms/page.ts (1 hunks)
- e2e-pw/src/oss/specs/regression-tests/index-page.spec.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- app/packages/app/src/Renderer.tsx
- app/packages/app/src/useEvents/useStateUpdate.ts
Additional context used
Path-based instructions (6)
app/packages/app/src/components/DatasetSelector.tsx (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.e2e-pw/src/oss/specs/regression-tests/index-page.spec.ts (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.app/packages/app/src/pages/IndexPage.tsx (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.e2e-pw/src/oss/poms/page.ts (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.app/packages/app/src/pages/datasets/DatasetPage.tsx (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.app/packages/app/src/routing/RouterContext.ts (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.
Biome
app/packages/app/src/components/DatasetSelector.tsx
[error] 11-11: Provide a href attribute for the a element. (lint/a11y/useValidAnchor)
An anchor element should always have a href
Check this thorough explanation to better understand the context.app/packages/app/src/routing/RouterContext.ts
[error] 88-88: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 156-156: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
Additional comments not posted (7)
app/packages/app/src/components/DatasetSelector.tsx (1)
25-25
: LGTM! Adding thecy
attribute enhances testability.e2e-pw/src/oss/specs/regression-tests/index-page.spec.ts (2)
7-12
: Well-structured test setup using page object model.
24-36
: Thorough and clear assertions for navigation functionality.app/packages/app/src/pages/IndexPage.tsx (1)
8-8
: Good use of CSS modules for styling consistency and maintainability.Also applies to: 32-36
e2e-pw/src/oss/poms/page.ts (1)
5-65
: Well-implemented page object model and assertions for robust e2e testing.app/packages/app/src/pages/datasets/DatasetPage.tsx (1)
115-124
: The changes to wrap the conditional rendering with a styled div enhance maintainability and testability. Ensure that the added div does not introduce any layout or styling issues.app/packages/app/src/routing/RouterContext.ts (1)
Line range hint
57-139
: The update to theget
method to accept a boolean parameter enhances flexibility in routing. Ensure that this change is well-documented and does not affect existing routing logic adversely.Verification successful
The search results indicate that the
get
method is used in various contexts throughout the codebase. However, the specificget
method fromRouterContext.ts
is only referenced within that file. This suggests that the changes to theget
method inRouterContext.ts
are isolated and do not impact other parts of the codebase.
- The
get
method inRouterContext.ts
is defined with a default parameternext = false
.- The search results show that the
get
method is called withinRouterContext.ts
with thenext
parameter.Given this context, it appears that the changes to the
get
method are self-contained and should not break existing routing logic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the updated `get` method does not break existing routing logic. # Test: Search for usages of the `get` method to ensure they pass the correct parameters. rg --type ts 'get(' src/Length of output: 85
Script:
#!/bin/bash # Description: Verify that the updated `get` method does not break existing routing logic. # Test: Search for usages of the `get` method to ensure they pass the correct parameters. rg --type ts 'get\(' src/Length of output: 72
Script:
#!/bin/bash # Description: Verify that the updated `get` method does not break existing routing logic. # Step 1: Locate all TypeScript files. fd --type f --extension ts > ts_files.txt # Step 2: Search for usages of the `get` method in the located TypeScript files. xargs rg 'get\(' < ts_files.txtLength of output: 72958
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.
Tested locally. Works great 🚀
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.
What changes are proposed in this pull request?
Ensures the next page entry is requested when updating the App page
How is this patch tested? If it is not, please explain why.
e2e spec
Release Notes
session.dataset = None
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
New Features
PagePom
class andPageAsserter
class to improve page-related functionality and assertions.Enhancements
DatasetSelector
component to include a newcy
prop for better dataset identification.IndexPage
andDatasetPage
for more consistent behavior.Bug Fixes
useStateUpdate
function to ensure actions are performed only whenreadyStateRef.current
is valid.