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

Add experimental enableFullWidthScroll Grid feature #3517

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

ghsolomon
Copy link
Contributor

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry, or determined not required.
  • Reviewed for breaking changes, added breaking-change label + CHANGELOG if so.
  • Updated doc comments / prop-types, or determined not required.
  • Reviewed and tested on Mobile, or determined not required.
  • Created Toolbox branch / PR, or determined not required.

If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to
collapse multiple intermediate commits into a single commit representing the overall feature
change. This helps keep the commit log clean and easy to scan across releases. PRs containing a
single commit should be rebased when possible.

cmp/grid/Grid.ts Outdated

private viewportResizeObserver: ResizeObserver;

@computed
Copy link
Member

Choose a reason for hiding this comment

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

why is this computed? don't think we expect this to change, be observable, or be expensive to check

cmp/grid/Grid.ts Outdated
override afterLinked() {
if (!this.isFullWidthScrollEnabled) return;
this.addReaction({
track: () => this.model.isReady,
Copy link
Member

Choose a reason for hiding this comment

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

should this just be a when:()

cmp/grid/Grid.ts Outdated
...getLayoutProps(props),
...impl.agOptions
}),
div({
Copy link
Member

Choose a reason for hiding this comment

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

I would make this its own HoistComponent to avoid extra re-rendering whenever the scrollbar calcs need to change. ALSO, weird that the (experimental) scrollbar dominates the render method the way it does now.

Ideally put all the state for this in a dedicated GridScrollBarModel/GridScrollBar pair in their own files.

Copy link
Member

Choose a reason for hiding this comment

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

Especially nice to have these split out while this is experimental, but also will be useful even if this becomes built-in

@lbwexler
Copy link
Member

lbwexler commented Nov 6, 2023

Greg and I reviewed this and he has just a few tweaks to make. Hoping to merge this tomorrow! 👍🏻

cmp/grid/Grid.ts Outdated
return fragment(
const container = model.experimental['enableFullWidthScroll'] ? vframe : frame;

return container(
Copy link
Member

Choose a reason for hiding this comment

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

Can we avoid the extra level of DOM nesting that this appears to introduce? Previously we were returning a fragment at the top level, with a frame and supporting colChooser/filter dialogs inside.

Could those dialogs be moved to nest within the frame/vframe items (alongside the agGrid) so we still have a single outer (v)frame?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that- actually didn't mean to change the outer fragment- this was in a bad state mid-refactor. Just updated the PR

@lbwexler lbwexler merged commit 5f87521 into develop Nov 7, 2023
2 checks passed
@lbwexler lbwexler deleted the gridFullWidthScroll branch November 7, 2023 18:49
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