Workers P4 Endprüfung W6: „Schließen“ im Interessenten-Panel ist am Handy 40 px hoch
Die gemeinsame Regel `.dialog-foot .btn` (32 px) gilt für rund 22 Dialoge der Seite und bleibt unberührt. Das Panel gibt seinem Knopf die Klasse wk-prospect-close; im Handy-Block von workers.css hebt `.wk-prospect-close.btn[type="button"]` (Spezifität 0,3,0 gegen 0,2,0, beginnt mit einer wk-Klasse wie workersCss.test.mjs es verlangt) ihn auf volle Breite und 40 px. Der Desktop behält 32 px. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c974ab6db
commit
d29cc29d47
3 files changed
+22
-1
No files matched your search
@@ -123,7 +123,7 @@ export default function ProspectPanel({ api, prospectId, onClose }) {
|
||||
title={view ? view.title : 'Interessent'}
|
||||
onClose={onClose}
|
||||
wide
|
||||
footer={<Button type="button" onClick={onClose}>Schließen</Button>}
|
||||
footer={<Button type="button" className="wk-prospect-close" onClick={onClose}>Schließen</Button>}
|
||||
>
|
||||
{body}
|
||||
</Dialog>
|
||||
|
||||
@@ -259,6 +259,10 @@
|
||||
/* Hauptknopf oben, „Abbrechen“ darunter */
|
||||
.wk-pult-panel-btns { flex-direction: column-reverse; align-items: stretch; }
|
||||
.wk-pult-panel-foot .btn { width: 100%; min-height: 40px; justify-content: center; text-align: center; }
|
||||
/* „Schließen“ im Fuß des Interessenten-Panels: `.dialog-foot .btn` (global.css, 32 px) gilt für alle Dialoge und bleibt; hier nur der eigene Knopf auf 40 px.
|
||||
Der Dialog hängt nicht unter einer wk-Klasse, die Regel beginnt deshalb mit der Klasse des Knopfs. Mit (0,3,0) (Klasse, Klasse, Attribut) gewinnt sie
|
||||
gegen (0,2,0), gleich in welcher Reihenfolge die Dateien geladen werden. */
|
||||
.wk-prospect-close.btn[type="button"] { width: 100%; min-height: 40px; justify-content: center; }
|
||||
}
|
||||
|
||||
/* ---------- Weniger Bewegung ---------- */
|
||||
|
||||
@@ -430,3 +430,20 @@ test('CSS: wk-pult-text bricht Zeilen wie im Text (pre-wrap) und lange Wörter u
|
||||
const jsx = read('src/components/workers/ProspectPanel.jsx')
|
||||
for (const m of jsx.matchAll(/(?<![\w-])wk-[a-z0-9-]+/g)) assert.ok(css.includes('.' + m[0]), m[0])
|
||||
})
|
||||
|
||||
// Endprüfung P4 (W6): „Schließen“ im Fuß des Panels ist am Handy mindestens 40 px hoch. Die gemeinsame Regel `.dialog-foot .btn` (32 px) bleibt für die
|
||||
// übrigen Dialoge unverändert; die Hustler-Seite hebt nur ihren eigenen Knopf an (Klasse wk-prospect-close, Spezifität (0,3,0) gegen (0,2,0); die Regel
|
||||
// beginnt mit einer wk-Klasse, wie workersCss.test.mjs es für jede Regel dieser Datei verlangt).
|
||||
test('ProspectPanel (W6): der Schließen-Knopf trägt wk-prospect-close; die Handy-Regel macht ihn 40 px hoch, die Dialog-Regel bleibt unverändert', () => {
|
||||
const jsx = read('src/components/workers/ProspectPanel.jsx')
|
||||
assert.match(jsx, /<Button type="button" className="wk-prospect-close" onClick=\{onClose\}>Schließen<\/Button>/)
|
||||
const css = read('src/styles/workers.css').replace(/\/\*[\s\S]*?\*\//g, '')
|
||||
const phone = css.slice(css.indexOf('@media (max-width: 860px)'), css.indexOf('@media (prefers-reduced-motion'))
|
||||
const rule = phone.match(/\.wk-prospect-close\.btn\[type="button"\]\s*\{([^}]*)\}/)?.[1] ?? ''
|
||||
assert.match(rule, /min-height:\s*40px/); assert.match(rule, /width:\s*100%/)
|
||||
// nirgends außerhalb des Handy-Blocks (der Desktop behält 32 px) und keine Änderung an der gemeinsamen Regel
|
||||
assert.equal((css.match(/wk-prospect-close/g) ?? []).length, 1)
|
||||
assert.doesNotMatch(css, /(^|\})\s*\.dialog-foot \.btn\s*\{/)
|
||||
const global = read('src/styles/global.css')
|
||||
assert.match(global, /\.dialog-foot \.btn\s*\{[^}]*min-height:\s*32px/)
|
||||
})
|
||||
Reference in new issue
Block a user