- Issue created by @jessebaker
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Where is this
metropolis
coming from? I can findbase.css
atui/node_modules/@radix-ui/themes/src/styles/tokens/base.css
โฆ but I cannot find
metropolis
anywhere in there.Aha, it's
core/themes/olivero/css/base/fonts.pcss.css
that does this. This is part of theolivero/global-styling
asset library. Which is declared as the sole global asset library inoliver.info.yml
๐๐
That asset library must be attached in
\Drupal\experience_builder\Controller\SdcController::preview()
.(That'll also allow reverting most of ๐ First `preview` request fails to generate a response for empty layout Needs review and will hence simplify that controller ๐)
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This is a back-end issue, not a front-end one!
- First commit to issue fork.
- @omkar-pd opened merge request.
- Status changed to Needs work
4 months ago 2:48pm 7 August 2024 - ๐ฎ๐ณIndia omkar-pd
Attached the default theme CSS assets. One test is failing :(
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Great start! ๐๐
Fortunately, I think this can be even simpler ๐ See review on the MR!
- Assigned to omkar-pd
- Issue was unassigned.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
One test failed. The failure looks legit:
AssertionError: expected null to exist at Context.eval (webpack://vite-template-redux/../tests/src/Cypress/cypress/e2e/xb-general.cy.js:60:14)
โฆ if we look at line 60, it's this bit:
// Confirm that the iframe loads the SDC CSS. cy.getIframe() .its('head').should('not.be.undefined') .then((head) => { expect(head.querySelector('link[rel="stylesheet"][href*="experience_builder/components/my-hero/my-hero.css"]')) .to.exist })
You can see that output here: https://git.drupalcode.org/issue/experience_builder-3466571/-/jobs/23766...(failed).png
๐
Either this is detecting a genuine bug, or the test assertion needs to be updated.
- Assigned to wim leers
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Actually โฆ it works fine locally? ๐ค Re-running the
Cypress E2E
CI job. - Issue was unassigned.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I wonder if a more recent upstream commit changed it. I'll push a change.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Applied my own suggestion to address my review feedback, which also triggers a build against
0.x
HEAD, and hopefully now it'll pass ๐ค - ๐ฎ๐ณIndia omkar-pd
Recent changes work fine. But getting couple of warnings.
Warning: Undefined array key "#attached" in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php).
Warning: Trying to access array offset on null in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php).
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I made it pass tests, but:
- one bug is still present, see MR review
- it's not using the correct infrastructure yet, see MR review
- we should expand the Cypress E2E test coverage
Good job getting it to this point already, @omkar-pd! ๐ And thank you! ๐๐
- ๐ฎ๐ณIndia omkar-pd
Thanks @Wim Leers.
Upon checking the network tab, I see
The website encountered an unexpected error. Try again later. Error: Only arrays and Traversables can be unpacked in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php).
- Assigned to omkar-pd
- Issue was unassigned.
- ๐ฎ๐ณIndia omkar-pd
@Wim Leers.
I've addressed the given feedback.
Had to add couple of extra lines to fix errors and warnings. Please review.Error: Only arrays and Traversables can be unpacked in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php). Warning: Undefined array key "#attached" in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php). Warning: Trying to access array offset on null in Drupal\experience_builder\Controller\SdcController->preview() (line 356 of modules/contrib/experience_builder/src/Controller/SdcController.php).
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Last step: tests.
All this needs is one extra assertion for an additional CSS file in:
// Confirm that the iframe loads the SDC CSS. cy.getIframe() .its('head').should('not.be.undefined') .then((head) => { expect(head.querySelector('link[rel="stylesheet"][href*="experience_builder/components/my-hero/my-hero.css"]')) .to.exist })
๐
- Status changed to Needs review
3 months ago 3:15pm 9 August 2024 - ๐ฎ๐ณIndia omkar-pd
Added an assertion for the olivero css file (Don't have much experience writing tests ๐).
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
LGTM!
Cypress E2E test is failing though โฆ re-testing to see if that's an ephemeral failure.
- Assigned to jessebaker
- Status changed to RTBC
3 months ago 3:58pm 9 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Also, I'd like @jessebaker to do the final sign-off on this, given he reported it.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Re-testing once moreโฆ reliability of the
Cypress E2E
CI job is being improved in ๐ Document Cypress test best practices (especially how to write reliable tests) Needs review . ๐ - Issue was unassigned.
- ๐ฌ๐งUnited Kingdom jessebaker
I have merged in 0.x since the MR to harden the Cypress tests was merged in but this is still failing on a test so that needs to be addressed before I can approve/merge this.
- Status changed to Needs work
3 months ago 1:42pm 13 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
cy:command โ its .head cy:command โ assert expected **<head>** not to be undefined cy:command โ assert expected **undefined** to exist in the DOM cy:command โ assert expected **null** to exist
That's indeed the updated test coverage ๐, so something must be wrong in here:
cy.getIframe() .its('head').should('not.be.undefined') .then((head) => { expect(head.querySelector('link[rel="stylesheet"][href*="experience_builder/components/my-hero/my-hero.css"]')) .to.exist; expect(head.querySelector('link[rel="stylesheet"][href*="/core/themes/olivero/css/base/base.css"]')) .to.exist; })
- ๐ฎ๐ณIndia omkar-pd
@Wim Leers
I see the same test failing for a super simple MR.
https://www.drupal.org/project/experience_builder/issues/3467818 ๐ Update XB to match the latest Drupal 11 phpcs.xml.dist- 2024-08-13 Needs review - First commit to issue fork.
- ๐บ๐ธUnited States bnjmnm Ann Arbor, MI
I Improved the test result output for this to state what is being looked for in
<head>
and, on failure, what is actually in<head>
and it doesn't look like the base.css is in there.AssertionError: Tried to find [href*="/core/themes/olivero/css/base/base.css"] in <head> <link rel="stylesheet" media="all" href="/web/core/../modules/custom/experience_builder/components/my-hero/my-hero.css?si5uut"> <style>.preview-dragging .sortable-list{ min-height: 2rem; } .preview-dragging .sortable-list:empty{ background: #fff; } .slot-container { display: flex; > .sortable-item { width: 100%; } } .sortable-list:empty { min-height: 1.5rem; border: 2px dashed #ccc; position: relative; } .sortable-list:empty:after { content: 'Slot'; top: 0; right: 0; text-align: right; position: absolute; } .sortable-item { cursor: grab; } .preview-dragging *, .preview-dragging { cursor: grabbing; } .sortable-ghost { opacity: 0.5; padding: 0; height: 2rem; max-height: 2rem; width: 100%; margin: 0; clear: none; position: relative; background: linear-gradient(135deg, #DDD 12.50%, transparent 12.50%, transparent 50%, #DDD 50%, #DDD 62.50%, transparent 62.50%, transparent 100%) center / 5.66px 5.66px; outline: 1px solid #ccc; box-shadow: none; flex-grow: 1; overflow: hidden; } .sortable-ghost * { visibility: hidden; } </style> : expected null to exist
- Status changed to Needs review
3 months ago 6:16pm 13 August 2024 - ๐ฎ๐ณIndia omkar-pd
Fixed tests by installing and setting Olivero as the default theme in
XBTestSetup.php
.
Back to Needs Review. - Status changed to Needs work
3 months ago 12:12pm 14 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
There's a conflict with ๐ Account for GitlabCI intermittent path differences in SDC CSS test Fixed โ should be easy to resolve :)
- Status changed to Needs review
3 months ago 12:40pm 14 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Not yet passing tests. Re-running.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I showed in #18 that this is not yet quite yielding the kind of preview we'd like.
Yet, this issue still is a step in the right direction, so it should land ๐
To make the preview actually good enough, we need design and research. Created ๐ [needs design] [RESEARCH] Previewed component tree for Content Creator does not match the result for Visitor Active for that.
- ๐ฎ๐ณIndia omkar-pd
Checking the failed pipelines.
Timed out retrying after 4000ms: Expected to find element: button[aria-label="Add section"], but never found it.
If I run the same tests with
Claro
as a default theme then they pass without error but error occurs on Olivero. ๐ - Status changed to Closed: duplicate
3 months ago 9:54am 15 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Due to the scope clarification by @lauriii over at #3468106-4: Render component tree inside the default theme, as a regular page โ , this issue has become pointless to finish ๐ Sorry. I'll credit y'all though!