Update card production workflow and workspaces
This commit is contained in:
@@ -263,15 +263,14 @@ Card thickness and geometry are unchanged.
|
||||
|
||||
## Finish Masks
|
||||
|
||||
### New Stained-Glass Cards — raw-ridges-v1
|
||||
|
||||
- Approved by the user: September 13, 2026, after comparing The Fall and Burning Bush raw-ridge Normal fixtures.
|
||||
- Default scope: future stained-glass assembly; existing cards/fixtures retain their selected recipes. No migration is requested.
|
||||
- Implementation: [shared production module](../tools/card-production/README.md); exact parameters are pinned in [raw-ridges-v1.json](../tools/card-production/recipes/raw-ridges-v1.json).
|
||||
- Visual behavior: raw ridge confidence protects glass dividers/fine ink, with 62–90% pane coating weights. No subsequent continuity filtering, bridging or manual repair patches.
|
||||
- Resolve each printing’s actual visible components before exporting its finish map. New artwork and other printings receive their own structural/static/moving-light review.
|
||||
- [Approval/reference hashes](../tools/card-production/recipes/raw-ridges-v1-approval.json) and [comparison proof](../spikes/finish-mask-line-continuity-proof/raw-ridges/README.md) preserve the decision.
|
||||
- Runtime shader, material coefficients, texture count and existing optional glyph-mask policy are unchanged by this production recipe.
|
||||
### New Stained-Glass Cards — raw-ridges-v1
|
||||
|
||||
- Restored as the primary recipe after the September 24 Mary Magdalene/Esther comparison. Existing cards and fixtures retain their pinned recipes; no bulk migration is requested.
|
||||
- Implementation: [shared production module](../tools/card-production/README.md); the [raw-ridge recipe](../tools/card-production/recipes/raw-ridges-v1.json) and its [approval/reference hashes](../tools/card-production/recipes/raw-ridges-v1-approval.json) remain unchanged.
|
||||
- Visual behavior: retains more etched and painted detail in garments, but may mistake fabric texture for lead and miss some pale background divisions. Pane coating weights remain 62–90%; inspect these regions per card, including in moving light.
|
||||
- Resolve each printing’s actual visible components before exporting its finish map. New artwork and other printings receive their own structural/static/moving-light review.
|
||||
- `gated-contrast-v1` remains an explicit alternative for a card-local choice. The [Ruth trial](../artifacts/cards/BP-022-ruth/review/finish-mask-trial-01/README.md) and later accepted contrast-based cards keep their historical selection.
|
||||
- Runtime shader, material coefficients, texture count and existing optional glyph-mask policy are unchanged by this production default.
|
||||
|
||||
The following entries document existing fixture recipes.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"finishStrength": 0.6
|
||||
},
|
||||
"Foil": {
|
||||
"finishStrength": 1.0
|
||||
"finishStrength": 1
|
||||
},
|
||||
"Holographic": {
|
||||
"finishStrength": 0.33
|
||||
@@ -27,7 +27,7 @@
|
||||
"roughness": 0.23
|
||||
},
|
||||
"Metal": {
|
||||
"surfaceDetail": 1.0,
|
||||
"surfaceDetail": 1,
|
||||
"roughness": 0.23,
|
||||
"metalBrushHorizontal": false
|
||||
},
|
||||
|
||||
25
card-harness/scripts/responsive-layout.test.mjs
Normal file
25
card-harness/scripts/responsive-layout.test.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
const styles = await readFile(new URL('../src/style.css', import.meta.url), 'utf8')
|
||||
const main = await readFile(new URL('../src/main.ts', import.meta.url), 'utf8')
|
||||
|
||||
test('Pack toolbar is sized for the complete five-control row', () => {
|
||||
assert.match(styles, /\.pack-mode \.toolbar\s*{[^}]*flex:\s*1 1 760px;/s)
|
||||
assert.doesNotMatch(styles, /\.pack-mode \.toolbar\s*{[^}]*flex:\s*0 1 400px;/s)
|
||||
})
|
||||
|
||||
test('short landscape Pack mode protects scene height and offers compact controls', () => {
|
||||
assert.match(styles, /@media \(max-height: 540px\) and \(min-aspect-ratio: 4\/3\)[\s\S]*?\.pack-mode \.topbar\s*{[^}]*flex-wrap:\s*nowrap;/)
|
||||
assert.match(styles, /@media \(max-height: 540px\) and \(min-aspect-ratio: 4\/3\)[\s\S]*?\.pack-mode footer\s*{[^}]*display:\s*none;/)
|
||||
assert.match(styles, /@media \(max-height: 540px\) and \(min-aspect-ratio: 4\/3\) and \(max-width: 1120px\)[\s\S]*?\.pack-mode \.controls-toggle\s*{[^}]*display:\s*inline-flex;/)
|
||||
})
|
||||
|
||||
test('responsive control collapse follows viewport breakpoint changes', () => {
|
||||
assert.match(main, /const narrowControlsMedia = window\.matchMedia\('\(max-width: 880px\)'\)/)
|
||||
assert.match(main, /const shortPackControlsMedia = window\.matchMedia\(/)
|
||||
assert.match(main, /narrowControlsMedia\.addEventListener\('change', syncResponsiveControls\)/)
|
||||
assert.match(main, /shortPackControlsMedia\.addEventListener\('change', syncResponsiveControls\)/)
|
||||
assert.match(main, /mode === 'Pack' && shortPackControlsMedia\.matches/)
|
||||
})
|
||||
@@ -262,7 +262,11 @@ function setControlsCollapsed(collapsed: boolean) {
|
||||
collapsed ? 'v' : '^'
|
||||
}
|
||||
|
||||
setControlsCollapsed(window.matchMedia('(max-width: 880px)').matches)
|
||||
const narrowControlsMedia = window.matchMedia('(max-width: 880px)')
|
||||
const shortPackControlsMedia = window.matchMedia(
|
||||
'(max-height: 540px) and (min-aspect-ratio: 4/3) and (max-width: 1120px)',
|
||||
)
|
||||
setControlsCollapsed(narrowControlsMedia.matches)
|
||||
|
||||
const renderer = new THREE.WebGLRenderer({
|
||||
canvas,
|
||||
@@ -817,6 +821,7 @@ function updateMode() {
|
||||
const previousMode = mode
|
||||
mode = modeSelect.value as AppMode
|
||||
if (previousMode !== mode) {
|
||||
setControlsCollapsed(narrowControlsMedia.matches || (mode === 'Pack' && shortPackControlsMedia.matches))
|
||||
frameTimes.length = 0
|
||||
cpuUpdateTimes.length = 0
|
||||
cpuSubmitTimes.length = 0
|
||||
@@ -833,7 +838,6 @@ function updateMode() {
|
||||
// Freeze the normal pose, including a partially finished flip, while it is hidden.
|
||||
rotationTarget.copy(cardRoot.rotation)
|
||||
loadingElement.hidden = true
|
||||
if (window.matchMedia('(max-width: 880px)').matches) setControlsCollapsed(true)
|
||||
void preparePack()
|
||||
} else {
|
||||
pack?.setActive(false)
|
||||
@@ -1830,6 +1834,12 @@ function animate(frameTime: number) {
|
||||
|
||||
renderer.setAnimationLoop(animate)
|
||||
window.addEventListener('resize', resizeRenderer)
|
||||
const syncResponsiveControls = () => {
|
||||
setControlsCollapsed(narrowControlsMedia.matches || (mode === 'Pack' && shortPackControlsMedia.matches))
|
||||
requestAnimationFrame(resizeRenderer)
|
||||
}
|
||||
narrowControlsMedia.addEventListener('change', syncResponsiveControls)
|
||||
shortPackControlsMedia.addEventListener('change', syncResponsiveControls)
|
||||
new ResizeObserver(resizeRenderer).observe(canvas)
|
||||
orbit.addEventListener('change', () => renderCadence.invalidate())
|
||||
// Capture before handlers mutate controls or poses. Async asset completion also
|
||||
|
||||
@@ -390,7 +390,9 @@ button:disabled {
|
||||
.pack-mode .toolbar .variant-control { display: grid; }
|
||||
|
||||
.pack-mode .toolbar {
|
||||
flex: 0 1 400px;
|
||||
/* Pack currently exposes five controls. Keep enough intrinsic width for one
|
||||
row instead of retaining the old two-control, 400px layout. */
|
||||
flex: 1 1 760px;
|
||||
}
|
||||
|
||||
.pack-mode .hint {
|
||||
@@ -413,6 +415,13 @@ button:disabled {
|
||||
flex-basis: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/* The compact Pack toolbar still fits beside the title at desktop widths.
|
||||
This pack-specific rule also prevents the base flex shorthand from
|
||||
accidentally defeating responsive flex-basis changes. */
|
||||
.pack-mode .toolbar {
|
||||
flex-basis: 760px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 880px) {
|
||||
@@ -542,6 +551,47 @@ button:disabled {
|
||||
}
|
||||
|
||||
@media (max-height: 540px) and (min-aspect-ratio: 4/3) {
|
||||
.pack-mode .topbar {
|
||||
flex-wrap: nowrap;
|
||||
align-items: flex-end;
|
||||
gap: 12px;
|
||||
min-height: 0;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
.pack-mode .title-row {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.pack-mode .eyebrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pack-mode h1 {
|
||||
font-size: 18px;
|
||||
line-height: 34px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pack-mode .toolbar {
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: nowrap;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.pack-mode .toolbar label {
|
||||
flex: 1 1 110px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pack-mode .toolbar .pack-style {
|
||||
flex: 1.5 1 170px;
|
||||
}
|
||||
|
||||
.pack-mode footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pack-controls {
|
||||
right: 12px;
|
||||
left: auto;
|
||||
@@ -583,3 +633,24 @@ button:disabled {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 540px) and (min-aspect-ratio: 4/3) and (max-width: 1120px) {
|
||||
.pack-mode .topbar {
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.pack-mode .title-row {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pack-mode .controls-toggle {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.pack-mode .toolbar {
|
||||
flex-basis: 100%;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
import { createReadStream } from 'node:fs'
|
||||
import { stat } from 'node:fs/promises'
|
||||
import { relative, sep } from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import { acceptedCardsRoot, resolveCardAssetRequest, scanCardCatalog } from './scripts/card-catalog.mjs'
|
||||
import { readSurfaceDefaults, surfaceDefaultsPath, updateSurfaceDefaults } from './scripts/surface-defaults.mjs'
|
||||
|
||||
const resolutionDirectories = new Set(['low', 'med', 'high'])
|
||||
|
||||
function ignoreGeneratedCardArtifact(path) {
|
||||
const fromCardsRoot = relative(acceptedCardsRoot, path)
|
||||
if (!fromCardsRoot || fromCardsRoot === '..' || fromCardsRoot.startsWith(`..${sep}`)) return false
|
||||
const parts = fromCardsRoot.split(sep)
|
||||
if (parts.length === 1) return false // Keep card directories to discover new cards.
|
||||
if (parts.length === 2) {
|
||||
return !['card.json', 'manifest.json'].includes(parts[1]) && !resolutionDirectories.has(parts[1])
|
||||
}
|
||||
return parts.length !== 3 || !resolutionDirectories.has(parts[1]) || parts[2] !== 'manifest.json'
|
||||
}
|
||||
|
||||
function json(response, status, value) {
|
||||
response.statusCode = status
|
||||
response.setHeader('Content-Type', 'application/json')
|
||||
@@ -91,4 +105,7 @@ function cardLibraryPlugin() {
|
||||
configurePreviewServer(server) { installRoutes(server, false) },
|
||||
}
|
||||
}
|
||||
export default defineConfig({ plugins: [cardLibraryPlugin()] })
|
||||
export default defineConfig({
|
||||
plugins: [cardLibraryPlugin()],
|
||||
server: { watch: { ignored: ignoreGeneratedCardArtifact } },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user