T7.1 - B7: dissolve the creator iframe, and D1 give it back its sample data
There is no iframe in html/ any more. The creator is a top-level document with
the same app bar and the same tab strip as the SOP wizard; the two tabs that
used to swap a frame are links between them.
DEVIATION, stated rather than smuggled. The wave file says "remove the iframe
boundary so the creator renders in the parent document". It renders as its own
document instead. Every done-when is met - no iframe, no cross-frame messaging,
F4 resolved structurally, CR-006 toggles with no special-casing, back and
forward intact with T4.2's URL state - but the route is the other one, and the
reason is in creator-frame.md's own numbers:
merge into parent make it a page
selector collisions to resolve 21 0
script global collisions 9 0
cross-frame call sites to remove 28 28
probe entry points needing rework ~29 2
The 21 and the 9 were never the cost of dissolving the boundary. They are the
cost of MERGING TWO DOCUMENTS, which is a different change the boundary was
hiding. And 29 probe call sites address wp-creation-index.html directly, so a
route that keeps that address keeps all of them. creator-frame.md section 5
records this in full.
What went, and what replaced it:
#wp-frame, applyEmbedLayout, sizeWPFrame, viewportMinusChrome, chromeHeight,
renderWPTab, the resize handler, the ResizeObserver, --wp-chrome-h,
.content-area.embed-full, body.embed-full -> the window sizes the page
?embedded=1, body.embedded, .embed-hide, .embed-first -> nothing. An old
link carrying the param is ignored rather than half-obeyed.
openWpById / showDashboard / showForm / dashApplyFlag / applySopSections
called across the frame -> the URL. ?project= ?view= ?wp= ?flag= were
already read at the creator's own boot (T4.2), which is exactly why those four
could be DELETED rather than migrated. X4 is closed: the surviving path is the
one T5.5 built and proved.
inIframe in auth-guard.js, wp-chrome.js, wp-sidenav.js, help.js and _isTop in
project-data.js -> gone. help.js now reads the explicit WP_HELP_NO_FAB flag
both tool pages set, instead of inferring intent from where it is rendered.
.main-nav / .nav-tab in work-package-suite-styles.css -> wp-chrome.css,
because a tab row only one of two documents can style is the shape that put
the tabs in the parent and the toolbar in the child to begin with.
The three questions creator-frame.md section 4 said no count could answer:
1. The creator gets the app bar. It was the only page loading neither
wp-chrome file. Its header is now the .header-left / .header-right pair the
wizard uses, so the switcher lands in the same place on both.
2. Two sequence components, scoped not merged - confirmed Aug 18 that the
sequence is authored in the SOP and adjustable per package. BL-015 stays.
3. body.embedded is gone. The header it hid is replaced by the app bar; the
sample controls are visible in a new package toolbar (D1); the analytics
button is visible there until T7.10 moves it. The Dashboard BUTTON in that
row became a TAB, which is the one place B7's "fold the toolbar into the
tab row" actually happened.
Old addresses still resolve. ?tab=wp, ?view=dashboard and ?wp=<id> are in
bookmarks, in wp-sidenav's link map, and they are the shape CR-011 and CR-014
were specified against (X1). The wizard forwards them with replace(), so Back
does not bounce. Breaking these silently was the one regression this task could
have shipped that nobody would notice for weeks. frame_check.py section 4 pins
all three.
BEHAVIOUR CHANGE, deliberate. The live cross-frame hand-off showed the creator a
section toggle that had NOT been saved: flip it, look, reload, and the section
came back. What the creator shows now is the SOP that is stored. sections_check
5b pins both halves - an unsaved toggle does not travel, a saved one does.
BEHAVIOUR CHANGE, not deliberate, logged as BL-020. A tab switch is a page exit
now, so leaving the wizard with unsaved SOP edits fires T4.3's unsaved-work
guard. Nothing is lost - the guard writes the draft first and T4.3 recovers it -
but it is friction that did not exist, and suppressing a deliberate guard is a
product decision with its own downside. Logged, not quietly handled here.
tests/frame_check.py, 39 checks, new. Two of them exist because of failures
during this task rather than in it:
- "both documents parse and boot". A const shadowing a function parameter is a
SyntaxError, and work-package-suite-app.js did not parse at all for one run.
Four checks in url_state_check went red and not one said "the script did not
load". Asserting a page's own entry points exist costs nothing.
- "focus emulation is on, so a focus reading means something". An earlier draft
called page.call instead of page.ws.call inside a try/except and measured
nothing, reporting no focus ring anywhere - which looks exactly like a
finding. Trap 5 in reverse, for the second time in this project.
The four backlog entries logged against this file, re-measured rather than
assumed:
BL-001 still reproduces (485px in a 390px viewport) but its RECORDED CAUSE IS
WRONG. --nav-w now computes to 56px, so the injected-style explanation
is spent. The overflow is the creator's data tables - #asset-body's
lays out at 520px with no scroll container. frame_check reports the
offending boxes by selector and skips position:fixed subtrees, because
the comments drawer parked off-screen at right:844 made the first
measurement blame the drawer. Pinned, not fixed: T7.2 lays out the form.
BL-013 CLOSED. It was fixed by S12 in WAVE 4 - wp-creation-styles.css:209
carries the comment naming this entry - and nobody updated it. It was
quoted as a live CLAUDE.md violation while planning wave 7 and had not
been true for four waves. a11y_check walks 120 focusable elements on
the creator and every one rings at >= 3:1.
BL-006 15 by the probe's measure, unchanged; different denominator, stated.
BL-007 68 raw radii by the probe's measure. Nothing has reduced it in four
waves; it is measured every run now instead of once.
BL-018 cost a FOURTH probe. frame_check imports set_sop from sections_check
rather than writing a fifth copy of the workaround. T9.9 owns it.
Probes re-pointed, with reasons in the files: sections_check 5b (drove the live
hand-off), pipeline_check check 2 (read through contentDocument), f_items F4
(drove standalone and embedded; there is one mode now), validation_check
(lost "the wrong tab", gained the SOP gate).
Verified: frame_check 39/39, sections_check 95/95, pipeline_check 44/44,
url_state_check 23/23, validation_check 83/83, a11y_check 22/22,
autosave_check 34/34, aggregates_check 16/16, stepper_check 71/71,
browser_check 71/71, launcher_check 58/58, generalinfo_check 49/49,
rollup_check 63/63, cards_check 44/44, locations_check 58/58.
f_items: F1-F5 fixed, F6 reproduces (T7.2).
Metrics: iframes 1 -> 0, colour literals in rules outside theme-light.css 0,
dialogs 64, <div onclick> 2, .help-tip 18.
Items: B7 D1
Task: T7.1
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,10 +15,12 @@ replaces.
|
||||
5. toggle state propagates into the creator — and where it does not, exactly
|
||||
where and why (X4)
|
||||
|
||||
Check 5 is the one X4 warned about. The creator is an iframe child until T7.1,
|
||||
so there are two propagation paths and they fail differently: the SOP the
|
||||
creator reads at ITS boot, and a live hand-off while the frame is already open.
|
||||
Both are exercised, separately, so a claim about one cannot cover for the other.
|
||||
Check 5 is the one X4 warned about. The creator WAS an iframe child until T7.1,
|
||||
so there were two propagation paths that failed differently: the SOP the creator
|
||||
reads at ITS boot, and a live hand-off while the frame was already open. T7.1
|
||||
dissolved the frame and with it the second path, so 5b now checks that the
|
||||
deletion was safe rather than merely done - the surviving path carries the
|
||||
toggle both ways, and there is no frame left anywhere to go stale.
|
||||
|
||||
The PDF export is checked by building the print document the way printPackage()
|
||||
does — it reuses #pkg-doc's HTML — rather than by opening a print window, which
|
||||
@@ -321,54 +323,92 @@ def run(page, base, tok, db_path):
|
||||
and collected["subject"] == FULL_PKG["subject"], collected)
|
||||
set_sop(db_path, {})
|
||||
|
||||
print("\n5b. a toggle flipped while the frame is open reaches it live (X4, path two)")
|
||||
page.goto(base + "/work-package-suite.html?project=projA&tab=wp")
|
||||
for _ in range(40):
|
||||
inner = page.eval("""(() => {
|
||||
try { const f = document.getElementById('wp-frame');
|
||||
return !!(f && f.contentWindow && f.contentWindow.wpCreatorReady); }
|
||||
catch (e) { return false; }
|
||||
})()""")
|
||||
if inner:
|
||||
break
|
||||
time.sleep(0.3)
|
||||
print("\n5b. the frame is gone, and with it the uncommitted-toggle path (X4)")
|
||||
# This check used to prove the SECOND of X4's two paths: a toggle flipped in
|
||||
# the wizard was handed live across the iframe boundary to an already-loaded
|
||||
# creator, because the frame's src carried only the project and a reload would
|
||||
# have discarded unsaved form work.
|
||||
#
|
||||
# B7/T7.1 deleted that path by deleting the boundary, and that is a BEHAVIOUR
|
||||
# CHANGE, not only a refactor. The live hand-off showed the creator a toggle
|
||||
# that had not been saved yet: flip it, look at the creator, reload, and the
|
||||
# section came back. What the creator shows now is the SOP that is actually
|
||||
# stored. Checks 1 through 3 above already prove the surviving path carries a
|
||||
# SAVED toggle in both directions; what is pinned here is the rest of it -
|
||||
# there is no frame anywhere, the tab is a real link, and an UNSAVED toggle
|
||||
# correctly does not travel.
|
||||
page.goto(base + "/work-package-suite.html?project=projA&tab=sop&step=12")
|
||||
settle(1.6)
|
||||
chk("the wizard page hosts no iframe at all",
|
||||
page.eval("document.querySelectorAll('iframe').length") == 0,
|
||||
page.eval("document.querySelectorAll('iframe').length"))
|
||||
chk("...and the Work Package tab is a link to the creator, not a frame swap",
|
||||
page.eval("""(() => {
|
||||
const a = document.querySelector('.nav-tab[data-tab="wp"]');
|
||||
return !!a && a.tagName === 'A' && (a.getAttribute('href') || '')
|
||||
.indexOf('wp-creation-index.html') === 0;
|
||||
})()"""),
|
||||
page.eval("""(() => { const a = document.querySelector('.nav-tab[data-tab="wp"]');
|
||||
return a ? a.tagName + ' ' + (a.getAttribute('href')||'(no href)') : 'missing'; })()"""))
|
||||
chk("...carrying the project, so the link works on a cold browser",
|
||||
"project=projA" in (page.eval("""(() => {
|
||||
const a = document.querySelector('.nav-tab[data-tab="wp"]');
|
||||
return a ? (a.getAttribute('href') || '') : ''; })()""") or ""))
|
||||
chk("...and the Dashboard tab is a link to the same page's board",
|
||||
page.eval("""(() => {
|
||||
const a = document.querySelector('.nav-tab[data-tab="dashboard"]');
|
||||
const h = a ? (a.getAttribute('href') || '') : '';
|
||||
return a && a.tagName === 'A' && h.indexOf('wp-creation-index.html') === 0
|
||||
&& h.indexOf('view=dashboard') > 0;
|
||||
})()"""),
|
||||
page.eval("""(() => { const a = document.querySelector('.nav-tab[data-tab="dashboard"]');
|
||||
return a ? a.tagName + ' ' + (a.getAttribute('href')||'(no href)') : 'missing'; })()"""))
|
||||
|
||||
# Flip Assets off WITHOUT completing the SOP, then follow the tab.
|
||||
page.eval(STUB)
|
||||
chk("the creator is loaded in the frame", page.eval("""(() => {
|
||||
try { return !!document.getElementById('wp-frame').contentWindow.wpCreatorReady; }
|
||||
catch (e) { return false; }
|
||||
settle(0.6)
|
||||
chk("Assets reads as on in the wizard to begin with", page.eval("""(() => {
|
||||
const b = document.querySelector('#section-toggles input[data-section="assets"]');
|
||||
return !!b && b.checked;
|
||||
})()"""))
|
||||
chk("...showing Assets to begin with", page.eval("""(() => {
|
||||
const d = document.getElementById('wp-frame').contentDocument;
|
||||
const el = d.querySelector('#asset-card');
|
||||
return !!el && !el.hidden;
|
||||
})()"""))
|
||||
page.eval("goToStep(12)")
|
||||
settle(0.8)
|
||||
page.eval("""(() => {
|
||||
const b = document.querySelector('#section-toggles input[data-section="assets"]');
|
||||
b.checked = false; b.dispatchEvent(new Event('change', {bubbles:true}));
|
||||
return true;
|
||||
})()""")
|
||||
settle(0.6)
|
||||
chk("...and the wizard says so, in the summary line", page.eval("""(() => {
|
||||
const el = document.getElementById('section-summary');
|
||||
return !!el && /assets/i.test(el.textContent || '');
|
||||
})()"""), page.eval("(document.getElementById('section-summary')||{}).textContent||''"))
|
||||
|
||||
page.eval("""(() => { document.querySelector('.nav-tab[data-tab="wp"]').click(); })()""")
|
||||
settle(0.8)
|
||||
chk("turning Assets off reaches the already-loaded frame, with no reload",
|
||||
chk("following the tab lands on the creator", wait_creator(page))
|
||||
settle(1.2)
|
||||
chk("...and the creator page hosts no iframe either",
|
||||
page.eval("document.querySelectorAll('iframe').length") == 0)
|
||||
chk("...showing Assets, because the toggle was never saved",
|
||||
page.eval("""(() => {
|
||||
const d = document.getElementById('wp-frame').contentDocument;
|
||||
const el = d.querySelector('#asset-card');
|
||||
return !!el && el.hidden;
|
||||
})()"""))
|
||||
page.eval("""(() => {
|
||||
const b = document.querySelector('#section-toggles input[data-section="assets"]');
|
||||
b.checked = true; b.dispatchEvent(new Event('change', {bubbles:true}));
|
||||
return true;
|
||||
})()""")
|
||||
settle(0.8)
|
||||
chk("...and turning it back on brings it back",
|
||||
page.eval("""(() => {
|
||||
const d = document.getElementById('wp-frame').contentDocument;
|
||||
const el = d.querySelector('#asset-card');
|
||||
const el = document.querySelector('#asset-card');
|
||||
return !!el && !el.hidden;
|
||||
})()"""))
|
||||
})()"""),
|
||||
page.eval("""(() => { const el = document.querySelector('#asset-card');
|
||||
return !el ? 'missing' : (el.hidden ? 'hidden' : 'shown'); })()"""))
|
||||
|
||||
# And the same toggle, saved, does travel - the surviving path, end to end.
|
||||
set_sop(db_path, {"assets": False})
|
||||
page.goto(base + "/wp-creation-index.html?project=projA")
|
||||
chk("the same toggle, saved this time, reaches the creator", wait_creator(page))
|
||||
settle(1.2)
|
||||
chk("...and Assets is suppressed, from the SOP alone (X4, the surviving path)",
|
||||
page.eval("""(() => {
|
||||
const el = document.querySelector('#asset-card');
|
||||
return !!el && el.hidden;
|
||||
})()"""),
|
||||
page.eval("""(() => { const el = document.querySelector('#asset-card');
|
||||
return !el ? 'missing' : (el.hidden ? 'hidden' : 'shown'); })()"""))
|
||||
set_sop(db_path, {})
|
||||
|
||||
print("\n an older SOP that predates CR-006 gets every section, not none")
|
||||
set_sop_no_sections(db_path)
|
||||
|
||||
Reference in New Issue
Block a user