Skip to content

[PB-5662] feat: favorite toggle from toolbar - #2043

Open
victor-ferro wants to merge 6 commits into
PB-5661-favorite-togglefrom
PB-5662-toolbar-favorite
Open

[PB-5662] feat: favorite toggle from toolbar#2043
victor-ferro wants to merge 6 commits into
PB-5661-favorite-togglefrom
PB-5662-toolbar-favorite

Conversation

@victor-ferro

@victor-ferro victor-ferro commented Jul 14, 2026

Copy link
Copy Markdown

Description

  • New favorite button in DriveTopBarActions, between Download and Move to trash, following the toolbar's existing button pattern
  • Shows a star ("Add to Favorites") when no selected item is favorited, a crossed-out star ("Remove from Favorites") when all of them are, and is hidden on mixed selections
  • Clicking dispatches the existing toggleFavoriteThunk from PB-5661
  • Show/hide/state decision extracted to a pure helper getFavoriteToolbarAction ('add' | 'remove' | null), unit-tested — same precedent as getListHeaders.ts

Related Issues

Relates to PB-5662

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

  • yarn vitest run src/views/Drive src/views/Favorites — 16 files, 83 tests passing (against linked SDK), including the 7 getFavoriteToolbarAction tests
  • ESLint and prettier clean on all touched files
  • Manual testing against the real backend: single selection (add/remove), uniform multi selection, mixed selection (button hidden), immediate icon/tooltip switch after toggling

Additional Notes

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 25461d5
Status: ✅  Deploy successful!
Preview URL: https://41d02072.drive-web.pages.dev
Branch Preview URL: https://pb-5662-toolbar-favorite.drive-web.pages.dev

View logs

@larryrider

Copy link
Copy Markdown
Contributor

hey! here at drive-web we use the PR template from https://github.com/internxt/drive-web/blob/master/.github/pull_request_template.md

Please use it for every PR so we are all aligned. If you think it could be improved or something should be changed, feel free to submit a separate PR for that as well!

@victor-ferro

Link,
Rows,
SquaresFour,
Star,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this import is deprecated, use 'StarIcon' instead

nit: you can also fix the rest of the deprecated imports if you want, its basically just adding 'Icon' at the end

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I noticed this too late and corrected it in a subsequent PR

const buildItem = (isFavorite?: boolean): DriveItemData => ({ uuid: 'uuid', isFavorite }) as DriveItemData;

describe('getFavoriteToolbarAction', () => {
it('should return null when no items are selected', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we are trying to use test('when... then...) instead of it('should...) for the tests

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Perfect, I'll adjust this one and the rest of the PRs to meet this

@victor-ferro victor-ferro self-assigned this Jul 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants