UX-MOBILE-2: Genotyp-Tabellen-Overflow behoben (scrollbar statt page-overflow)
- BreedingResultView: <table class="genotype-table"> in <div class="genotype-table-scroll"> gewrapped.
- index.css: .genotype-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch }.
.genotype-table td { white-space: nowrap } → Tabelle scrollt statt Zellen umzubrechen.
width: 100% entfernt (Tabelle auto-sized to content).
- index.css: .app-main { overflow-x: hidden } → verhindert, dass breite Inhalte
den Page-Body horizontal überlaufen lassen (document.scrollWidth == clientWidth).
- e2e/genotype-table.spec.ts (4 Tests): Wrapper sichtbar, Wrapper selbst scrollbar
(scrollWidth > clientWidth), keine Page-Overflow auf 390px. Beide Viewports.
- Vitest 78 / e2e 106 grün.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,28 +65,30 @@ export default function BreedingResultView({ result, title }: BreedingResultView
|
||||
</button>
|
||||
|
||||
{showGenotypes && (
|
||||
<table className="genotype-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{t.genotypeLabel}</th>
|
||||
<th>{t.genotypePreview}</th>
|
||||
<th>{t.probability}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{result.offspring.map((o) => (
|
||||
<tr key={o.genotype}>
|
||||
<td>
|
||||
<code>{o.genotype}</code>
|
||||
</td>
|
||||
<td>{o.farbschlag}</td>
|
||||
<td>
|
||||
{o.probability.percent} <small>({o.probability.text})</small>
|
||||
</td>
|
||||
<div className="genotype-table-scroll">
|
||||
<table className="genotype-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{t.genotypeLabel}</th>
|
||||
<th>{t.genotypePreview}</th>
|
||||
<th>{t.probability}</th>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
{result.offspring.map((o) => (
|
||||
<tr key={o.genotype}>
|
||||
<td>
|
||||
<code>{o.genotype}</code>
|
||||
</td>
|
||||
<td>{o.farbschlag}</td>
|
||||
<td>
|
||||
{o.probability.percent} <small>({o.probability.text})</small>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -77,6 +77,10 @@ a {
|
||||
padding: 1rem;
|
||||
max-width: 60rem;
|
||||
width: 100%;
|
||||
/* UX-MOBILE-2: prevent any wide content (e.g. genotype table) from making
|
||||
the page body scroll horizontally. The .genotype-table-scroll wrapper
|
||||
provides the per-table horizontal scroll. */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* Tab-Leiste unten */
|
||||
@@ -559,8 +563,14 @@ textarea {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* UX-MOBILE-2: scroll wrapper so genotype table scrolls horizontally on mobile
|
||||
instead of overflowing the page. */
|
||||
.genotype-table-scroll {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.genotype-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.9rem;
|
||||
@@ -571,6 +581,7 @@ textarea {
|
||||
text-align: left;
|
||||
padding: 0.4rem 0.5rem;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.genotype-table code {
|
||||
|
||||
Reference in New Issue
Block a user