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

feat: add a link to open a cloned folder in a notification #2497

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Jun 28, 2024

TL;DR

Adds a feature that utilizes a link to open the folder explorer directly from a notification.

What changed?

  • Updated BAINotificationItem component to use notification.toText property before falling back to other properties.
  • Adjusted FolderExplorerOpener to watch both isDataViewReady and folderId states.
  • Modified ModelCloneModal component to include new properties in mutation response and make use of them.
  • Extended NotificationState interface to include toText property.
  • Enhanced BackendAIData to handle folder explorers for different tabs.
  • Refactored folder explorer opening logic in BackendAiStorageList and introduced two new methods: triggerOpenFilebrowserToReact and triggerCloseFilebrowserToReact.

How to test?

  1. Clone folder in the Model store page.
  2. Check if the clone result notification includes a link to open the folder explorer.
  3. Ensure the link accurately directs to the correct folder based on different tabs.
  4. Verify state updates and component behavior in FolderExplorerOpener and ModelCloneModal.

Why make this change?

To enhance user experience by providing direct access to folder explorers from notifications, streamlining the workflow and reducing the number of clicks needed to navigate to a folder.


Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Jun 28, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

yomybaby commented Jun 28, 2024

@github-actions github-actions bot added the size:M 30~100 LoC label Jun 28, 2024
@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from c96ee79 to baf0fab Compare June 28, 2024 07:13
@yomybaby yomybaby marked this pull request as ready for review June 28, 2024 07:13
@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from baf0fab to 927f442 Compare June 28, 2024 08:24
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine. LGTM!

@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from 927f442 to 5dfbc43 Compare July 1, 2024 03:01
Copy link

graphite-app bot commented Jul 1, 2024

Merge activity

@ironAiken2 ironAiken2 changed the base branch from feature/model-store-clone to main July 1, 2024 03:06
@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from 5dfbc43 to a027af3 Compare July 1, 2024 03:15
Copy link

github-actions bot commented Jul 1, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 2.75% 141/5122
🔴 Branches 2.95% 101/3428
🔴 Functions 1.59% 27/1699
🔴 Lines 2.63% 132/5025

Test suite run success

51 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from 1057197

@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from a027af3 to 9f03aad Compare July 1, 2024 07:23
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Jul 1, 2024
### TL;DR
Adds a feature that utilizes a link to open the folder explorer directly from a notification.

### What changed?
- Updated `BAINotificationItem` component to use `notification.toText` property before falling back to other properties.
- Adjusted `FolderExplorerOpener` to watch both `isDataViewReady` and `folderId` states.
- Modified `ModelCloneModal` component to include new properties in mutation response and make use of them.
- Extended `NotificationState` interface to include `toText` property.
- Enhanced `BackendAIData` to handle folder explorers for different tabs.
- Refactored folder explorer opening logic in `BackendAiStorageList` and introduced two new methods: `triggerOpenFilebrowserToReact` and `triggerCloseFilebrowserToReact`.

### How to test?
1. Clone folder in the Model store page.
2. Check if the clone result notification includes a link to open the folder explorer.
3. Ensure the link accurately directs to the correct folder based on different tabs.
4. Verify state updates and component behavior in `FolderExplorerOpener` and `ModelCloneModal`.

### Why make this change?
To enhance user experience by providing direct access to folder explorers from notifications, streamlining the workflow and reducing the number of clicks needed to navigate to a folder.

---

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
-->

**Checklist:** (if applicable)

- [ ] Mention to the original issue
- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@yomybaby yomybaby force-pushed the feature/cloned-folder-open-link branch from 9f03aad to 1057197 Compare July 1, 2024 07:25
@graphite-app graphite-app bot merged commit 1057197 into main Jul 1, 2024
5 checks passed
@graphite-app graphite-app bot deleted the feature/cloned-folder-open-link branch July 1, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants