Skip to content

Commit 474f233

Browse files
committed
fix(theme-cricket): stabilize player score slot
1 parent b420891 commit 474f233

11 files changed

Lines changed: 135 additions & 22 deletions

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ zum nächsten Release-Commit vorübergehend auf `HEAD` zeigen.
1212
Dieses Repository führt keine `Unreleased`-Sektion. Jeder dokumentierte Eintrag gehört
1313
direkt zu einer versionierten Release-Sektion.
1414

15+
## [2.3.3] - 2026-04-25
16+
17+
### Fixed
18+
19+
- Nutzerwirkung: Im Cricket-Template bleibt die Punkteanzeige pro Spieler stabiler sichtbar, auch wenn Autodarts einzelne Spielerkarten oder Score-Wrapper waehrend des Spiels neu aufbaut; besonders Karten ab der zweiten Spalte verlieren den Score dadurch nicht mehr bis zum naechsten Reload.
20+
Technik: Die Cricket-Readability-Normalisierung markiert direkte Score-Knoten und gewrappte Score-Container als eigenen `score`-Slot, das Cricket-Theme richtet diesen Slot unabhaengig von der aktuellen Host-DOM-Form im Spieler-Grid aus, und neue Runtime-Regressionen sichern gewrappte Reported-Player-Scores sowie den CSS-Slot-Vertrag ab.
21+
1522
## [2.3.2] - 2026-04-24
1623

1724
### Changed
@@ -1480,7 +1487,8 @@ direkt zu einer versionierten Release-Sektion.
14801487
und Regressionstests eingeführt und die generierten README-/FEATURES-Texte wurden
14811488
entsprechend synchronisiert.
14821489

1483-
[2.3.2]: https://github.com/thomasasen/autodarts-xconfig/compare/7b4351b...HEAD
1490+
[2.3.3]: https://github.com/thomasasen/autodarts-xconfig/compare/b420891...HEAD
1491+
[2.3.2]: https://github.com/thomasasen/autodarts-xconfig/compare/7b4351b...b420891
14841492
[2.3.1]: https://github.com/thomasasen/autodarts-xconfig/compare/d17c15d...7b4351b
14851493
[2.3.0]: https://github.com/thomasasen/autodarts-xconfig/compare/da0d5b1...d17c15d
14861494
[2.2.0]: https://github.com/thomasasen/autodarts-xconfig/compare/6398977...da0d5b1

dist/autodarts-xconfig.meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name autodarts-xconfig
33
// @namespace https://github.com/thomasasen/autodarts-xconfig
4-
// @version 2.3.2
4+
// @version 2.3.3
55
// @description Modular, side-effect resistant Tampermonkey runtime for Autodarts enhancements.
66
// @author Thomas Asen
77
// @license MIT

