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

Widget Customizer Overhaul #1674

Merged
merged 43 commits into from
Jan 30, 2025
Merged

Widget Customizer Overhaul #1674

merged 43 commits into from
Jan 30, 2025

Conversation

EricBAndrews
Copy link
Member

@EricBAndrews EricBAndrews commented Jan 28, 2025

Note

Per Slack, the final design will have a curated list of widgets that can be customized through a sheet. I'm saving that for a later PR, since this one is already quite large.

Description

Visual overhaul of the widget customizer:

Screen.Recording.2025-01-28.at.3.28.00.PM.mov

Implementation Notes

Most of the logic should be familiar, but I have made two key changes:

  • Created the BarItem struct. This represents an item on the bar, but has a uuid that is detached from the actual Configuration.Item it represents. This serves as a view identifier in the core ForEach(Array(barItems.enumerated)) that renders the interaction bar, resolving some animation misbehavior due to index-based identity. It also contains some members to help drive animations.
  • Hovered drop location is now detected by the bar items, not the drop indicators. This enables the drop hover hitbox to adapt to the width of the bar item rather than span a fixed width from the drop indicator.

Other implementation details of note:

  • When items are added to the bar, they animate their width to default in an onAppear handler. This prevents bad animation behavior stemming from the combination of array insertion and animation without requiring a deliberate delay.
  • BarItem tracks ancestor, which is an optional BarItem. If ancestor is present, the onAppear handler will animate the ancestor away. This allows smooth animations when moving items on the bar.
  • Haptics are now played by the drop indicators in an onAppear, letting us piggyback on the drop indicator display logic to handle haptics
  • Added MockTextView
  • Fixed barIconPadding (was 4.24, is now 4.25)

@EricBAndrews EricBAndrews requested a review from a team as a code owner January 28, 2025 21:00
@EricBAndrews EricBAndrews requested review from Sjmarf and removed request for a team January 28, 2025 21:00
Copy link
Member

@Sjmarf Sjmarf left a comment

Choose a reason for hiding this comment

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

Nice, this is a cool design :)

On smaller-screened devices, not everything fits:

This could be fixed by hiding the header on small screens, maybe.

Also, it takes a small amount of time for the interaction bar widget to appear after dropping it back in the tray. I wonder how easy that is to fix?

EricBAndrews and others added 8 commits January 28, 2025 16:38
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
Co-authored-by: Sjmarf <[email protected]>
@EricBAndrews
Copy link
Member Author

Removing the header image solves the space issues all the way down to the Xs, though the SE is still a tiny bit crunched--the follow-up PR that hides the uncommon actions should handle that case.

Screenshot 2025-01-29 at 12 20 07 PM Screenshot 2025-01-29 at 12 22 00 PM

I've also fixed the tray item reappearance delay.

@EricBAndrews EricBAndrews requested a review from Sjmarf January 29, 2025 18:32
Copy link
Member

@Sjmarf Sjmarf left a comment

Choose a reason for hiding this comment

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

Nice 🔥

A few more dark mode fixes

EricBAndrews and others added 6 commits January 29, 2025 20:49
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
Co-authored-by: Sjmarf <[email protected]>
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
…tionBarEditorView+Views.swift

Co-authored-by: Sjmarf <[email protected]>
@EricBAndrews EricBAndrews merged commit 89ebdef into dev Jan 30, 2025
2 checks passed
@EricBAndrews EricBAndrews deleted the eric/widget-customizer branch January 30, 2025 03:29
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.

None yet

2 participants