Skip to content

Proposal for sidePanel lifecycle events. #779

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rishikramena-ms
Copy link

Creates a proposal for the extensions sidePanel API events which will cater to basic lifecycle events like onClosed and onOpened.

Added the remaining sections.
Updated schema:
- added PanelInfo
- Removed reasons

Removed un-asked use cases
Elaborated on the workarounds
Added points to the open discussions
Updated workarounds
Updated reasons in open discussions.
Moved content from future work to Open discussions.
@akornmeier
Copy link

Related issue: #693

@rishikramena-ms
Copy link
Author

Gentle reminder for reviews on this @Rob--W, @oliverdunk, @xeenon.

@carlosjeurissen carlosjeurissen added the topic: sidebar Discussions related to the sidebarAction and sidePanel APIs label Apr 24, 2025
}
}
```
- Would adding onHidden, onShown or onVisibilityChanged events for side panel extensions make sense too?
Copy link
Member

Choose a reason for hiding this comment

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

As discussed in the last meeting, I am waiting until there is more discussion in the proposal about this before doing a full review.

@hharshas
Copy link
Contributor

hharshas commented Jun 3, 2025

Hey! I have two questions about the current proposal:

  1. About the onClosed event:

// Fired when a sidePanel hosted by an extension is triggered to close.

The spec says this event is fired when a side panel is closed. But it’s not clear who will receive this event.

Can you confirm if this event is only sent to the extension that originally opened the side panel? It would be helpful if this behavior could be made clear in the spec.

  1. About the path property in the event:

// The path to the side panel HTML file in use.
DOMString path;

Is it necessary to include the path property in the event payload?

Since the extension itself sets the path when it opens the side panel, it can maintain the context internally and can track this information on its own. Also, there isn’t a standard pattern in other extension APIs where path is returned in event payloads, so this could introduce ambiguity.

@hharshas
Copy link
Contributor

Hi! Just a heads-up — we are currently working on a CL related to the SidePanel lifecycle.
Specifically, we have two CLs in progress:
onOpen
onClose

Let me know if you see any potential suggestions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: sidebar Discussions related to the sidebarAction and sidePanel APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants