Vanessa/2885 workspace side notification#3371
Conversation
4f494fb to
a47e550
Compare
e36d65b to
5d7f524
Compare
5d7f524 to
dc473e8
Compare
1af4d29 to
0050a8b
Compare
0050a8b to
64c925d
Compare
bdfranck
left a comment
There was a problem hiding this comment.
Looking great, @vanessatran-ddi! I left a couple comments on some minor things that I noticed.
libs/web-components/src/components/work-side-menu/WorkSideMenuItem.svelte
Show resolved
Hide resolved
libs/web-components/src/components/work-side-menu/WorkSideMenuItem.svelte
Show resolved
Hide resolved
ab29b50 to
9eebfc2
Compare
9eebfc2 to
89baa08
Compare
89baa08 to
762d405
Compare
|
I press a wrong button |
| export let ml: Spacing = null; | ||
|
|
||
| export let minWidth: string = ""; | ||
| export let justifyContent: string = ""; |
There was a problem hiding this comment.
There could be a type that is created for these css values, both here and in the React/Angular components to make things clearer.
6f03cf9 to
8d19761
Compare
| }); | ||
|
|
||
| describe("Desktop viewport", () => { | ||
| it("should open notification panel in a popover", async () => { |
There was a problem hiding this comment.
On Firefox this test will fail.
I tested on Firefox manually and here is how notification popover behaves
Firefox version: 145.0.2 (aarch64)
It is related to this issue #3540 (so not related to this PR)
b3014dd to
b4dfa29
Compare
| describe("Desktop viewport", () => { | ||
| // CSS anchor positioning is not supported in Firefox/Safari 18 (see #3540) | ||
| const isFirefox = navigator.userAgent.includes("Firefox"); | ||
| it.skipIf(isFirefox)("should open notification panel in a popover", async () => { |
There was a problem hiding this comment.
On Firefox this test will fail.
I tested on Firefox manually and here is how notification popover behaves
Firefox version: 145.0.2 (aarch64)
It is related to this issue https://github.com//issues/3540 (so not related to this PR)
I also left a comment on slack
| // (MenuButton, AppHeader, AppHeaderMenu, Dropdown) | ||
| if (_isOpen) { | ||
| dispatch(_rootEl, "_open"); | ||
| dispatch(_rootEl, "_open", {}, { bubbles: true }); |
005b533 to
4bda9dd
Compare
libs/web-components/src/components/work-side-menu/WorkSideNotificationPanel.svelte
Show resolved
Hide resolved
| _updateDateHeadersTimeout = performOnce( | ||
| _updateDateHeadersTimeout, | ||
| updateDateHeaders, | ||
| 1, |
There was a problem hiding this comment.
But is there a reason? 1ms is pretty small and if one event is greater than this it will then fire more than once. The reason why 100 was used was to hopefully guarantee everything works. Was the 99ms noticeably slow?
| export let leadingicon: GoAIconType; | ||
| /** Icon displayed after the button text. */ | ||
| export let trailingicon: GoAIconType; | ||
| export let disabled: string = "false"; |
There was a problem hiding this comment.
Is there a reason this is a string rather than boolean? Now that we can define the props in the svelte:options there is no need to use strings and the toBoolean function.
| /** Action identifier passed in click events for event delegation patterns. */ | ||
| export let action: string = ""; | ||
| /** Single argument value passed with the action in click events. */ | ||
| export let actionArg: string = ""; | ||
| /** Multiple argument values passed with the action in click events. */ | ||
| export let actionArgs: Record<string, unknown> = {}; |
There was a problem hiding this comment.
Is there a reason the props are being moved around? It is adding to the number of changed lines.
| _rootEl.removeEventListener("_blurItem", hideTooltip); | ||
| _rootEl.removeEventListener("_toggle", toggleMenu); | ||
| _rootEl.removeEventListener( | ||
| "_desktopPopoverOpen", | ||
| onDesktopPopoverOpen as EventListener, | ||
| ); | ||
| _rootEl.removeEventListener("_desktopPopoverClose", onDesktopPopoverClose); | ||
| _rootEl.removeEventListener("keydown", handleMenuKeyDown); |
There was a problem hiding this comment.
none of the rootEl removeEventListeners are needed as they will be removed when the element is removed from the DOM
| /** Sets a data-testid attribute for automated testing. */ | ||
| export let testid: string = "drawer"; | ||
| /** Controls visibility of the close button and header. */ | ||
| export let closeButton: "show" | "none" = "show"; |
There was a problem hiding this comment.
This property name is a little vague. closeButtonVisibility would make more sense.
| const panel = result.getByTestId("work-space-side-notification-panel"); | ||
| expect(panel).toBeTruthy(); |
There was a problem hiding this comment.
I am pretty sure this has been mentioned before, but the getBy.. functions always return a Locator object, which is always truthy, so there is no need to run the assertion on line 267. These locators should be declared closer to the top of the function if possible. And all locators should not be within a waitFor block otherwise it defeats the purpose of the waitFor.
There was a problem hiding this comment.
Hi @chrisolsen I may miss this as this PR was created almost 2 months ago.. I will check on this browser test file again.
There was a problem hiding this comment.
here too and the others in these changes
There was a problem hiding this comment.
Let me try again, I thought after markAllBtn.click at line 315, we should safely query after waitFor
There was a problem hiding this comment.
The locators don't have to be created when something is visible.
175c337 to
c07965a
Compare
| /** Sets a data-testid attribute for automated testing. */ | ||
| export let testid: string = "drawer"; | ||
| /** Controls visibility of the close button and header. */ | ||
| export let closeButtonVisibility: "show" | "none" = "show"; |
There was a problem hiding this comment.
For consistency with the other components that have a visibility property, instead of show|none use "visible" | "hidden". I missed this the first time 😞
c07965a to
57d7f17
Compare

Before (the change)
After (the change)
I also added the docs:

Desktop:

When menu is collapsed:

For mobile:

For any slot content (not only notification case)

Make sure that you've checked the boxes below before you submit the PR
Steps needed to test