Enhance exercise card interactivity and toolbar functionality
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 41s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m20s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 41s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m20s
- Added clickable behavior to exercise card body, allowing users to navigate to exercise details by clicking anywhere on the card. - Introduced keyboard accessibility for exercise cards, enabling navigation via Enter and Space keys. - Updated ExerciseListBulkToolbar to include a new button for saving selected exercises as a module, enhancing bulk action capabilities. - Improved CSS styles for clickable exercise card body to indicate interactivity.
This commit is contained in:
1 parent
e50c18f92e
commit
ef4dd93324
6 files changed
+459
-11
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import { INITIAL_EXERCISE_LIST_FILTERS, mergeExerciseListPrefsFromApi } from '../constants/exerciseListFilters'
|
||||
|
||||
const STORAGE_KEY = 'shinkan.exerciseList.session.v1'
|
||||
|
||||
function safeParse(raw) {
|
||||
if (!raw) return null
|
||||
try {
|
||||
return JSON.parse(raw)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {{ filters: object, searchInput: string, aiSearchInput: string, mineOnly: boolean } | null} */
|
||||
export function readExerciseListSessionState() {
|
||||
if (typeof sessionStorage === 'undefined') return null
|
||||
const parsed = safeParse(sessionStorage.getItem(STORAGE_KEY))
|
||||
if (!parsed || typeof parsed !== 'object') return null
|
||||
|
||||
const filters =
|
||||
parsed.filters && typeof parsed.filters === 'object'
|
||||
? mergeExerciseListPrefsFromApi(parsed.filters)
|
||||
: { ...INITIAL_EXERCISE_LIST_FILTERS }
|
||||
|
||||
return {
|
||||
filters,
|
||||
searchInput: typeof parsed.searchInput === 'string' ? parsed.searchInput : '',
|
||||
aiSearchInput: typeof parsed.aiSearchInput === 'string' ? parsed.aiSearchInput : '',
|
||||
mineOnly: !!parsed.mineOnly,
|
||||
}
|
||||
}
|
||||
|
||||
export function writeExerciseListSessionState(state) {
|
||||
if (typeof sessionStorage === 'undefined' || !state || typeof state !== 'object') return
|
||||
try {
|
||||
sessionStorage.setItem(
|
||||
STORAGE_KEY,
|
||||
JSON.stringify({
|
||||
filters: state.filters ?? { ...INITIAL_EXERCISE_LIST_FILTERS },
|
||||
searchInput: typeof state.searchInput === 'string' ? state.searchInput : '',
|
||||
aiSearchInput: typeof state.aiSearchInput === 'string' ? state.aiSearchInput : '',
|
||||
mineOnly: !!state.mineOnly,
|
||||
})
|
||||
)
|
||||
} catch {
|
||||
/* quota / private mode */
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user