Skip to content

Conversation

@MichaelSun48
Copy link
Contributor

This PR creates the <DraggableTabs/> component along with many supporting components. It utilizes the new tab variant recently introduced, and adds support for reordering them via dragging (implemented w/ Framer motion).

This PR contains a subset of changes from a previous PR that contained a lot of new changes to the draggable tabs component, and it will be the first in a series of PRs that break up that PR into smaller chunks. This PR should be the largest of them all, since it creates all of the draggable tabs components. I have tried to pare the old PR down to only contain the changes necessary to get the draggable tabs to be actually draggable (using Framer motion), but please feel free to comment on anything that looks like it may be an artifact of these changes.

Known issues in this current implementation that will be fixed in subsequent PRs:

  • There are no tests for this component
  • Overflow tabs interact with the tab dividers very weirdly
  • Tab names wrap very weirdly
Screen.Recording.2024-07-25.at.2.52.52.PM.mov

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 25, 2024
@codecov
Copy link

codecov bot commented Jul 25, 2024

Bundle Report

Changes will increase total bundle size by 31.96kB ⬆️

Bundle name Size Change
app-webpack-bundle-array-push 28.42MB 31.96kB ⬆️

Comment on lines +5 to +10
export interface DraggableTabListItemProps extends ItemProps<any> {
key: string | number;
disabled?: boolean;
hidden?: boolean;
to?: LocationDescriptor;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is currently exactly the same as the current TabListItemProps, but there will eventually be new props added that are specific to the draggable version.

@MichaelSun48
Copy link
Contributor Author

MichaelSun48 commented Jul 25, 2024

Noticing some weird interactions between framer's default animations and the transform i'm applying, looking into it right now this seems like its caused by some screen resolution issue - changing the zoom fixes this.

Screen.Recording.2024-07-25.at.3.58.18.PM.mov

}
padding: ${space(0.5)} ${space(1)};
padding: ${space(0.75)} ${space(1.5)};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before:
image

After:
image

Copy link
Member

@malwilley malwilley left a comment

Choose a reason for hiding this comment

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

The tabs and drag functionality is looking really good!

</p>
<SizingWindow>
<TabBarContainer>
<DraggableTabBar
Copy link
Member

Choose a reason for hiding this comment

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

This is fine for now, but generally story files should only import from the component they are demo'ing. So we just need to make sure to come back to this later.

@MichaelSun48 MichaelSun48 merged commit e928219 into master Jul 26, 2024
@MichaelSun48 MichaelSun48 deleted the msun/addDraggableTabs branch July 26, 2024 22:21
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Views: Update dnd tabs component to match designs Custom Views: MVP for dnd tabs component

3 participants