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

DX - Refactor some of the sidebar frame function names to clarify behavior, and fix sidebar-sub-frame console error #8475

Merged
merged 7 commits into from
May 21, 2024

Conversation

BLoe
Copy link
Collaborator

@BLoe BLoe commented May 17, 2024

What does this PR do?

Checklist

  • Add jest or playwright tests and/or storybook stories
  • Designate a primary reviewer

@BLoe BLoe self-assigned this May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 40.74074% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 73.41%. Comparing base (6d95047) to head (41148d3).
Report is 80 commits behind head on main.

Files Patch % Lines
src/contrib/automationanywhere/aaFrameProtocol.ts 0.00% 7 Missing ⚠️
src/sidebar/connectedTarget.tsx 55.55% 4 Missing ⚠️
src/errors/contextInvalidated.ts 50.00% 1 Missing ⚠️
src/sidebar/ConnectedSidebar.tsx 0.00% 1 Missing ⚠️
src/tinyPages/RestrictedUrlPopupApp.tsx 50.00% 1 Missing ⚠️
src/utils/expectContext.ts 50.00% 1 Missing ⚠️
src/utils/sidePanelUtils.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8475      +/-   ##
==========================================
- Coverage   73.47%   73.41%   -0.07%     
==========================================
  Files        1334     1352      +18     
  Lines       41259    41579     +320     
  Branches     7686     7803     +117     
==========================================
+ Hits        30316    30526     +210     
- Misses      10943    11053     +110     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Playwright test results - MV2

passed  42 passed
flaky  2 flaky
skipped  12 skipped

Details

report  Open report ↗︎
stats  56 tests across 19 suites
duration  13 minutes, 11 seconds
commit  858f14c

Flaky tests

edgeSetup › auth.setup.ts › authenticate
chromeSetup › auth.setup.ts › authenticate

Skipped tests

chrome › tests/extensionConsoleActivation.spec.ts › can activate a mod with built-in integration
chrome › tests/extensionConsoleActivation.spec.ts › can activate a mod via url
edge › tests/extensionConsoleActivation.spec.ts › can activate a mod with built-in integration
edge › tests/extensionConsoleActivation.spec.ts › can activate a mod via url
chrome › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links from the sidebar doesn't crash browser
edge › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links from the sidebar doesn't crash browser
chrome › tests/runtime/sidebarController.spec.ts › sidebar controller › shows focus dialog in top-level frame
edge › tests/runtime/sidebarController.spec.ts › sidebar controller › shows focus dialog in top-level frame
chrome › tests/runtime/sidebarNavigation.spec.ts › sidebar mod panels are persistent during navigation
chrome › tests/runtime/sidebarNavigation.spec.ts › sidebar form and temporary panels are unavailable after navigation
edge › tests/runtime/sidebarNavigation.spec.ts › sidebar mod panels are persistent during navigation
edge › tests/runtime/sidebarNavigation.spec.ts › sidebar form and temporary panels are unavailable after navigation

Copy link

github-actions bot commented May 17, 2024

Playwright test results

passed  55 passed
flaky  1 flaky

Details

report  Open report ↗︎
stats  56 tests across 19 suites
duration  16 minutes, 31 seconds
commit  41148d3

Flaky tests

edge › tests/pageEditor/saveMod.spec.ts › can save a standalone trigger mod

// in this specific case we don't want to be running the CoPilot Data
// initialization on a nested frame anyway, so we'll just eat the error and
// warn to console for now.
const connectedTarget = await getConnectedTarget();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just check before the call that this is coming from the top-level sidebar frame?

From a Dev Ex perspective, I'd at least recommend clarifying in the warning message that the warning is expected for sidebar subframes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this can also run in a modal, right? What check exactly are you talking about?

@twschiller twschiller self-requested a review May 19, 2024 20:34
Copy link
Contributor

@twschiller twschiller left a comment

Choose a reason for hiding this comment

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

Conditionally approved - see comment on the scope of the try-catch and/or checking for top-frame status before making the call

Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@twschiller twschiller added this to the 2.0.0 milestone May 19, 2024
@BLoe BLoe merged commit b7f72b1 into main May 21, 2024
17 checks passed
@BLoe BLoe deleted the dev/guard-against-empty-frame-aa branch May 21, 2024 15:57
grahamlangford pushed a commit that referenced this pull request May 22, 2024
…avior, and fix sidebar-sub-frame console error (#8475)

* debug changes

* make the code a bit more clear, and try-catch around the error related to sub-frames

* only wrap the getConnectedTarget call in try catch

* fix types

* fix var

---------

Co-authored-by: Ben Loe <ben@pixiebrix.com>
Co-authored-by: Todd Schiller <todd.schiller@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Target error (benign?) in console for sidebar
2 participants