feedback5 R5: split the match screen's standalone pieces out
The match-ended plate, the solo pause plate, the highlight styles and keepEarly now live in public/js/screens/game/*.js. game.js stays the screen entry. MatchScreen stays one component. Imports only those pieces used moved with them. Two source pins follow the lines that moved.
This commit is contained in:
1 parent
aaef748ad9
commit
dd07dc1ec1
6 files changed
+65
-48
No files matched your search
@@ -234,7 +234,8 @@ test('a hidden-tab backlog still beyond HELD_MAX after compaction: the first fra
|
||||
|
||||
test('screens/game.js buffers the form fx with the state-bearing events it replays when a field is entered late', () => {
|
||||
const src = readFileSync(path.join(ROOT, 'public/js/screens/game.js'), 'utf8');
|
||||
assert.match(src, /const keepEarly = \(e\) => Array\.isArray\(e\) && \(STATE_EV\.has\(e\[0\]\) \|\| fxForm\(e\) !== undefined\);/);
|
||||
const early = readFileSync(path.join(ROOT, 'public/js/screens/game/early.js'), 'utf8');
|
||||
assert.match(early, /const keepEarly = \(e\) => Array\.isArray\(e\) && \(STATE_EV\.has\(e\[0\]\) \|\| fxForm\(e\) !== undefined\);/);
|
||||
assert.match(src, /for \(const e of msg\.ev\) if \(keepEarly\(e\)\) buf\.push\(e\);/);
|
||||
// a new m.field for the field on screen buffers its frames until the enter effect re-enters it (enterBattle resets)
|
||||
assert.match(src, /if \(msg\.fieldId === lastFieldRef\.current\) reentryRef\.current = msg\.fieldId;/);
|
||||
|
||||
@@ -171,6 +171,6 @@ describe('shop bar: the merge tag and the armed card', () => {
|
||||
assert.match(src, /onArm=\$\{setArmedCard\}/, 'ShopBar reports the armed card');
|
||||
assert.match(src, /mergeTarget\(priv, armedCard\.id, gd\.chess\)/, 'the target comes from gameLogic.mergeTarget');
|
||||
assert.match(src, /view\.highlightTiles\(mergeAt \? \[\[mergeAt\.row, mergeAt\.col\]\] : \[\], MERGE_HL\)/, 'its own highlight group (cleared with [])');
|
||||
assert.match(src, /const MERGE_HL = Object\.freeze\(\{ group: 'mergeTile'/);
|
||||
assert.match(read('public/js/screens/game/marks.js'), /const MERGE_HL = Object\.freeze\(\{ group: 'mergeTile'/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user