Skip to content

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Jun 13, 2024

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:

RSP

@rspbot
Copy link

rspbot commented Jun 14, 2024

@rspbot
Copy link

rspbot commented Jun 17, 2024

@LFDanLu LFDanLu force-pushed the load_more_api_rac branch from 14591db to afd554c Compare June 21, 2024 00:01
@LFDanLu LFDanLu marked this pull request as ready for review June 21, 2024 19:01
@rspbot
Copy link

rspbot commented Jun 21, 2024

@rspbot
Copy link

rspbot commented Jun 21, 2024

@rspbot
Copy link

rspbot commented Jun 21, 2024

@rspbot
Copy link

rspbot commented Jun 21, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@react-aria/loading

useLoadOnScroll

changed by:

  • LoadOnScrollProps
-
+useLoadOnScroll {
+  props: LoadOnScrollProps
+  ref: RefObject<HTMLElement | null>
+  returnVal: undefined
+}

LoadOnScrollProps

-
+LoadOnScrollProps {
+  isLoading?: boolean
+  onLoadMore?: () => void
+  scrollOffset?: number = 25
+}

it changed:

  • useLoadOnScroll

@LFDanLu LFDanLu changed the title (WIP) useLoadMore support in RAC Table useLoadMore support in RAC Table Jun 21, 2024
@LFDanLu
Copy link
Member Author

LFDanLu commented Jun 21, 2024

going to unify the branches so there is only one PR to review

@LFDanLu LFDanLu merged commit ea1a1f5 into load_more_rac Jun 21, 2024
@LFDanLu LFDanLu deleted the load_more_api_rac branch June 21, 2024 20:20
LFDanLu added a commit that referenced this pull request Jul 15, 2024
* rough approach for having user provide loading element to rac collection element

* bare minimum for table loader support

* add first and last row/cell data-attributes

* updating collection to auto propagate dependencies and debugging example stories

* adding stories for empty state + loading variations in tree and table

* updating verdaccio to not crash on newer macbooks

* rip out first/last row and fix lint

* add TableLoader to index so that I can test in s2

* add isTableEmpty and colspan for table loader

also some debugging of crashes

* add renderProps to loader

* omit loader from the collection size in table

* fix bugs with keyboard navigation and load more in table

* Fix Tree keyboard nav issues and add tests

* fix keyboard nav with loaders via keyboard delegate item filtering logic

it makes more sense for the keyboard delegate to handle what keys should be returned on up/down/pageUp/etc

* clean up and use hook for loader row attributes

* refactor so that empty load more is expected to be a part of renderEmptyState

* useLoadMore support in RAC Table (#6538)

* initial implementation of load more hook

* initial stab at scrollable body table

* fix lint and readd content height change check

* update attributes and test virtualizer + loadmore

* remove option in prep for fix

* fix for loadMore and update virtualized RAC table stories

* get rid of loaderHeight option

* move hook to separate package

* add tests

* fix some stuff from rebase

* fix test for 16/17

* refactor useLoadOnScroll so it can replace useVirtualizer internals

* inconsistent 19 test is fixed now

* fix another 19 test

* fix crash when dragging over loading spinner

* only render loadmore spinner in dnd table if there are items

* get rid of todo now that layout has been refactored

* move logic to render after drop indicator when row is before logic into Collection

* move useLoadMore to util package for now

punting refactor and removal of virtualizer to later see note

* pull loadmore hook out of rac table

* rename loader collection element and update layout for variable loader height

* forgot to remove deps

* fix esm test?

* update useloadmore logic and replace useVirtualizer internals

note this removes the "wasLoading || ref.current.scrollHeight !== lastContentSize.current" portion of the logic. Previously useVirtualizer onVisibleRectChange was the one that would handle loading more items if opening a combobox dropdown during/after initial load, not the layouteffect. However, now that that is replaced by useLoadMore onScroll handler, we need the layouteffect to handle that

* remove useVirtualizer

* fix tests

* fix erroneous conditional hooks call

was causing a different order of hooks calls when a table with renderEmptyState went from empty to having a rows

* review comments and updating Tree loader naming for consistency

* dont apply width directly on columnheader if virtualizer

fix for S2, the wrapper around the columnheader already has the calculated width applied on it so we dont need it on the columnheader as well. This makes padding values applied on the columnheader take up room from current width instead of making the columnheader extra wide

* fix lint

* add items check to useLoadMore

interim fix to prevent some extra onLoadMore calls. RAC will eventually make use of the collection when the hook is moved inside the component whereas RSP table cant benefit from this since its collection is always rebuilt and thus non stable. Items are also provided to the TableBody and cant be accessed from with tablevirtualizer

* add display contents and debug sticky loader

* clean up from review

* test and story updates from review comments

---------

Co-authored-by: Devon Govett <devongovett@gmail.com>
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.

2 participants