Improve mobile layouts for chapters and timeline workspaces
This commit is contained in:
parent
6b4079a280
commit
f2d15b9db3
@ -70,3 +70,6 @@ For Dev verification, provision a private identity using the existing `--dev-bro
|
||||
Run the isolated fixture host with `dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --toolbar-browser-host`, then `npm run test:record-workspaces`. The suite renders nine real Razor forms and checks Browser preservation, Desktop composition, responsive widths, ribbon Save/icons, existing unobtrusive validation, multipart/antiforgery submission, themes and parser-paused first paint.
|
||||
|
||||
For Dev-only verification, provision an identity with `--dev-browser-identity create /tmp/pd-dev-browser-<unique>.json`, then run `xvfb-run -a node record-workspaces-dev.cjs /tmp/pd-dev-browser-<unique>.json`. It creates isolated records via their normal forms, installs/launches a real Chromium app, verifies eight record types plus details/settings/management, saves and reloads a changed book, checks keyboard/context behaviour, and measures initial geometry. Always finish with `--dev-browser-identity cleanup` to remove the account and all owned fixture data. Production is never a test target.
|
||||
|
||||
|
||||
Responsive Chapters, Timeline and Plot Lines: start the isolated Razor host from the repository root with `dotnet run --project PlotLine.Tests -- --toolbar-browser-host`, then run `npm run test:responsive-content` in this directory. Repeat with `PD_RESPONSIVE_STANDALONE=1` for simulated standalone shell mode. The test checks 360, 390, 412, 800 and 1440 CSS pixels in modern dark, warm dark and modern light themes, with short/long chapter titles, long rail/book names, visible actions, sticky rails, internal scrolling, zoom connector coordinates and page overflow. Screenshots at 390 and 1440px are written to `/tmp/responsive-*.png`. These fixtures render compiled application views without a database; standalone simulation does not replace device testing.
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
"test:characters": "node character-enrichment-detail.cjs",
|
||||
"test:toolbar": "node application-toolbar.cjs",
|
||||
"test:pwa": "node application-pwa.cjs",
|
||||
"test:responsive-content": "node responsive-content.cjs",
|
||||
"test:plot-lines": "node plot-line-map.cjs",
|
||||
"test:associate-scenes": "node associate-scenes.cjs",
|
||||
"test:timeline-plot-retirement": "node timeline-plot-retirement.cjs",
|
||||
|
||||
82
PlotLine.Tests/Browser/responsive-content.cjs
Normal file
82
PlotLine.Tests/Browser/responsive-content.cjs
Normal file
@ -0,0 +1,82 @@
|
||||
const { chromium } = require('playwright');
|
||||
const assert = require('node:assert/strict');
|
||||
const widths = [360, 390, 412, 800, 1440];
|
||||
const longName = 'The unexpectedly long journey across the northern mountains and beyond the distant sea';
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ headless: true, executablePath: process.env.CHROMIUM_PATH });
|
||||
try {
|
||||
const page = await browser.newPage();
|
||||
const standalone = process.env.PD_RESPONSIVE_STANDALONE === '1';
|
||||
await page.addInitScript(standalone => {
|
||||
if (standalone) Object.defineProperty(navigator, 'standalone', { get: () => true });
|
||||
}, standalone);
|
||||
for (const width of widths) {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
for (const theme of ['modern-dark', 'warm-dark', 'modern-light']) {
|
||||
const mobile = width < 768;
|
||||
for (const [kind, url] of [['chapters', '/fixture?desktop=Books'], ['timeline', '/fixture?page=timeline-render'], ['plot', '/plot-map-fixture']]) {
|
||||
await page.goto('http://127.0.0.1:5238' + url);
|
||||
await page.evaluate(theme => {
|
||||
document.documentElement.dataset.appTheme = theme;
|
||||
document.documentElement.dataset.theme = theme.endsWith('dark') ? 'dark' : 'light';
|
||||
}, theme);
|
||||
// The isolated map host does not have a viewport meta tag; desktop Playwright
|
||||
// uses CSS pixels, just as the full application with its viewport meta does.
|
||||
if (kind === 'chapters') {
|
||||
assert.equal(await page.locator('.chapter-table').count(), 1);
|
||||
assert.equal(await page.locator('.chapter-title').count(), 2);
|
||||
const titles = await page.locator('.chapter-title').evaluateAll(els => els.map(el => ({ width: el.clientWidth, scroll: el.scrollWidth, height: el.clientHeight })));
|
||||
assert.ok(titles.every(t => t.width > (mobile ? 200 : 100) && t.scroll <= t.width + 1), JSON.stringify(titles));
|
||||
assert.equal(await page.locator('.chapter-table tbody tr').first().evaluate(el => getComputedStyle(el).display), mobile ? 'grid' : 'table-row');
|
||||
for (const selector of ['.chapter-status', '.chapter-manuscript', '.chapter-summary', '.chapter-actions a', '.chapter-actions button']) {
|
||||
for (const el of await page.locator(selector).all()) assert.ok(await el.isVisible(), selector);
|
||||
}
|
||||
if (mobile) assert.ok(await page.locator('.chapter-actions button').first().evaluate(el => el.clientHeight >= 42));
|
||||
} else {
|
||||
const rail = page.locator(kind === 'timeline' ? '.timeline-project-title' : '.plot-lane-label').first();
|
||||
const name = rail.locator('.responsive-rail-text');
|
||||
if (kind === 'timeline') await page.locator('.timeline-book-title strong').first().evaluate((el, text) => { el.textContent = text; }, longName);
|
||||
await name.evaluate((el, text) => { const title = el.querySelector('strong'); (title || el).textContent = text; }, longName);
|
||||
const box = await rail.boundingBox();
|
||||
assert.equal(Math.round(box.width), mobile ? 52 : kind === 'timeline' ? 180 : 204);
|
||||
if (mobile) {
|
||||
assert.notEqual(await name.evaluate(el => getComputedStyle(el).transform), 'none');
|
||||
const bounds = await name.boundingBox();
|
||||
assert.ok(bounds.x >= box.x - 1 && bounds.x + bounds.width <= box.x + box.width + 1, JSON.stringify({box, bounds}));
|
||||
await name.focus();
|
||||
await name.evaluate(el => { el.scrollLeft = 100; });
|
||||
assert.ok(await name.evaluate(el => el.scrollLeft > 0), 'Long text remains scrollable');
|
||||
}
|
||||
const scroll = page.locator(kind === 'timeline' ? '.timeline-shell' : '.plot-map-scroll').first();
|
||||
const scrollable = await scroll.evaluate(el => el.scrollWidth > el.clientWidth);
|
||||
if (mobile) assert.ok(scrollable, 'mobile workspace must keep horizontal scrolling');
|
||||
await scroll.evaluate(el => { el.scrollLeft = 180; });
|
||||
if (scrollable) assert.ok(await scroll.evaluate(el => el.scrollLeft > 0));
|
||||
const after = await rail.boundingBox();
|
||||
assert.ok(Math.abs(after.x - box.x) < 1, `sticky rail moved: ${JSON.stringify({ box, after })}`);
|
||||
if (kind === 'plot') {
|
||||
await page.locator('[data-map-mode="associate"]').click();
|
||||
for (const el of await page.locator('.plot-lane-label .plot-associate-action').all()) {
|
||||
assert.ok(await el.isVisible());
|
||||
if (mobile) assert.ok((await el.boundingBox()).height >= 44);
|
||||
}
|
||||
// Zoom and breakpoint changes must update scene markers and SVG dependencies together.
|
||||
await page.locator('#plot-map-zoom').selectOption('180');
|
||||
const coords = await page.evaluate(() => {
|
||||
const map = document.querySelector('.plot-narrative-map');
|
||||
const path = map.querySelector('[data-source-column]');
|
||||
const offset = parseFloat(getComputedStyle(map).getPropertyValue('--plot-map-origin')) || 260;
|
||||
return { d: path?.getAttribute('d'), expected: offset + Number(path?.dataset.sourceColumn) * 180 };
|
||||
});
|
||||
if (coords.d) assert.ok(coords.d.startsWith(`M ${coords.expected} `));
|
||||
}
|
||||
}
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - innerWidth);
|
||||
assert.ok(overflow <= 1, `${kind} ${width} ${theme}: page overflow ${overflow}px`);
|
||||
if (theme === 'modern-dark' && [390, 1440].includes(width)) await page.screenshot({ path: `/tmp/responsive-${kind}-${width}${standalone ? "-standalone" : ""}.png`, fullPage: true });
|
||||
}
|
||||
}
|
||||
console.log(`PASS responsive content: ${width}px, three themes`);
|
||||
}
|
||||
} finally { await browser.close(); }
|
||||
})().catch(error => { console.error(error); process.exitCode = 1; });
|
||||
@ -258,7 +258,10 @@ internal static class ToolbarBrowserHost
|
||||
{
|
||||
"ManuscriptImport" => new OnboardingWizardViewModel { CurrentStep = OnboardingSteps.NextPathPreview, WritingSoftware = WritingSoftwareValues.MicrosoftWord, SelectedProjectName = "The Glass Harbour", SelectedBookTitle = "A Distant Shore", ProjectID = 7, BookID = 12 },
|
||||
"StoryBible" => new StoryBibleViewModel { Project = project, Query = context.Request.Query["q"] },
|
||||
"Books" => new BookDetailViewModel { Project = project, Book = model.Book! },
|
||||
"Books" => new BookDetailViewModel { Project = project, Book = model.Book!, Chapters = [
|
||||
new() { ChapterID = 21, ChapterNumber = 1, ChapterTitle = "Drowning in Silence", RevisionStatusName = "Planned", IsLinkedToManuscript = true, Summary = "A quiet opening." },
|
||||
new() { ChapterID = 22, ChapterNumber = 2, ChapterTitle = "A deliberately long chapter title about an unexpected journey beyond the distant northern mountains", RevisionStatusName = "Draft", ChapterPurposeName = "Turning point", Summary = "A longer summary remains available on small screens.", IsLinkedToManuscript = false }
|
||||
] },
|
||||
"Characters" => new CharacterListViewModel { Project = project, Characters = context.Request.Query["context"] == "objects" ? [new Character { CharacterID = 71, CharacterName = "Context A" }, new Character { CharacterID = 72, CharacterName = "Context B" }] : [] },
|
||||
"Locations" => new LocationListViewModel { Project = project },
|
||||
"FloorPlans" => new FloorPlanListViewModel { Project = project },
|
||||
|
||||
@ -180,34 +180,34 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="table-responsive">
|
||||
<table class="table align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Chapter</th>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Manuscript</th>
|
||||
<th>Summary</th>
|
||||
<th></th>
|
||||
<div class="table-responsive chapter-list">
|
||||
<table class="table align-middle chapter-table" role="table">
|
||||
<thead role="rowgroup">
|
||||
<tr role="row">
|
||||
<th role="columnheader">Chapter</th>
|
||||
<th role="columnheader">Title</th>
|
||||
<th role="columnheader">Status</th>
|
||||
<th role="columnheader">Manuscript</th>
|
||||
<th role="columnheader">Summary</th>
|
||||
<th role="columnheader"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody role="rowgroup">
|
||||
@foreach (var chapter in Model.Chapters)
|
||||
{
|
||||
<tr data-pd-context="chapter" data-pd-context-id="@chapter.ChapterID" data-pd-context-label="@chapter.ChapterTitle">
|
||||
<td class="narrow">@chapter.ChapterNumber</td>
|
||||
<td><a asp-controller="Chapters" asp-action="Details" asp-route-id="@chapter.ChapterID">@chapter.ChapterTitle</a></td>
|
||||
<td>
|
||||
<tr role="row" data-pd-context="chapter" data-pd-context-id="@chapter.ChapterID" data-pd-context-label="@chapter.ChapterTitle">
|
||||
<td role="cell" class="chapter-number narrow">@chapter.ChapterNumber</td>
|
||||
<td role="cell" class="chapter-title"><a asp-controller="Chapters" asp-action="Details" asp-route-id="@chapter.ChapterID">@chapter.ChapterTitle</a></td>
|
||||
<td role="cell" class="chapter-status">
|
||||
<span class="status-pill">@chapter.RevisionStatusName</span>
|
||||
@if (!string.IsNullOrWhiteSpace(chapter.ChapterPurposeName))
|
||||
{
|
||||
<span class="status-pill">@chapter.ChapterPurposeName</span>
|
||||
}
|
||||
</td>
|
||||
<td><span class="status-pill">@(chapter.IsLinkedToManuscript ? "🔗 Linked" : "📝 Planned")</span></td>
|
||||
<td>@chapter.Summary</td>
|
||||
<td class="text-end">
|
||||
<td role="cell" class="chapter-manuscript"><span class="status-pill">@(chapter.IsLinkedToManuscript ? "🔗 Linked" : "📝 Planned")</span></td>
|
||||
<td role="cell" class="chapter-summary">@chapter.Summary</td>
|
||||
<td role="cell" class="chapter-actions text-end">
|
||||
<a class="btn btn-outline-secondary btn-sm" asp-controller="Chapters" asp-action="Edit" asp-route-id="@chapter.ChapterID">Edit</a>
|
||||
<form asp-controller="Chapters" asp-action="Archive" method="post" class="archive-button-form" data-confirm-message="Archive this chapter? This will hide it from active lists and timelines, but the data will be kept and can be restored later.">
|
||||
<input type="hidden" name="id" value="@chapter.ChapterID" />
|
||||
|
||||
@ -44,13 +44,13 @@
|
||||
var laneScenes = Model.Scenes.Where(x => x.Memberships.Any(m => m.PlotLineID == lane.Line.PlotLineID)).ToList();
|
||||
<div class="plot-horizontal-route" style="top:@(y)px;--line-colour:@lane.Line.Colour" data-drop-line="@lane.Line.PlotLineID" aria-label="@lane.Line.PlotLineName drop target"></div>
|
||||
<div class="plot-lane-label-row" style="top:@(y - 32)px"><div data-pd-context="plot line" data-pd-context-id="@lane.Line.PlotLineID" data-pd-context-label="@lane.Line.PlotLineName" class="plot-lane-label" style="--line-colour:@lane.Line.Colour" data-drop-line="@lane.Line.PlotLineID">
|
||||
<strong data-lane-name><span>@(l + 1)</span> @lane.Line.PlotLineName</strong>
|
||||
<strong data-lane-name class="responsive-rail-text" tabindex="0"><span>@(l + 1)</span> @lane.Line.PlotLineName</strong>
|
||||
@if (Model.Health.Lines.FirstOrDefault(h => h.PlotLineID == lane.Line.PlotLineID) is { Findings.Count: > 0 } health)
|
||||
{
|
||||
<button type="button" data-pd-context-command data-pwa-icon="health" class="plot-health-summary" data-health-line="@lane.Line.PlotLineID" aria-label="Health for @lane.Line.PlotLineName: @health.Summary">@health.Summary</button>
|
||||
}
|
||||
<a class="plot-colour-edit" asp-controller="PlotLines" asp-action="Edit" asp-route-id="@lane.Line.PlotLineID" title="Edit line and colour">Edit colour</a>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary plot-associate-action" data-add-line="@lane.Line.PlotLineID" hidden>Add selected scene</button>
|
||||
<a class="plot-colour-edit" asp-controller="PlotLines" asp-action="Edit" asp-route-id="@lane.Line.PlotLineID" title="Edit line and colour" aria-label="Edit line and colour"><span>Edit colour</span></a>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary plot-associate-action" data-add-line="@lane.Line.PlotLineID" hidden aria-label="Add selected scene"><span>Add selected scene</span></button>
|
||||
</div></div>
|
||||
@for (var n = 0; n < laneScenes.Count; n++)
|
||||
{
|
||||
@ -88,7 +88,7 @@
|
||||
}
|
||||
@if (health.Findings.Any(f => f.RuleID == "H002" && f.Level != PlotHealthLevel.Information && (!f.MarkerSceneID.HasValue || !sceneIndex.ContainsKey(f.MarkerSceneID.Value))))
|
||||
{
|
||||
<button type="button" data-pd-context-command data-pwa-icon="health" class="plot-health-position" data-health-line="@health.PlotLineID" style="--column:@Math.Max(0,Model.Scenes.Count-1);left:calc(260px + var(--column) * var(--step) + 165px);top:@(laneIndex[health.PlotLineID]*240+126)px" title="Quiet stretch at evaluated cutoff" aria-label="Quiet stretch at evaluated cutoff; inspect health evidence">◇</button>
|
||||
<button type="button" data-pd-context-command data-pwa-icon="health" class="plot-health-position" data-health-line="@health.PlotLineID" style="--column:@Math.Max(0,Model.Scenes.Count-1);left:calc(var(--plot-map-origin, 260px) + var(--column) * var(--step) + 165px);top:@(laneIndex[health.PlotLineID]*240+126)px" title="Quiet stretch at evaluated cutoff" aria-label="Quiet stretch at evaluated cutoff; inspect health evidence">◇</button>
|
||||
}
|
||||
}
|
||||
@for (var i = 0; i < Model.Scenes.Count; i++)
|
||||
|
||||
@ -722,10 +722,10 @@ else
|
||||
</div>
|
||||
<div data-collapse-body="scene-cards">
|
||||
<div class="timeline-series-row">
|
||||
<div class="timeline-project-title">
|
||||
<div class="timeline-project-title"><div class="responsive-rail-text" tabindex="0">
|
||||
<span>Project / Series</span>
|
||||
<strong>@Model.Project.ProjectName</strong>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="timeline-books">
|
||||
@foreach (var book in Model.Books)
|
||||
{
|
||||
@ -967,10 +967,10 @@ else
|
||||
</div>
|
||||
</div>
|
||||
<div class="metric-timeline-row">
|
||||
<div class="metric-lane-label">
|
||||
<div class="metric-lane-label"><div class="responsive-rail-text" tabindex="0">
|
||||
<strong>Metric Shape</strong>
|
||||
<span>Scene pacing</span>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="metric-chart-frame metric-timeline-frame">
|
||||
<canvas aria-label="Comparative scene metric line graph"></canvas>
|
||||
<p class="muted d-none" data-chart-fallback>Metric chart could not load. The raw metric rows are still available below.</p>
|
||||
@ -1042,10 +1042,10 @@ else
|
||||
if ((lane.Asset.Importance >= 8 ? "High importance" : "Other assets") != group.Key) { continue; }
|
||||
var assetFocusClass = Model.Filter.FocusType == "asset" && Model.Filter.FocusID.HasValue && Model.Filter.FocusID != lane.Asset.StoryAssetID ? "lane-dim" : "";
|
||||
<div class="asset-lane-row @assetFocusClass">
|
||||
<a class="asset-lane-label" draggable="true" data-drag-type="asset" data-drag-id="@lane.Asset.StoryAssetID" data-drag-label="@lane.Asset.AssetName" data-asset-drop-target="true" data-asset-id="@lane.Asset.StoryAssetID" data-asset-label="@lane.Asset.AssetName" asp-controller="StoryAssets" asp-action="Details" asp-route-id="@lane.Asset.StoryAssetID">
|
||||
<a class="asset-lane-label" draggable="true" data-drag-type="asset" data-drag-id="@lane.Asset.StoryAssetID" data-drag-label="@lane.Asset.AssetName" data-asset-drop-target="true" data-asset-id="@lane.Asset.StoryAssetID" data-asset-label="@lane.Asset.AssetName" asp-controller="StoryAssets" asp-action="Details" asp-route-id="@lane.Asset.StoryAssetID"><div class="responsive-rail-text" tabindex="0">
|
||||
<strong>@lane.Asset.AssetName</strong>
|
||||
<span>@lane.Asset.KindName / @lane.Asset.Importance</span>
|
||||
</a>
|
||||
</div></a>
|
||||
<div class="asset-lane-slots">
|
||||
@foreach (var column in timelineColumns)
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
.plot-lane-label { position:sticky; left:0; width:204px; min-height:65px; padding:.65rem; border-left:5px solid var(--line-colour); background:var(--bs-body-bg); z-index:8; margin-bottom:-65px; box-shadow:8px 0 12px var(--bs-body-bg); }
|
||||
.plot-lane-label strong { display:block; font-size:.85rem; }
|
||||
.plot-lane-label strong span { display:inline-grid; place-items:center; border:1px solid var(--line-colour); border-radius:50%; width:1.4rem; height:1.4rem; }
|
||||
.plot-map-marker, .plot-scene-stem, .plot-map-callout, .plot-thread-section, .plot-map-gap, .plot-chapter-guide, .plot-explicit-target { position:absolute; left:calc(260px + var(--column) * var(--step)); }
|
||||
.plot-map-marker, .plot-scene-stem, .plot-map-callout, .plot-thread-section, .plot-map-gap, .plot-chapter-guide, .plot-explicit-target { position:absolute; left:calc(var(--plot-map-origin, 260px) + var(--column) * var(--step)); }
|
||||
.plot-map-marker { width:14px; height:14px; transform:translate(-50%,-4px); border:3px solid var(--bs-body-bg); border-radius:50%; background:var(--line-colour); box-shadow:0 0 0 2px var(--line-colour); z-index:4; }
|
||||
.plot-map-marker.is-accent { border-radius:2px; transform:translate(-50%,-4px) rotate(45deg); }
|
||||
.plot-scene-stem { width:2px; background:var(--bs-secondary-color); z-index:2; }
|
||||
@ -115,7 +115,7 @@
|
||||
.plot-associating #plot-association-status { margin:.25rem 0 0; }
|
||||
.plot-map-callout button:has(.plot-callout-preview:hover), .plot-map-callout button:focus { border-radius:.6rem .6rem 0 0; }
|
||||
.plot-health-summary { display:block; border:0; padding:.1rem 0; background:transparent; color:var(--bs-secondary-color); font-size:.68rem; text-align:left; text-decoration:underline dotted; }
|
||||
.plot-health-position { position:absolute; left:calc(260px + var(--column) * var(--step) + 12px); z-index:1; width:20px; height:20px; line-height:16px; border:1px solid var(--bs-border-color); border-radius:50%; background:var(--bs-body-bg); color:var(--bs-secondary-color); font-size:.8rem; }
|
||||
.plot-health-position { position:absolute; left:calc(var(--plot-map-origin, 260px) + var(--column) * var(--step) + 12px); z-index:1; width:20px; height:20px; line-height:16px; border:1px solid var(--bs-border-color); border-radius:50%; background:var(--bs-body-bg); color:var(--bs-secondary-color); font-size:.8rem; }
|
||||
.plot-associating .plot-health-position { pointer-events:none; opacity:.55; }
|
||||
.plot-health-thread { margin:1rem 0; padding-top:.75rem; border-top:1px solid var(--bs-border-color); }
|
||||
.plot-health-thread h3 { font-size:1.05rem; }
|
||||
@ -128,3 +128,29 @@
|
||||
.plot-lane-label:has(.plot-health-summary) { flex-wrap:wrap; gap:0 .4rem; }
|
||||
.plot-lane-label:has(.plot-health-summary) [data-lane-name], .plot-health-summary { flex:1 0 100%; }
|
||||
.plot-lane-label:has(.plot-health-summary) .plot-associate-action { max-width:100%; white-space:normal; }
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.plot-narrative-map { --plot-map-origin:100px; }
|
||||
.plot-workspace, .plot-map-scroll { min-width:0; max-width:100%; }
|
||||
.plot-lane-label-row { transform:translateY(-70px); }
|
||||
.plot-lane-label-row .plot-lane-label {
|
||||
display:flex; flex-direction:column; align-items:stretch; gap:0;
|
||||
width:52px; height:232px; min-height:232px; padding:96px 0 0;
|
||||
}
|
||||
.plot-lane-label strong.responsive-rail-text {
|
||||
top:0; width:92px; height:44px; max-height:44px; margin:0;
|
||||
white-space:nowrap; overflow-wrap:normal;
|
||||
}
|
||||
.plot-lane-label .plot-colour-edit, .plot-lane-label .plot-associate-action,
|
||||
.plot-lane-label .plot-health-summary {
|
||||
display:grid; place-items:center; flex:0 0 44px; min-height:44px;
|
||||
width:100%; max-width:100%; padding:0; margin:0; font-size:0;
|
||||
}
|
||||
.plot-lane-label .plot-associate-action[hidden] { display:none; }
|
||||
.plot-colour-edit::before { content:'✎'; font-size:1.1rem; }
|
||||
.plot-associate-action::before { content:'+'; font-size:1.3rem; }
|
||||
.plot-health-summary::before { content:'◇'; font-size:1.2rem; }
|
||||
.plot-colour-edit span, .plot-associate-action span {
|
||||
position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7591,3 +7591,48 @@ html[data-standalone="true"] .scene-workspace .scene-workspace-workbench { heigh
|
||||
.scene-workspace[data-scene-area="overview"] .scene-inspector-v2-grid { height: auto; grid-template-rows: none; }
|
||||
.scene-workspace[data-scene-area="overview"] .scene-inspector-v2-card { overflow: visible; }
|
||||
}
|
||||
|
||||
.timeline-project-title > .responsive-rail-text,
|
||||
.metric-lane-label > .responsive-rail-text,
|
||||
.asset-lane-label > .responsive-rail-text { display: contents; }
|
||||
|
||||
/* Content layouts follow viewport width in both browsers and installed apps. */
|
||||
@media (max-width: 767.98px) {
|
||||
.chapter-list { overflow: visible; }
|
||||
.chapter-table, .chapter-table tbody { display: block; width: 100%; }
|
||||
.chapter-table thead {
|
||||
position: absolute; width: 1px; height: 1px; padding: 0;
|
||||
overflow: hidden; clip-path: inset(50%); white-space: nowrap;
|
||||
}
|
||||
.chapter-table tbody tr {
|
||||
display: grid; grid-template-columns: auto minmax(0, 1fr);
|
||||
gap: .5rem .65rem; padding: 1rem 0; border-bottom: 1px solid var(--bs-border-color);
|
||||
}
|
||||
.chapter-table tbody td { padding: 0; border: 0; min-width: 0; width: auto; }
|
||||
.chapter-table .chapter-number, .chapter-table .chapter-title { font-weight: 700; }
|
||||
.chapter-table .chapter-title { overflow-wrap: anywhere; word-break: normal; }
|
||||
.chapter-table .chapter-status, .chapter-table .chapter-manuscript,
|
||||
.chapter-table .chapter-summary, .chapter-table .chapter-actions { grid-column: 1 / -1; }
|
||||
.chapter-table .chapter-summary { overflow-wrap: anywhere; }
|
||||
.chapter-table .chapter-summary:empty { display: none; }
|
||||
.chapter-table .chapter-actions { display: flex; flex-wrap: wrap; gap: .5rem; text-align: start !important; }
|
||||
.chapter-table .chapter-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
|
||||
.chapter-table .archive-button-form { margin: 0; }
|
||||
|
||||
.timeline-filtered-root { --timeline-label-width: 52px; }
|
||||
.timeline-project-title, .metric-lane-label, .asset-lane-label, .character-lane-label {
|
||||
width: var(--timeline-label-width); min-width: 0; min-height: 204px; padding: 0;
|
||||
}
|
||||
/* Rotate ordinary text as a whole. Long names can be scrolled/focused inside the rail. */
|
||||
.timeline-project-title > .responsive-rail-text,
|
||||
.metric-lane-label > .responsive-rail-text,
|
||||
.asset-lane-label > .responsive-rail-text,
|
||||
.responsive-rail-text {
|
||||
display: block;
|
||||
position: absolute; left: 100%; top: 8px; transform-origin: top left;
|
||||
transform: rotate(90deg); width: 188px; max-height: 44px;
|
||||
overflow: auto; padding: 2px 4px; white-space: nowrap;
|
||||
}
|
||||
.responsive-rail-text strong { display: block; white-space: nowrap; overflow-wrap: normal; }
|
||||
.lane-group-heading { overflow-wrap: anywhere; font-size: .65rem; padding-inline: 3px; }
|
||||
}
|
||||
|
||||
@ -137,19 +137,24 @@
|
||||
item.classList.toggle("btn-outline-secondary", !active);
|
||||
});
|
||||
}));
|
||||
document.getElementById("plot-map-zoom")?.addEventListener("change", event => {
|
||||
const layoutMap = () => {
|
||||
const map = document.querySelector(".plot-narrative-map");
|
||||
const step = Number(event.target.value);
|
||||
if (!map) return;
|
||||
const step = Number(document.getElementById("plot-map-zoom")?.value || 224);
|
||||
const offset = parseFloat(getComputedStyle(map).getPropertyValue("--plot-map-origin")) || 260;
|
||||
map.style.setProperty("--step", `${step}px`);
|
||||
map.querySelectorAll("[data-source-column]").forEach(path => {
|
||||
const sx = 260 + Number(path.dataset.sourceColumn) * step;
|
||||
const tx = 260 + Number(path.dataset.targetColumn) * step;
|
||||
const sx = offset + Number(path.dataset.sourceColumn) * step;
|
||||
const tx = offset + Number(path.dataset.targetColumn) * step;
|
||||
const sy = Number(path.dataset.sourceY), ty = Number(path.dataset.targetY);
|
||||
path.setAttribute("d", `M ${sx} ${sy} Q ${(sx + tx) / 2} ${Math.min(sy, ty) - 45} ${tx} ${ty}`);
|
||||
});
|
||||
map.style.width = `${Math.max(900, Number(map.dataset.mapColumns) * step + 260)}px`;
|
||||
map.style.width = `${Math.max(900, Number(map.dataset.mapColumns) * step + offset)}px`;
|
||||
drawMemberships();
|
||||
});
|
||||
};
|
||||
document.getElementById("plot-map-zoom")?.addEventListener("change", layoutMap);
|
||||
window.addEventListener("resize", layoutMap);
|
||||
layoutMap();
|
||||
const selectScene = button => {
|
||||
selectedScene = button.dataset.associateScene;
|
||||
document.querySelectorAll("[data-associate-scene]").forEach(item => item.setAttribute("aria-pressed", String(item === button)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user