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

Sheets #51

Draft
wants to merge 86 commits into
base: develop
Choose a base branch
from
Draft

Sheets #51

wants to merge 86 commits into from

Conversation

JayPanoz
Copy link
Contributor

@JayPanoz JayPanoz commented Dec 20, 2024

This PR takes care of #12, so expect things to change dramatically while this is in Draft as we’ll have to build custom components to implement all types listed in the issue. Due to holidays, things should move a little bit slower though.

At this stage, focus was on #41 and #47 in order to init things.

At the time of drafting, the following has been worked on to build the foundations of this epic:

  • PopoverSheet and FullscreenSheet components – which are currently more like templates to help test other things listed, hence minimal styling, etc.;
  • SheetWithBreakpoints component that should help pick the type of sheet based on the static breakpoints set in Preferences;
  • new Reading System preferences for actions:
    • default type of sheet for all actions;
    • can be overridden in each Action’s object, either with a single type, or for each breakpoint.

To illustrate/test the SheetWithBreakpoints component, Settings is using fullscreen in compact and medium, then popover (default) from expanded.

Alias for deploy to latest commit: sheets.playground-7xz.pages.dev

Takes the number of items per row to infer which one to select and focus, but it pretty much overrides the React Aria component default so things may be missing currently, it has to be stress-tested a11y-wise.
This is stolen by themes anyway, but opens a can of worms as themes will steal the focus as a side effect of opening settings, even if it’s not the first section in the sheet.
You can set a default for all actions, then override it either for all breakpoints, or per breakpoint for each action
For RSPrefs, as their name is tied to this key, so using the prop directly could cause issues further down the line.
Copy link

cloudflare-workers-and-pages bot commented Dec 20, 2024

Deploying playground with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0c1b6c2
Status: ✅  Deploy successful!
Preview URL: https://0d9a6947.playground-7xz.pages.dev
Branch Preview URL: https://sheets.playground-7xz.pages.dev

View logs

@JayPanoz
Copy link
Contributor Author

@bluefirepatrick thanks for the review. And sorry for the lack of commits in the last days as I've been neck-deep in redesigning docked sheets so that:

  1. They can be docked by default for an action through preferences;
  2. They can be resized using a draggable element.

While implementing resizability it became clear the current approach based on positioning couldn't perform well. And to be honest it also creates unnecessary complexity to handle the preference.

Hopefully I should have something better by the start of next week.

Docking is now handled in reducers, with global states, and less complexity.

Panels are now collapsible as a side effect of React portal requiring a DOM element to render the docked sheet.

Docking is now direction-agnostic and takes RTL into account
Several issues to fix though, including arrows on hover + tap/click and immersive mode set to false
Yeah so no, given the current status of this project, and what exists for React web, there’s not much else to do than creating our own component. Sigh.
So that it’s easier for components to know what’s open and docked.
+ OverflowMenu was a global state for all overflow menus. Now they are handled as their own object.
Except NextJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants