pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Unable to "Render Panel" when the host pattern doesn't match

Open fregante opened this issue 2 years ago • 4 comments

Describe the bug

This is more of a UX issue rather than a bug. The user can make changes to side panels regardless of the current page, but "Render Panel" and "Auto-render" don't do anything. This can cause confusion until/unless they realize the current page doesn't match.

To Reproduce

Steps to reproduce the behavior:

  1. Create side panel for https://pbx.vercel.app/
  2. Visit https://example.com
  3. Click "Render Panel" in Page Editor

Actual behavior

It opens the sidebar, but then nothing appears

Expected behavior

  • Hide "auto-render"?
  • When clicking "Render Panel", Show notifications in page editor regarding unavailability

Screenshots/Loom

Screenshot 4

fregante avatar Jan 19 '24 09:01 fregante

@BLoe I'd like to get your opinion on the Expected Behavior

grahamlangford avatar Jan 27 '24 18:01 grahamlangford

I discussed this with Mark and Britt. I think we should NOT show the panel, but SHOULD have a pop-up or other warning indicator to inform the mod builder that the panel wasn't shown due to URL mismatch. The reason (from Mark) for not showing the panel is that some functionality like API calls or page scraping could fail or perform unexpected behavior in the case where the URL doesn't match. But we still want to make it totally clear to the mod builder why the button/switch is not rendering the sidebar panel.

I think it could make sense to have the warning behavior attached to the button, and remove the auto-render switch in this case, but don't have strong feelings there. Auto-render could just as easily show the same warning, although there are probably some use-cases where this would cause too much spam, but that could also be avoided by having a long debounce/throttle effect on the warning indicator.

BLoe avatar Jan 29 '24 18:01 BLoe

The reason (from Mark) for not showing the panel is that some functionality like API calls or page scraping could fail or perform unexpected behavior in the case where the URL doesn't match

💯

twschiller avatar Jan 29 '24 18:01 twschiller

Removing from MV3/Sidebar Epics because this is manifest-independent

twschiller avatar Mar 30 '24 15:03 twschiller