dist/autodarts-xconfig.user.js

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name autodarts-xconfig
33
// @namespace https://github.com/thomasasen/autodarts-xconfig
4-
// @version 2.3.2
4+
// @version 2.3.3
55
// @description Modular, side-effect resistant Tampermonkey runtime for Autodarts enhancements.
66
// @author Thomas Asen
77
// @license MIT
@@ -30733,11 +30733,15 @@ ${HOST_SELECTOR}.${ACTIVE_CLASS} .${FILL_CLASS}.ad-ext-x01-score-progress__fill-
3073330733
const badgeNode = findClosestDescendant(stackNode, ".chakra-badge");
3073430734
const avatarNode = findClosestDescendant(stackNode, ".chakra-avatar") || findClosestDescendant(stackNode, ".chakra-avatar__img");
3073530735
const scoreNode = findClosestDescendant(stackNode, ".ad-ext-player-score");
30736+
const scoreSlot = findOwningChild(stackNode, scoreNode) || scoreNode;
30737+
if (scoreSlot) {
30738+
setMarkerAttribute(scoreSlot, CRICKET_SLOT_ATTRIBUTE, "score");
30739+
}
3073630740
const rowNode = resolveCricketPlayerRowContainer(stackNode, [nameNode, badgeNode, avatarNode]);
3073730741
if (rowNode && rowNode !== stackNode) {
3073830742
setMarkerAttribute(rowNode, CRICKET_ROW_ATTRIBUTE);
3073930743
}
30740-
const statsNode = resolveCricketStatsSlot(stackNode, rowNode, scoreNode);
30744+
const statsNode = resolveCricketStatsSlot(stackNode, rowNode, scoreSlot || scoreNode);
3074130745
if (statsNode) {
3074230746
setMarkerAttribute(statsNode, CRICKET_SLOT_ATTRIBUTE, "stats");
3074330747
}
@@ -30747,11 +30751,11 @@ ${HOST_SELECTOR}.${ACTIVE_CLASS} .${FILL_CLASS}.ad-ext-x01-score-progress__fill-
3074730751
const rowChildren = getElementChildren3(rowNode);
3074830752
identitySlot = rowChildren.find((child) => nodeContainsAnyTarget(child, [nameNode, badgeNode, avatarNode])) || (nodeContainsAnyTarget(rowNode, [nameNode, badgeNode, avatarNode]) ? rowNode : null);
3074930753
marksSlot = rowChildren.find((child) => {
30750-
return child !== identitySlot && !nodeContainsAnyTarget(child, [scoreNode, statsNode]);
30754+
return child !== identitySlot && !nodeContainsAnyTarget(child, [scoreSlot, scoreNode, statsNode]);
3075130755
}) || null;
3075230756
}
3075330757
if (!identitySlot) {
30754-
const directChildren = getElementChildren3(stackNode).filter((child) => child !== scoreNode);
30758+
const directChildren = getElementChildren3(stackNode).filter((child) => child !== scoreSlot);
3075530759
identitySlot = directChildren.find((child) => nodeContainsAnyTarget(child, [nameNode, badgeNode, avatarNode])) || null;
3075630760
}
3075730761
if (marksSlot) {
@@ -30762,7 +30766,7 @@ ${HOST_SELECTOR}.${ACTIVE_CLASS} .${FILL_CLASS}.ad-ext-x01-score-progress__fill-
3076230766
normalizeCricketIdentitySlot(identitySlot);
3076330767
}
3076430768
getElementChildren3(stackNode).forEach((child) => {
30765-
if (child === scoreNode || child === rowNode || child === statsNode) {
30769+
if (child === scoreSlot || child === scoreNode || child === rowNode || child === statsNode) {
3076630770
return;
3076730771
}
3076830772
if (child.getAttribute?.(CRICKET_SLOT_ATTRIBUTE)) {
@@ -30775,6 +30779,7 @@ ${HOST_SELECTOR}.${ACTIVE_CLASS} .${FILL_CLASS}.ad-ext-x01-score-progress__fill-
3077530779
rowNode,
3077630780
identitySlot,
3077730781
marksSlot,
30782+
scoreSlot,
3077830783
statsNode
3077930784
};
3078030785
}
@@ -35189,6 +35194,7 @@ p.chakra-text.css-1j0bqop{
3518935194
var SLOT_MARKS_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="marks"]`;
3519035195
var SLOT_IDENTITY_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="identity"]`;
3519135196
var SLOT_STATS_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="stats"]`;
35197+
var SLOT_SCORE_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="score"]`;
3519235198
var SLOT_DECORATIVE_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="decorative"]`;
3519335199
var META_AVATAR_SELECTOR = `[${CRICKET_META_ATTRIBUTE}="avatar"]`;
3519435200
var META_NAME_SELECTOR = `[${CRICKET_META_ATTRIBUTE}="name"]`;
@@ -35548,7 +35554,8 @@ p.chakra-text.css-1j0bqop{
3554835554
display: none !important;
3554935555
}
3555035556

35551-
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > .ad-ext-player-score {
35557+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > .ad-ext-player-score,
35558+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > ${SLOT_SCORE_SELECTOR} {
3555235559
grid-area: score !important;
3555335560
grid-column: 3 !important;
3555435561
grid-row: 2 / 6 !important;
@@ -35564,6 +35571,18 @@ p.chakra-text.css-1j0bqop{
3556435571
z-index: 3 !important;
3556535572
}
3556635573

35574+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > ${SLOT_SCORE_SELECTOR}:not(.ad-ext-player-score) {
35575+
display: flex !important;
35576+
align-items: center !important;
35577+
justify-content: flex-end !important;
35578+
min-inline-size: var(--ad-ext-theme-cricket-score-min-width) !important;
35579+
inline-size: max-content !important;
35580+
}
35581+
35582+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > ${SLOT_SCORE_SELECTOR}:not(.ad-ext-player-score) .ad-ext-player-score {
35583+
margin-inline-end: 0 !important;
35584+
}
35585+
3556735586
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR4} > ${SLOT_STATS_SELECTOR} > p {
3556835587
font-size: clamp(1.01rem, 1.14vw, 1.21rem) !important;
3556935588
line-height: 1.15 !important;
@@ -37895,7 +37914,7 @@ span.css-3fr5p8{
3789537914

3789637915
// src/core/bootstrap.js
3789737916
var GLOBAL_NAMESPACE_KEY = "__adXConfig";
37898-
var API_VERSION = "2.3.2";
37917+
var API_VERSION = "2.3.3";
3789937918
var STARTUP_DEFER_INTERVAL_MS = 16;
3790037919
function getWindowTimerApi(windowRef) {
3790137920
let setTimeoutRef = null;

loader/autodarts-xconfig.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name autodarts-xconfig
33
// @namespace https://github.com/thomasasen/autodarts-xconfig
4-
// @version 2.3.2
4+
// @version 2.3.3
55
// @description Modular, side-effect resistant Tampermonkey runtime for Autodarts enhancements.
66
// @author Thomas Asen
77
// @license MIT

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "autodarts-xconfig",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "Clean successor architecture for autodarts xConfig userscript modules",
55
"type": "module",
66
"imports": {

src/core/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { createListenerRegistry } from "./listener-registry.js";
1313
import { createObserverRegistry } from "./observer-registry.js";
1414

1515
const GLOBAL_NAMESPACE_KEY = "__adXConfig";
16-
const API_VERSION = "2.3.2";
16+
const API_VERSION = "2.3.3";
1717
const STARTUP_DEFER_INTERVAL_MS = 16;
1818

1919
function getWindowTimerApi(windowRef) {

src/features/themes/cricket/style.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const ROW_SELECTOR = `[${CRICKET_ROW_ATTRIBUTE}="true"]`;
2929
const SLOT_MARKS_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="marks"]`;
3030
const SLOT_IDENTITY_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="identity"]`;
3131
const SLOT_STATS_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="stats"]`;
32+
const SLOT_SCORE_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="score"]`;
3233
const SLOT_DECORATIVE_SELECTOR = `[${CRICKET_SLOT_ATTRIBUTE}="decorative"]`;
3334
const META_AVATAR_SELECTOR = `[${CRICKET_META_ATTRIBUTE}="avatar"]`;
3435
const META_NAME_SELECTOR = `[${CRICKET_META_ATTRIBUTE}="name"]`;
@@ -389,7 +390,8 @@ const cricketThemeCss = `
389390
display: none !important;
390391
}
391392
392-
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > .ad-ext-player-score {
393+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > .ad-ext-player-score,
394+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > ${SLOT_SCORE_SELECTOR} {
393395
grid-area: score !important;
394396
grid-column: 3 !important;
395397
grid-row: 2 / 6 !important;
@@ -405,6 +407,18 @@ const cricketThemeCss = `
405407
z-index: 3 !important;
406408
}
407409
410+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > ${SLOT_SCORE_SELECTOR}:not(.ad-ext-player-score) {
411+
display: flex !important;
412+
align-items: center !important;
413+
justify-content: flex-end !important;
414+
min-inline-size: var(--ad-ext-theme-cricket-score-min-width) !important;
415+
inline-size: max-content !important;
416+
}
417+
418+
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > ${SLOT_SCORE_SELECTOR}:not(.ad-ext-player-score) .ad-ext-player-score {
419+
margin-inline-end: 0 !important;
420+
}
421+
408422
#ad-ext-player-display .ad-ext-player > ${STACK_SELECTOR} > ${SLOT_STATS_SELECTOR} > p {
409423
font-size: clamp(1.01rem, 1.14vw, 1.21rem) !important;
410424
line-height: 1.15 !important;

src/features/themes/shared/cricket-readability.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,13 +1364,17 @@ function normalizeCricketPlayerCard(playerNode) {
13641364
findClosestDescendant(stackNode, ".chakra-avatar") ||
13651365
findClosestDescendant(stackNode, ".chakra-avatar__img");
13661366
const scoreNode = findClosestDescendant(stackNode, ".ad-ext-player-score");
1367+
const scoreSlot = findOwningChild(stackNode, scoreNode) || scoreNode;
1368+
if (scoreSlot) {
1369+
setMarkerAttribute(scoreSlot, CRICKET_SLOT_ATTRIBUTE, "score");
1370+
}
13671371

13681372
const rowNode = resolveCricketPlayerRowContainer(stackNode, [nameNode, badgeNode, avatarNode]);
13691373
if (rowNode && rowNode !== stackNode) {
13701374
setMarkerAttribute(rowNode, CRICKET_ROW_ATTRIBUTE);
13711375
}
13721376

1373-
const statsNode = resolveCricketStatsSlot(stackNode, rowNode, scoreNode);
1377+
const statsNode = resolveCricketStatsSlot(stackNode, rowNode, scoreSlot || scoreNode);
13741378
if (statsNode) {
13751379
setMarkerAttribute(statsNode, CRICKET_SLOT_ATTRIBUTE, "stats");
13761380
}
@@ -1384,12 +1388,12 @@ function normalizeCricketPlayerCard(playerNode) {
13841388
(nodeContainsAnyTarget(rowNode, [nameNode, badgeNode, avatarNode]) ? rowNode : null);
13851389
marksSlot =
13861390
rowChildren.find((child) => {
1387-
return child !== identitySlot && !nodeContainsAnyTarget(child, [scoreNode, statsNode]);
1391+
return child !== identitySlot && !nodeContainsAnyTarget(child, [scoreSlot, scoreNode, statsNode]);
13881392
}) || null;
13891393
}
13901394

13911395
if (!identitySlot) {
1392-
const directChildren = getElementChildren(stackNode).filter((child) => child !== scoreNode);
1396+
const directChildren = getElementChildren(stackNode).filter((child) => child !== scoreSlot);
13931397
identitySlot =
13941398
directChildren.find((child) => nodeContainsAnyTarget(child, [nameNode, badgeNode, avatarNode])) ||
13951399
null;
@@ -1404,7 +1408,7 @@ function normalizeCricketPlayerCard(playerNode) {
14041408
}
14051409

14061410
getElementChildren(stackNode).forEach((child) => {
1407-
if (child === scoreNode || child === rowNode || child === statsNode) {
1411+
if (child === scoreSlot || child === scoreNode || child === rowNode || child === statsNode) {
14081412
return;
14091413
}
14101414
if (child.getAttribute?.(CRICKET_SLOT_ATTRIBUTE)) {
@@ -1418,6 +1422,7 @@ function normalizeCricketPlayerCard(playerNode) {
14181422
rowNode,
14191423
identitySlot,
14201424
marksSlot,
1425+
scoreSlot,
14211426
statsNode,
14221427
};
14231428
}

tests/runtime/theme-cricket-style.test.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ test("cricket theme uses the stable cricket-card attribute contract and readabil
9292
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > ${attrSelector(CRICKET_SLOT_ATTRIBUTE, "stats")} {`
9393
)
9494
);
95+
assert.ok(
96+
css.includes(
97+
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > ${attrSelector(CRICKET_SLOT_ATTRIBUTE, "score")} {`
98+
)
99+
);
95100
assert.ok(
96101
css.includes(
97102
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > ${attrSelector(CRICKET_SLOT_ATTRIBUTE, "decorative")} {`
@@ -165,11 +170,19 @@ test("cricket theme keeps row labels fully visible inside viewport", () => {
165170
test("cricket theme keeps score and active-card hierarchy on stable selectors", () => {
166171
const css = buildCricketThemeCss({ showAvg: true });
167172

173+
assert.match(
174+
css,
175+
/#ad-ext-player-display\s+\.ad-ext-player\s*>\s*\[data-ad-ext-cricket-stack="true"\]\s*>\s*\.ad-ext-player-score,\s*#ad-ext-player-display\s+\.ad-ext-player\s*>\s*\[data-ad-ext-cricket-stack="true"\]\s*>\s*\[data-ad-ext-cricket-slot="score"\]\s*\{/s
176+
);
168177
assert.ok(
169178
css.includes(
170-
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > .ad-ext-player-score {`
179+
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > ${attrSelector(CRICKET_SLOT_ATTRIBUTE, "score")} {`
171180
)
172181
);
182+
assert.match(
183+
css,
184+
/#ad-ext-player-display\s+\.ad-ext-player\s*>\s*\[data-ad-ext-cricket-stack="true"\]\s*>\s*\[data-ad-ext-cricket-slot="score"\]:not\(\.ad-ext-player-score\)\s*\{[^}]*display:\s*flex\s*!important;[^}]*justify-content:\s*flex-end\s*!important;[^}]*inline-size:\s*max-content\s*!important;/s
185+
);
173186
assert.match(
174187
css,
175188
/#ad-ext-player-display\s+\.ad-ext-player\s+\.ad-ext-player-score\s*\{[^}]*inline-size:\s*max-content\s*!important;[^}]*max-inline-size:\s*none\s*!important;[^}]*overflow:\s*visible\s*!important;[^}]*text-overflow:\s*initial\s*!important;/s
@@ -295,7 +308,7 @@ test("cricket theme keeps score and active-card hierarchy on stable selectors",
295308
);
296309
const scoreSlotRule = extractRuleSlice(
297310
css,
298-
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > .ad-ext-player-score {`
311+
`#ad-ext-player-display .ad-ext-player > ${attrSelector(CRICKET_STACK_ATTRIBUTE)} > ${attrSelector(CRICKET_SLOT_ATTRIBUTE, "score")} {`
299312
);
300313
assert.match(scoreSlotRule, /grid-row:\s*2\s*\/\s*6\s*!important;/);
301314
assert.match(scoreSlotRule, /align-self:\s*center\s*!important;/);

0 commit comments

Comments
 (0)