feat: enhance UI and functionality for Skills and Exercises pages
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 29s

- Added new CSS styles for Skills and Exercises pages, improving layout and responsiveness.
- Refactored components to utilize new styles, enhancing visual consistency and user experience.
- Implemented horizontal scrollable navigation for exercises and skills tabs, improving usability on smaller screens.
- Updated button styles and introduced new class names for better maintainability and accessibility.
- Enhanced loading states and empty messages for improved user feedback during data fetching.
This commit is contained in:
Lars committed 2026-05-06 11:24:44 +02:00
1 parent 657f73d2c5
commit 68923b0364
5 files changed
+706 -312

No files matched your search

+67 -92
View File
@@ -545,65 +545,64 @@ function ExercisesListPage() {
if (!catalogsReady && pageTab === 'list') {
return (
<div style={{ padding: '2rem', textAlign: 'center' }}>
<div className="spinner"></div>
<p>Lade Kataloge…</p>
<div className="app-page">
<div className="empty-state" style={{ padding: '2.5rem 1rem' }}>
<div className="spinner" />
<p className="muted" style={{ marginTop: '12px' }}>
Lade Kataloge…
</p>
</div>
</div>
)
}
return (
<div className="app-page">
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: '12px',
flexWrap: 'wrap',
gap: '8px',
}}
>
<h1 style={{ fontSize: '1.35rem' }}>Übungen</h1>
<div className="exercises-page__header">
<h1 className="page-title exercises-page__title">Übungen</h1>
{pageTab === 'list' ? (
<Link to="/exercises/new" className="btn btn-primary">
+ Neu
</Link>
) : (
<span />
<span aria-hidden="true" />
)}
</div>
<div
role="tablist"
aria-label="Übungen Bereiche"
style={{ display: 'flex', gap: '8px', marginBottom: '14px', flexWrap: 'wrap' }}
>
<button
type="button"
role="tab"
aria-selected={pageTab === 'list'}
className={pageTab === 'list' ? 'btn btn-primary' : 'btn btn-secondary'}
onClick={() => setPageTab('list')}
>
Liste
</button>
<button
type="button"
role="tab"
aria-selected={pageTab === 'progression'}
className={pageTab === 'progression' ? 'btn btn-primary' : 'btn btn-secondary'}
onClick={() => setPageTab('progression')}
>
Progressionsgraphen
</button>
<div className="exercises-page-toolbar-tabs" role="tablist" aria-label="Übungen Bereiche">
<div className="planning-segment-group planning-segment-group--equal exercises-page-mode-switch">
<button
type="button"
role="tab"
aria-selected={pageTab === 'list'}
className={
'planning-segment-group__btn' +
(pageTab === 'list' ? ' planning-segment-group__btn--active' : '')
}
onClick={() => setPageTab('list')}
>
Liste
</button>
<button
type="button"
role="tab"
aria-selected={pageTab === 'progression'}
className={
'planning-segment-group__btn' +
(pageTab === 'progression' ? ' planning-segment-group__btn--active' : '')
}
onClick={() => setPageTab('progression')}
>
Progressionsgraphen
</button>
</div>
</div>
{pageTab === 'progression' ? (
<ExerciseProgressionGraphPanel />
) : (
<>
<div className="card exercise-search-bar" style={{ marginBottom: '12px' }}>
<div className="card exercise-search-bar">
<label className="form-label">Volltextsuche (Titel, Ziel, …)</label>
<datalist id="exercise-search-titles">
{searchTitleSuggestions.map((t) => (
@@ -612,7 +611,7 @@ function ExercisesListPage() {
</datalist>
<input
type="search"
className="form-input"
className="form-input exercise-search-bar__primary"
placeholder="Suchbegriffe…"
value={searchInput}
onChange={(e) => setSearchInput(e.target.value)}
@@ -620,7 +619,6 @@ function ExercisesListPage() {
name="exercise-fulltext-search"
list="exercise-search-titles"
enterKeyHint="search"
style={{ marginBottom: '10px' }}
/>
<label className="form-label">Ergänzende Suche / KI-Vorbereitung (Beta)</label>
<input
@@ -668,13 +666,13 @@ function ExercisesListPage() {
))}
</div>
) : null}
<p style={{ fontSize: '12px', color: 'var(--text3)', marginTop: '10px', marginBottom: 0 }}>
<p className="exercise-search-hint">
Trefferliste aktualisiert sich kurz nach Eingabe. Titel der aktuellen Liste erscheinen als Vorschläge (Pfeil im
Feld). Fachliche Filter über „Filter“ – zwischen Feldern UND, Auswahl mehrerer Werte je Feld mit ODER.
{exercises.length > 0 ? (
<>
{' '}
<button type="button" className="btn btn-secondary" style={{ marginLeft: '6px' }} onClick={toggleSelectAllPage}>
<button type="button" className="btn btn-secondary btn-small" onClick={toggleSelectAllPage}>
{allOnPageSelected ? 'Auswahl auf dieser Seite aufheben' : 'Alle auf dieser Seite auswählen'}
</button>
</>
@@ -683,24 +681,15 @@ function ExercisesListPage() {
</div>
{selectedIds.size > 0 ? (
<div
className="card"
style={{
marginBottom: '12px',
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center',
gap: '10px',
}}
>
<div className="card exercise-bulk-toolbar">
<strong>{selectedIds.size} ausgewählt</strong>
<button type="button" className="btn btn-secondary" onClick={clearSelection}>
<button type="button" className="btn btn-secondary btn-small" onClick={clearSelection}>
Auswahl aufheben
</button>
<button type="button" className="btn btn-primary" onClick={openBulkModal}>
<button type="button" className="btn btn-primary btn-small" onClick={openBulkModal}>
Massenänderung…
</button>
<span style={{ fontSize: '12px', color: 'var(--text3)' }}>
<span className="exercise-bulk-toolbar__meta">
Bis zu {BULK_MAX_IDS} pro Anfrage. Für „Verein“ ohne Auswahl: aktiver Vereinskontext (
<code>X-Active-Club-Id</code>
).
@@ -736,7 +725,7 @@ function ExercisesListPage() {
</button>
</div>
<div className="admin-modal-sheet__body exercise-filter-modal__scroll">
<p style={{ fontSize: '13px', color: 'var(--text2)', marginTop: 0, marginBottom: '14px' }}>
<p className="muted" style={{ marginTop: 0, marginBottom: '14px' }}>
Zwischen den Bereichen gilt <strong>UND</strong>. Innerhalb eines Feldes werden mehrere Einträge mit{' '}
<strong>ODER</strong> verknüpft.
</p>
@@ -900,12 +889,12 @@ function ExercisesListPage() {
</button>
</div>
<div className="admin-modal-sheet__body exercise-filter-modal__scroll">
<p style={{ fontSize: '13px', color: 'var(--text2)', marginTop: 0 }}>
<p className="muted" style={{ marginTop: 0 }}>
Es werden <strong>{selectedIds.size}</strong> Übung(en) aus der aktuellen Auswahl bearbeitet. Pro Durchlauf
höchstens {BULK_MAX_IDS}. Ohne Berechtigung bleiben Einzelübungen unverändert (siehe Hinweis nach dem
Speichern).
</p>
<p style={{ fontSize: '12px', color: 'var(--text3)', marginTop: 0, marginBottom: '14px' }}>
<p className="form-sub" style={{ marginTop: 0, marginBottom: '14px' }}>
Unter „Zuordnung ersetzen“: die gewählte Liste ersetzt die bisherige Zuordnung bei allen betroffenen
Übungen vollständig (leere Auswahl = alle Zuordnungen dieser Kategorie entfernen). Die erste Auswahl gilt
als Primärzuordnung.
@@ -1066,7 +1055,7 @@ function ExercisesListPage() {
</div>
</section>
</div>
<div className="exercise-filter-modal__footer" style={{ justifyContent: 'flex-end' }}>
<div className="exercise-filter-modal__footer">
<button
type="button"
className="btn"
@@ -1084,52 +1073,43 @@ function ExercisesListPage() {
) : null}
{listFetching && exercises.length === 0 ? (
<div className="card" style={{ textAlign: 'center', padding: '2rem' }}>
<div className="spinner"></div>
<p style={{ color: 'var(--text2)', marginTop: '12px' }}>Lade Übungen…</p>
<div className="card empty-state" style={{ padding: '2rem 1rem' }}>
<div className="spinner" />
<p className="muted" style={{ marginTop: '12px' }}>
Lade Übungen…
</p>
</div>
) : exercises.length === 0 ? (
<div className="card">
<p style={{ color: 'var(--text2)', textAlign: 'center' }}>
Keine Übungen gefunden.
</p>
<p className="exercises-empty-text">Keine Übungen gefunden.</p>
</div>
) : (
<>
{listFetching ? (
<p style={{ fontSize: '13px', color: 'var(--text3)', marginBottom: '8px' }}>Aktualisiere Treffer…</p>
<p className="exercises-meta-line exercises-meta-line--muted">Aktualisiere Treffer…</p>
) : null}
<p style={{ fontSize: '13px', color: 'var(--text2)', marginBottom: '10px' }}>
<p className="exercises-meta-line">
{exercises.length} angezeigt
{hasMore ? ' · es gibt weitere Einträge' : ''}
</p>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))',
gap: '12px',
}}
>
<div className="exercises-list-grid">
{exercises.map((exercise) => (
<div key={exercise.id} className="card exercise-card">
<div style={{ display: 'flex', gap: '10px', alignItems: 'flex-start' }}>
<div className="exercise-card-layout">
<input
type="checkbox"
checked={selectedIds.has(Number(exercise.id))}
onChange={() => toggleSelect(exercise.id)}
aria-label={`„${(exercise.title || 'Übung').replace(/"/g, '')}“ auswählen`}
style={{ marginTop: '4px', flexShrink: 0 }}
className="exercise-card-layout__check"
/>
<div className="exercise-card__body" style={{ flex: 1, minWidth: 0 }}>
<h3 style={{ marginBottom: '8px', fontSize: '1.05rem', lineHeight: 1.3 }}>
<Link
to={`/exercises/${exercise.id}`}
style={{ color: 'inherit', textDecoration: 'none' }}
>
<div className="exercise-card__body exercise-card-body-flex">
<h3 className="exercise-card-title">
<Link to={`/exercises/${exercise.id}`}>
{exercise.title}
</Link>
</h3>
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', marginBottom: '8px' }}>
<div className="exercise-card-tags">
{exercise.focus_area && (
<span className="exercise-tag exercise-tag--accent">{exercise.focus_area}</span>
)}
@@ -1137,7 +1117,7 @@ function ExercisesListPage() {
<span className="exercise-tag">{exercise.status}</span>
</div>
{exercise.summary && (
<p style={{ color: 'var(--text2)', fontSize: '13px', lineHeight: 1.4 }}>
<p className="exercise-card-summary">
{exercise.summary.length > 160
? `${exercise.summary.slice(0, 160)}…`
: exercise.summary}
@@ -1154,12 +1134,7 @@ function ExercisesListPage() {
</Link>
<button
type="button"
className="btn"
style={{
background: 'var(--danger)',
color: 'white',
border: 'none',
}}
className="btn btn-danger btn-small"
onClick={() => handleDelete(exercise)}
>
Löschen
@@ -1169,7 +1144,7 @@ function ExercisesListPage() {
))}
</div>
{hasMore && (
<div style={{ textAlign: 'center', marginTop: '16px' }}>
<div className="exercises-load-more">
<button type="button" className="btn btn-secondary" disabled={loadingMore} onClick={loadMore}>
{loadingMore ? 'Laden…' : 'Mehr laden'}
</button>