Skip to content

feat(#3580): push drawer V2 styling and dynamic edge behavior#3578

Merged
chrisolsen merged 1 commit intodevfrom
tom/push-drawer-v2-styling
Mar 23, 2026
Merged

feat(#3580): push drawer V2 styling and dynamic edge behavior#3578
chrisolsen merged 1 commit intodevfrom
tom/push-drawer-v2-styling

Conversation

@twjeffery
Copy link
Collaborator

@twjeffery twjeffery commented Mar 14, 2026

Summary

  • V2 visual styling: heading-s, flex-based header/footer pinning, scroll-aware border + shadow indicators
  • Floating inset margin using --goa-drawer-offset token, border color greyscale-150
  • Dynamic edge transitions: visible edges get offset + rounded corners, scrolled edges go flush + square with 200ms ease transitions
  • 20px scroll hysteresis prevents jitter at boundaries
  • Heading shrinks from heading-s to heading-xs when top is flush (scrolled)
  • V1 rendering completely unchanged
  • Test page updated to app-shell layout matching real workspace usage

Closes #3580

Screen.Recording.2026-03-14.at.10.28.03.AM.mov

Test plan

  • npm run build passes
  • npm run test:pr passes
  • Open V2 push drawer in feat2469 test page, add content until it overflows
  • Scroll within drawer: header/footer pin, content scrolls between them
  • Verify dynamic edges: top floating at start, both flush in middle, bottom floating at end
  • Transitions are smooth, no jitter at scroll boundaries
  • V1 push drawer (bottom section) renders identically to before

@netlify
Copy link

netlify bot commented Mar 14, 2026

Deploy Preview for goa-design-2 ready!

Name Link
🔨 Latest commit 72b94bd
🔍 Latest deploy log https://app.netlify.com/projects/goa-design-2/deploys/69bc236d6dc4a9000705f73e
😎 Deploy Preview https://deploy-preview-3578--goa-design-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@twjeffery twjeffery changed the title feat(#2469): push drawer V2 styling and dynamic edge behavior feat(#3580): push drawer V2 styling and dynamic edge behavior Mar 14, 2026
@twjeffery twjeffery linked an issue Mar 14, 2026 that may be closed by this pull request
@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch from 28c6d4a to 062c758 Compare March 14, 2026 16:26
@twjeffery twjeffery force-pushed the tom/push-drawer-wrappers branch from 24310ae to 61d1535 Compare March 14, 2026 17:32
@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch from 062c758 to 117cb7e Compare March 14, 2026 17:32
@twjeffery twjeffery force-pushed the tom/push-drawer-wrappers branch from 61d1535 to 4a603de Compare March 14, 2026 18:31
@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch from 117cb7e to 03acc1a Compare March 14, 2026 18:31
@twjeffery twjeffery requested a review from ArakTaiRoth March 14, 2026 18:40
@twjeffery twjeffery force-pushed the tom/push-drawer-wrappers branch from 4a603de to a452848 Compare March 17, 2026 17:44
@twjeffery twjeffery force-pushed the tom/push-drawer-wrappers branch 3 times, most recently from 045dee9 to 8681365 Compare March 18, 2026 16:27
Base automatically changed from tom/push-drawer-wrappers to dev March 18, 2026 18:56
@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch 3 times, most recently from 87a4bf7 to 72b94bd Compare March 19, 2026 16:25
@twjeffery twjeffery requested a review from ArakTaiRoth March 19, 2026 17:45
@Spark450 Spark450 added the P3 Priority 3 (nice to have): Valuable, but safe to release after launch. label Mar 19, 2026
@ArakTaiRoth ArakTaiRoth requested a review from chrisolsen March 19, 2026 19:49
if (target.scrollTop == 0) {
_scrollPos = "top";
} else if (
Math.abs(target.scrollHeight - target.scrollTop - target.offsetHeight) <
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice to have a declared var here to know the expression represents.

export let heading: string = "";
export let width: string = "492px";
export let version: string | undefined = undefined;
type VersionType = "1" | "2";
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is nice to keep type declarations together. They should be below the import statements to follow the convention used throughout the code.

export let width: string = "492px";
export let version: string | undefined = undefined;
type VersionType = "1" | "2";
const [Version, validateVersion] = typeValidator("Version", ["1", "2"]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this const out lf all the export statements.

async function checkActionsSlotContent() {
await tick();
_actionsSlotHasContent = !!$$slots.actions;
function checkActionsSlotContent() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function should be moved into where the other functions are (I can see that it was here to start with though)

Could you also move the let statements above to line ~28, where the other lets are.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This function just needs to be moved down after the reactive $: blocks..we can leave it for now.

});

const drawer = result.getByTestId("test-drawer");
expect(drawer).toHaveClass("v2");
Copy link
Collaborator

Choose a reason for hiding this comment

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

To better ensure the tests pass, like some of the other tests in this file, the expect should be wrapped in a waitFor, the same is true for line :161

@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch from 72b94bd to f18ff47 Compare March 23, 2026 15:22
@twjeffery
Copy link
Collaborator Author

@chrisolsen Addressed all the feedback. Grouped types, moved the const and lets, added named variables for the scroll checks, and wrapped the test assertions in waitFor. Ready for another look when you get a chance.

@twjeffery twjeffery requested a review from chrisolsen March 23, 2026 15:27
async function checkActionsSlotContent() {
await tick();
_actionsSlotHasContent = !!$$slots.actions;
function checkActionsSlotContent() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function just needs to be moved down after the reactive $: blocks..we can leave it for now.


// Hysteresis threshold: prevents jitter when dynamic edge margin/height
// changes shift the scroll position slightly at boundaries.
const SCROLL_HYSTERESIS = 20;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having a component level constant that is only used within one function makes more sense to just move this constant into the function, otherwise I am looking around for where else it is used, as with the other comment this can be left as is for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah ok, good to know. Thanks.

V2 visual updates for PushDrawerInternal:
- Heading-s (shrinks to heading-xs on scroll)
- Flex-based header/footer pinning with scroll-aware borders and shadows
- Floating inset margin using --goa-drawer-offset token
- Border color greyscale-150
- Dynamic edge transitions: visible edges get offset + rounded corners,
  scrolled edges go flush + square. 200ms ease transitions.
- 20px scroll hysteresis prevents jitter at boundaries
- Version prop validated with typeValidator matching Drawer.svelte
- V2 unit tests added (5 tests)
- Empty actions detection via slot assignedElements
- Conditional actions span wrapper in PushDrawer.svelte
- V1 rendering completely unchanged

Test page updated to app-shell layout matching real-world usage.
@twjeffery twjeffery force-pushed the tom/push-drawer-v2-styling branch from f18ff47 to dd3d498 Compare March 23, 2026 19:48
@twjeffery
Copy link
Collaborator Author

@chrisolsen conflicts resolved now, ready to merge

@chrisolsen chrisolsen merged commit 7024815 into dev Mar 23, 2026
4 checks passed
@chrisolsen chrisolsen deleted the tom/push-drawer-v2-styling branch March 23, 2026 19:58
@chrisolsen
Copy link
Collaborator

🎉 This PR is included in version 1.41.0-dev.24 🎉

The release is available on:

Your semantic-release bot 📦🚀

@chrisolsen
Copy link
Collaborator

🎉 This PR is included in version 1.11.0-dev.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@chrisolsen
Copy link
Collaborator

🎉 This PR is included in version 6.11.0-dev.16 🎉

The release is available on:

Your semantic-release bot 📦🚀

@chrisolsen
Copy link
Collaborator

🎉 This PR is included in version 4.11.0-dev.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Priority 3 (nice to have): Valuable, but safe to release after launch. released on @dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push drawer V2 styling and dynamic edge behavior

4 participants