Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@
.research-reading-order { display: flex; align-items: center; gap: 12px; border-block-end: 1px solid var(--pw-line); padding-block: 0 8px; margin-block-end: 8px; }
.research-reading-order button { min-height: 44px; padding: 6px 0; background: none; border: 0; color: var(--pw-text); font: inherit; font-size: var(--text-body); cursor: pointer; }
.research-reading-order > span { color: var(--pw-muted); }
.research-reading-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; gap: 24px 40px; margin-block: 16px 32px; }
.research-reading-overview.is-expanded { grid-template-columns: minmax(0, 1fr); }
.research-reading-layer { min-width: 0; scroll-margin-block-start: 16px; }
.research-reading-layer .research-synthesis:not(.research-synthesis-detail) { margin-block: 24px 32px; }
.research-reading-overview .research-synthesis:not(.research-synthesis-detail), .research-reading-overview .research-progress { margin-block: 0; }
.research-reading-overview .research-progress { padding-block-start: 0; }
.research-reading-layer:focus, .research-history-heading:focus { outline: none; }

@media (max-width: 640px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,16 @@ export function GoalResearchHistory({goalId, active, zh, refreshRevision = 0, re
return <section className="research-history" aria-label={copy.title} aria-busy={busy}>
{progressiveOverview ? <>
<nav className="research-reading-order" aria-label={zh ? "研究阅读" : "Research reading"}>
<button type="button" onClick={() => jump(resultsAnchor.current)}>{zh ? "指标" : "Results"}</button><span aria-hidden>→</span>
<button type="button" onClick={() => jump(reportAnchor.current)}>{zh ? "汇报" : "Report"}</button><span aria-hidden>→</span>
<button type="button" onClick={() => jump(resultsAnchor.current)}>{zh ? "指标" : "Results"}</button><span aria-hidden>→</span>
<button type="button" onClick={showHistory}>{zh ? "研究历程" : "Research history"}</button>
</nav>
<ResearchAnalysisStatus analysis={analysis}/>
<div ref={resultsAnchor} tabIndex={-1} className="research-reading-layer"><ResearchProgressSummary analysis={analysis} includeReport={false}/></div>
<div ref={reportAnchor} tabIndex={-1} className="research-reading-layer"><ResearchReportSummary analysis={analysis}/><ResearchAnalysisPanel analysis={analysis} onHistory={showHistory}/></div>
<ResearchCitationPanel analysis={analysis}/>
<div className={`research-reading-overview${analysis.location.open ? " is-expanded" : ""}`}>
<div ref={reportAnchor} tabIndex={-1} className="research-reading-layer"><ResearchReportSummary analysis={analysis}/><ResearchAnalysisPanel analysis={analysis} onHistory={showHistory}/>{analysis.location.open ? <ResearchCitationPanel analysis={analysis}/> : null}</div>
<div ref={resultsAnchor} tabIndex={-1} className="research-reading-layer"><ResearchProgressSummary analysis={analysis} includeReport={false}/></div>
</div>
{!analysis.location.open ? <ResearchCitationPanel analysis={analysis}/> : null}
</> : null}
<header className="research-history-heading" ref={historyAnchor} tabIndex={-1}><div><div className="research-history-title"><h2>{copy.title}</h2><ContextHelp label={zh ? "历史范围与读图说明" : "History scope and reading guide"}>
<p>{copy.scope} · {copy.time}{zh ? "。" : ". "}{copy.coverage}{zh ? "。" : "."}</p><p>{copy.interpretation}{zh ? "。" : "."}</p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions examples/personal-workspace-browser/research-history.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,21 @@ export const researchHistoryScenario = {
assert.match(await processJudgments.locator('[data-metric="goal_alignment"]').getAttribute('aria-label'), /不适用/);
await processJudgments.locator(':scope > summary').click();
assert.equal(await synthesisPage.locator('.research-effect-metrics:visible').count(), 0);
await synthesisPage.evaluate(() => {for (const e of document.querySelectorAll('*')) if (e.scrollTop) e.scrollTop = 0;});
assert(await synthesisPage.evaluate(() => {
const summary = document.querySelector('.research-synthesis-summary').getBoundingClientRect();
const viewport = document.querySelector('.personal-channel-scroll').getBoundingClientRect();
return summary.top >= viewport.top && summary.bottom <= viewport.bottom;
}), 'The first viewport answers what the study found, including its unknowns');
await synthesisPage.screenshot({path: resolve(outputDir, 'research-synthesis-ordinary-desktop.png'), animations: 'disabled'});
assert(await synthesisPage.evaluate(() => {
const results = document.querySelector('.research-progress');
const report = document.querySelector('.research-synthesis');
const history = document.querySelector('.research-history-heading');
return Boolean(results && report && history
&& (results.compareDocumentPosition(report) & Node.DOCUMENT_POSITION_FOLLOWING)
&& (report.compareDocumentPosition(history) & Node.DOCUMENT_POSITION_FOLLOWING));
}), 'The complete overview reads results, report, then research history');
&& (report.compareDocumentPosition(results) & Node.DOCUMENT_POSITION_FOLLOWING)
&& (results.compareDocumentPosition(history) & Node.DOCUMENT_POSITION_FOLLOWING));
}), 'The report answers the research question before readers inspect measurements and history');
const reading = synthesisPage.getByRole('navigation', {name: '研究阅读', exact: true});
await reading.getByRole('button', {name: '汇报', exact: true}).click();
assert(await synthesisPage.evaluate(() => document.activeElement?.contains(document.querySelector('.research-synthesis'))));
Expand Down Expand Up @@ -466,6 +472,11 @@ export const researchHistoryScenario = {
await synthesis.locator('.research-synthesis-finding > summary').first().click();
await synthesisPage.evaluate(() => {for (const e of document.querySelectorAll('*')) if (e.scrollTop) e.scrollTop = 0;});
assert(await synthesisPage.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
assert(await synthesisPage.evaluate(() => {
const summary = document.querySelector('.research-synthesis-summary').getBoundingClientRect();
const viewport = document.querySelector('.personal-channel-scroll').getBoundingClientRect();
return summary.top >= viewport.top && summary.bottom <= viewport.bottom;
}), 'A narrow first viewport retains the substantive report instead of only metric labels');
await synthesisPage.screenshot({path: resolve(outputDir, 'research-synthesis-ordinary-mobile.png'), animations: 'disabled'});
await reading.getByRole('button', {name: '汇报', exact: true}).click();
await synthesisPage.mouse.move(1, 1);
Expand Down
Loading