Skip to content

feat: Support async loading in S2 TreeView #8528

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

Merged
merged 5 commits into from
Jul 11, 2025
Merged

feat: Support async loading in S2 TreeView #8528

merged 5 commits into from
Jul 11, 2025

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Jul 11, 2025

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@LFDanLu LFDanLu changed the base branch from main to multi_loader_support July 11, 2025 00:06
@rspbot
Copy link

rspbot commented Jul 11, 2025

Base automatically changed from multi_loader_support to main July 11, 2025 00:21
@LFDanLu LFDanLu force-pushed the RSP_S2_tree_loader branch from 0173b66 to 6faaa71 Compare July 11, 2025 00:37
@rspbot
Copy link

rspbot commented Jul 11, 2025

devongovett
devongovett previously approved these changes Jul 11, 2025
snowystinger
snowystinger previously approved these changes Jul 11, 2025
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

have you run chromatic on this?

@@ -66,6 +68,16 @@ const meta: Meta<typeof TreeView> = {
}
},
table: {category: 'Events'}
},
isDetached: {
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, got a bit confused here, the comments on those props made it sound like they weren't fully implemented yet but I see that its more that a combination of the two + selection isn't working. I'll add descriptions and add them back in

@LFDanLu LFDanLu dismissed stale reviews from snowystinger and devongovett via 67e5a85 July 11, 2025 17:00
@LFDanLu
Copy link
Member Author

LFDanLu commented Jul 11, 2025

@rspbot
Copy link

rspbot commented Jul 11, 2025

@rspbot
Copy link

rspbot commented Jul 11, 2025

## API Changes

react-aria-components

/react-aria-components:DragAndDropOptions

 DragAndDropOptions {
   acceptedDragTypes?: 'all' | Array<string | symbol> = 'all'
   dropTargetDelegate?: DropTargetDelegate
   getAllowedDropOperations?: () => Array<DropOperation>
   getDropOperation?: (DropTarget, DragTypes, Array<DropOperation>) => DropOperation
   getItems?: (Set<Key>) => Array<DragItem> = () => []
   isDisabled?: boolean
   onDragEnd?: (DraggableCollectionEndEvent) => void
   onDragMove?: (DraggableCollectionMoveEvent) => void
   onDragStart?: (DraggableCollectionStartEvent) => void
   onDrop?: (DroppableCollectionDropEvent) => void
   onDropActivate?: (DroppableCollectionActivateEvent) => void
   onDropEnter?: (DroppableCollectionEnterEvent) => void
   onDropExit?: (DroppableCollectionExitEvent) => void
   onInsert?: (DroppableCollectionInsertDropEvent) => void
   onItemDrop?: (DroppableCollectionOnItemDropEvent) => void
   onMove?: (DroppableCollectionReorderEvent) => void
   onReorder?: (DroppableCollectionReorderEvent) => void
   onRootDrop?: (DroppableCollectionRootDropEvent) => void
-  renderDragPreview?: (Array<DragItem>) => JSX.Element | {
-    element: JSX.Element
-  x: number
-  y: number
-}
+  renderDragPreview?: (Array<DragItem>) => JSX.Element
   renderDropIndicator?: (DropTarget, Set<Key>, Key) => JSX.Element
   shouldAcceptItemDrop?: (ItemDropTarget, DragTypes) => boolean
 }

@react-aria/dnd

/@react-aria/dnd:DragPreviewProps

 DragPreviewProps {
-  children: (Array<DragItem>) => JSX.Element | {
-    element: JSX.Element
-  x: number
-  y: number
-} | null
+  children: (Array<DragItem>) => JSX.Element | null
 }

/@react-aria/dnd:DragPreview

 DragPreview {
-  children: (Array<DragItem>) => JSX.Element | {
-    element: JSX.Element
-  x: number
-  y: number
-} | null
+  children: (Array<DragItem>) => JSX.Element | null
 }

@react-spectrum/s2

/@react-spectrum/s2:TreeViewLoadMoreItem

+TreeViewLoadMoreItem {
+  loadingState?: LoadingState
+  onLoadMore?: () => any
+}

/@react-spectrum/s2:TreeViewLoadMoreItemProps

+TreeViewLoadMoreItemProps {
+  loadingState?: LoadingState
+  onLoadMore?: () => any
+}

@LFDanLu LFDanLu added this pull request to the merge queue Jul 11, 2025
Merged via the queue into main with commit 5627d88 Jul 11, 2025
33 checks passed
@LFDanLu LFDanLu deleted the RSP_S2_tree_loader branch July 11, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants