- commit
- 1f9c6011c1f03eeffd0dfba4ab89fc8b4e8812b5
- parent
- 71eca4f158b28cd252c964f15208cee52437752a
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 12 | ++++++------ |
| M | tests/ | 10 | ++++++---- |
@@ -70,7 +70,7 @@ export function createWorkshopScene(options = {}) {
7070 function view() {7171 const row = selectedRow();7272 return {73- id: 'workshop', eyebrow: 'WORKSHOP', title: "packs of proofs you've added",73+ id: 'workshop', eyebrow: 'WORKSHOP', title: "Packs of proofs you've added",7474 rows: rows().map(item => ({ id: item.id, type: item.type, label: item.type === 'pack' ? item.pack.manifest?.name || item.pack.name || item.id : item.label, actions: [...item.actions] })),7575 selectedRow: rowIndex, selectedAction: actionIndex, selectedActionName: row?.actions[actionIndex] || null,7676 feedback: feedback ? { ...feedback, errors: feedback.errors ? [...feedback.errors] : [] } : null,@@ -196,14 +196,14 @@ export function createWorkshopScene(options = {}) {
196196 const margin = compact ? 24 : 48;197197 drawText(ctx, 'WORKSHOP', margin, compact ? 30 : 48, 13, colors.muted, 'left', 800);198198 if (compact) {199- drawText(ctx, 'packs of proofs', margin, 76, 24, colors.fg, 'left', 850);199+ drawText(ctx, 'Packs of proofs', margin, 76, 24, colors.fg, 'left', 850);200200 drawText(ctx, "you've added", margin, 105, 24, colors.fg, 'left', 850);201201 let hintX = width - margin;202202 for (const [key, verb] of [['ESC', 'back'], ['ENTER', 'select']]) hintX = drawKeyHint(ctx, key, verb, hintX, 145, colors);203203 hintX = width - margin;204204 for (const [key, verb] of [['←→', 'action'], ['↑↓', 'choose']]) hintX = drawKeyHint(ctx, key, verb, hintX, 173, colors);205205 } else {206- drawText(ctx, "packs of proofs you've added", margin, 86, 28, colors.fg, 'left', 850);206+ drawText(ctx, "Packs of proofs you've added", margin, 86, 28, colors.fg, 'left', 850);207207 let hintX = width - margin;208208 for (const [key, verb] of [['ESC', 'back'], ['ENTER', 'select'], ['←→', 'action'], ['↑↓', 'choose']]) hintX = drawKeyHint(ctx, key, verb, hintX, 48, colors);209209 }@@ -224,7 +224,7 @@ export function createWorkshopScene(options = {}) {
224224 hitLayout.rows.push({ index, id: row.id, type: row.type, y, height: rowHeight - 10, actions: cells });225225 ctx.fillStyle = selected ? colors.YOU : colors.raised; ctx.fillRect(cardX, y, cardWidth, rowHeight - 10);226226 ctx.strokeStyle = selected ? colors.YOU : colors.edge; ctx.lineWidth = 1; ctx.strokeRect(cardX, y, cardWidth, rowHeight - 10);227- drawText(ctx, row.type === 'import' ? '+' : String(index).padStart(2, '0'), compact ? cardX + 20 : 70, y + 26, 16, selected ? colors.ink : colors.muted, 'left', 850);227+ drawText(ctx, row.type === 'import' ? '+' : String(index).padStart(2, '0'), compact ? cardX + 20 : 70, y + (row.type === 'import' ? (rowHeight - 10) / 2 : 26), 16, selected ? colors.ink : colors.muted, 'left', 850);228228 if (row.type === 'import') {229229 drawText(ctx, row.label, compact ? cardX + 62 : 110, y + (rowHeight - 10) / 2, 16, selected ? colors.ink : colors.fg, 'left', 850);230230 } else {@@ -266,7 +266,7 @@ export function createWorkshopScene(options = {}) {
266266 }267267 268268 return Object.freeze({269- id: 'workshop', eyebrow: 'WORKSHOP', title: "packs of proofs you've added", prompt: 'IMPORT | PLAY | SHARE | EXPORT', help: 'ARROWS CHOOSE ENTER SELECT ESC BACK',269+ id: 'workshop', eyebrow: 'WORKSHOP', title: "Packs of proofs you've added", prompt: 'IMPORT | PLAY | SHARE | EXPORT', help: 'ARROWS CHOOSE ENTER SELECT ESC BACK',270270 draw, view, refresh, move, handleInput, hit, activate, copyDetails, showErrors,271271 get selectedRow() { return rowIndex; }, get selectedAction() { return actionIndex; },272272 get hitLayout() { return hitLayout ? clone(hitLayout) : null; },@@ -275,6 +275,6 @@ export function createWorkshopScene(options = {}) {
275275 276276 // Kept for the existing scene registry; the canvas controller is created by277277 // the stage with createWorkshopScene when it has a catalog/service available.278-export const workshopScene = { id: 'workshop', eyebrow: 'WORKSHOP', title: 'Packs of proofs', prompt: 'IMPORT | PLAY | SHARE | EXPORT', help: 'ARROWS CHOOSE ENTER SELECT ESC BACK' };278+export const workshopScene = { id: 'workshop', eyebrow: 'WORKSHOP', title: "Packs of proofs you've added", prompt: 'IMPORT | PLAY | SHARE | EXPORT', help: 'ARROWS CHOOSE ENTER SELECT ESC BACK' };279279 280280 export default createWorkshopScene;@@ -144,9 +144,9 @@ test('mobile Workshop keeps header and pack actions within the viewport while se
144144 const ctx = canvasContext();145145 scene.draw(ctx, { width: 390, height: 844 });146146 const labels = ctx.calls.filter(call => call[0] === 'fillText').map(call => call[1]);147- assert.ok(labels.includes('packs of proofs'));147+ assert.ok(labels.includes('Packs of proofs'));148148 assert.ok(labels.includes("you've added"));149- assert.ok(!labels.includes("packs of proofs you've added"));149+ assert.ok(!labels.includes("Packs of proofs you've added"));150150 for (const row of scene.hitLayout.rows) {151151 for (const action of row.actions) {152152 assert.ok(action.x >= 24 && action.x + action.width <= 366);@@ -165,7 +165,9 @@ test('IMPORT label is vertically centered in its row', () => {
165165 const ctx = canvasContext();166166 scene.draw(ctx, { width: 800, height: 600 });167167 const importLabel = ctx.calls?.find(call => call[0] === 'fillText' && call[1] === 'IMPORT…');168+ const importIcon = ctx.calls?.find(call => call[0] === 'fillText' && call[1] === '+');168169 assert.equal(importLabel[3], 167);170+ assert.equal(importIcon[3], importLabel[3]);169171 });170172 171173 test('header hints render keycaps before lowercase verbs', () => {@@ -182,11 +184,11 @@ test('uses deck copy, resolves COPY OF to a source name, and uses sentence case
182184 makePack('source'),183185 { ...makePack('fork'), forkOf: 'source', manifest: { ...makePack('fork').manifest, name: 'Fork' } },184186 ] });185- assert.equal(scene.view().title, "packs of proofs you've added");187+ assert.equal(scene.view().title, "Packs of proofs you've added");186188 const ctx = canvasContext();187189 scene.draw(ctx, { width: 800, height: 600 });188190 const labels = ctx.calls.filter(call => call[0] === 'fillText').map(call => call[1]);189- assert.ok(labels.includes("packs of proofs you've added"));191+ assert.ok(labels.includes("Packs of proofs you've added"));190192 assert.ok(labels.includes('COPY OF SOURCE'));191193 assert.equal(labels.includes('COPY OF source'), false);192194 scene.showErrors([{ message: 'bad pack', detail: 'detail' }]);