fiftyone icon indicating copy to clipboard operation
fiftyone copied to clipboard

initial saved spaces ui

Open imanjra opened this issue 11 months ago • 3 comments

What changes are proposed in this pull request?

initial saved spaces UI (part of a saved spaces feature)

How is this patch tested? If it is not, please explain why.

By enabling the feature flag by setting the local storage key savedSpaces to true

Preview

https://github.com/voxel51/fiftyone/assets/25350704/863d9520-3caf-4bbd-b888-fa3c81c4d323

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • [x] No. You can skip the rest of this section.
  • [ ] Yes. Give a description of this change to be included in the release notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • [x] App: FiftyOne application changes
  • [ ] Build: Build and test infrastructure changes
  • [ ] Core: Core fiftyone Python library changes
  • [ ] Documentation: FiftyOne documentation changes
  • [ ] Other

Summary by CodeRabbit

  • New Features
    • Introduced a SavedSpace component for viewing and editing saved spaces.
    • Added a custom React hook useSavedSpaces for managing a list of saved spaces, including adding, deleting, and updating spaces.
    • Implemented a SavedSpaces component to manage and save different spaces with functionalities for filtering, saving, and deleting.
    • Enhanced the Space component to conditionally render the SavedSpaces component based on certain conditions.

imanjra avatar Mar 26 '24 22:03 imanjra

Walkthrough

The recent updates enhance workspace management and customization in a React application. New components and hooks improve interactions with saved workspaces, allowing for detailed edits and efficient state management. Changes also refine the underlying data structure and permissions, ensuring a more intuitive and controlled user experience.

Changes

File Path Change Summary
.../components/Dialog/index.tsx Introduces a customizable Dialog component extending Material-UI's version.
.../spaces/src/components/SavedSpaces/... Adds multiple components and hooks for managing and editing saved workspaces.
.../spaces/src/state.ts Updates Recoil state management with new atoms for workspace editing.
.../state/src/recoil/atoms.ts Adds canEditWorkspaces atom for managing edit permissions.
.../state/src/session.ts Modifies the SPACES_DEFAULT object structure and properties.

🐰✨ In fields of code where logic threads weave, A rabbit hopped, leaving changes to perceive. With each line crafted, a new feature blooms, Workspaces dance in their colorful rooms. Hop, skip, a joyful code deploy, In the digital meadow, a rabbit's joy. 🌼🖥️


Recent Review Details

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between edacd2bd1d1e6009eed7e76463b7798b6f900fd4 and 1fbe568c85268b738953870da0c1eae4aaacc9cf.
Files selected for processing (3)
  • app/packages/spaces/src/components/SavedSpaces/SavedSpace.tsx (1 hunks)
  • app/packages/spaces/src/components/SavedSpaces/hooks.ts (1 hunks)
  • app/packages/spaces/src/components/SavedSpaces/index.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • app/packages/spaces/src/components/SavedSpaces/SavedSpace.tsx
  • app/packages/spaces/src/components/SavedSpaces/hooks.ts
  • app/packages/spaces/src/components/SavedSpaces/index.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>.
    • 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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

coderabbitai[bot] avatar Mar 26 '24 22:03 coderabbitai[bot]

Codecov Report

Attention: Patch coverage is 9.89583% with 519 lines in your changes are missing coverage. Please review.

Project coverage is 15.68%. Comparing base (04344ae) to head (0f7819e). Report is 14 commits behind head on develop.

:exclamation: Current head 0f7819e differs from pull request most recent head 1fbe568. Consider uploading reports for the commit 1fbe568 to get more accurate results

Files Patch % Lines
...ckages/spaces/src/components/SavedSpaces/index.tsx 0.00% 159 Missing :warning:
...ces/src/components/SavedSpaces/WorkspaceEditor.tsx 0.00% 130 Missing :warning:
...s/spaces/src/components/SavedSpaces/SavedSpace.tsx 0.00% 73 Missing :warning:
...ackages/spaces/src/components/SavedSpaces/hooks.ts 0.00% 40 Missing :warning:
...ackages/components/src/components/Dialog/index.tsx 31.91% 32 Missing :warning:
app/packages/spaces/src/state.ts 0.00% 22 Missing :warning:
...ackages/components/src/components/Popout/index.tsx 19.04% 17 Missing :warning:
...ages/components/src/components/TextField/index.tsx 34.61% 17 Missing :warning:
app/packages/operators/src/built-in-operators.ts 0.00% 17 Missing :warning:
.../components/src/components/Selection/Selection.tsx 27.27% 8 Missing :warning:
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #4205       +/-   ##
============================================
- Coverage    28.22%   15.68%   -12.54%     
============================================
  Files          814      786       -28     
  Lines       101898    87211    -14687     
  Branches      1215     1219        +4     
============================================
- Hits         28761    13681    -15080     
- Misses       73137    73530      +393     
Flag Coverage Δ
app 15.68% <9.89%> (-0.06%) :arrow_down:
python ?

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 26 '24 22:03 codecov[bot]

Converting to draft. Based on offline discussion, design needs some more work.

imanjra avatar Mar 28 '24 00:03 imanjra

Also, wondering if there is any opportunity to reuse the React components from Saved Views?

Yah, I do want to consolidate and share some more components (some are shared already) with saved view. However, it will require some refactor for saved view impl. I will do the refactor/cleanup in a follow-up PR instead.

imanjra avatar Apr 15 '24 14:04 imanjra

For completeness, I believe some permission handling might need to be added similar to saved views, .i.e. usage of canEditSavedViews atom? I just pushed an equivalent canEditWorkspaces atom. Can discuss more offline

Nice! Thanks! I'll integrate perms before merge

imanjra avatar Apr 15 '24 14:04 imanjra