feat(content): hide sets via manifest visibility flag, drop hidden-sets.ts (#1707)#1993
Conversation
…ts.ts (#1707) Replace the app-side hidden-sets.ts blocklist (the #1702 interim) with the declarative visibility flag now carried by learn-content-engine 0.14.0's manifest set entry and by the content search index. - Re-pin learn-content-engine 0.13.3 -> 0.14.0 (exact, engine-version.txt + make sync-schema): the manifest schema and the generated Pydantic model gain the additive optional visibility enum (absent => visible). - Discover: normalizeSet drops visibility: "hidden" entries at parse time so they never enter the catalogue, its facets/counts or the cache; queryDiscoverSets keeps a render-time visibility guard. - Meine Inhalte: useContentSetsData filters visibility === "hidden" (the manifest value flows through the engine's asContentSetEntry). - API mode: SetEntryResponse carries visibility so both storage modes filter identically. - Delete hidden-sets.ts + its test; absent visibility is treated as visible everywhere. Closes #1707.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
… suite (#1707) The plugin test suite runs each plugin in isolation, WITHOUT the backend `app` package on the path. Asserting `SetEntryResponse` (routes.py imports `app.exceptions`) there failed CI with `ModuleNotFoundError: No module named 'app'`. Move the check to `backend/tests/test_content_loader_routes.py` (where `app` and the plugin are both importable) as an end-to-end passthrough: a manifest carrying `visibility: hidden` surfaces the flag on the /sets response, a set without the field defaults to `visible`. Refs #1707.
|
CI status after the first run: Fixed (pushed Pre-existing base-branch failure (not this PR): All other checks green (Frontend Tests, Backend ruff + mypy, pre-commit, docs-drift, complexity gate, security). Generated by Claude Code |
Description
Final step of the #1707 chain: replace the app-side
hidden-sets.tsblocklist (the #1702 interim) with the declarativevisibilityflag now carried bylearn-content-engine0.14.0's manifest set entry and by the content search index.The chain is fully unblocked: engine#83 → PR engine#84 shipped the additive
visibilityfield (0.14.0), andadaptive-learner-content-testmarks the graded-quiz demo fixturevisibility: hidden.What changed
learn-content-engine0.13.3 → 0.14.0 (exact pin, enforced byengine-pin.test.ts==schema/engine-version.txt; the task said^0.14.0but the repo hard-requires an exact pin). Ranmake sync-schema: the mirroredcontent-manifest.schema.jsonand the generatedmanifest_generated.pygain the additive optionalvisibilityenum (absent ⇒visible). Keptsync-schema-check+engine-parity-checkgreen.search-index-loader.ts):normalizeSetdropsvisibility: "hidden"entries at parse time, so they never enter the catalogue, its facets/counts or the cache.queryDiscoverSetskeeps a render-time visibility guard (the original two-layer design).useContentSetsData.ts): filtersvisibility === "hidden". The manifest value flows through the engine'sasContentSetEntry, so a downloaded/imported hidden set is filtered too.content-loaderpluginSetEntryResponse): carriesvisibilityso both storage modes filter identically (also stopsextra="forbid"from 400-ing a manifest that now carriesvisibility).hidden-sets.ts+ its test. Absentvisibilityis treated as visible everywhere.Closes #1707. Refs #1702, #1706, astrapi69/learn-content-engine#83, astrapi69/learn-content-engine#84.
Type of Change
visibilitypassthrough)Testing
make testpasses locally — the full suite needs the full backend env; I ran the changed-surface gates instead (below). Please runmake test+ the Dexie-mode gate on CI.tsc --noEmit: clean.search-index-loader/discover-index/useContentSetsData/engine-pin(59) +src/storage+src/lib/content+src/hooks/content(1623) +src/pages/content+src/components/content(325) — all green.content-loader:test_models_set_manifest.py(52, incl. newvisibilitycases) +test_service.py(32, incl. newSetEntryResponsevisibility cases) — green.sync_schema_mirror_from_engine.py --check,generate_pydantic_models.py --check,check_engine_schema_parity.py(vs the 0.14.0 npm tarball) — all green.visibilityflag (needs engine schema change) #1707 "Geräteverifikation": in a build connected toadaptive-learner-content-test, confirm thegraded-quiz-demo-from-deset stays hidden in Content-Browser / Discover / Dashboard (now viavisibility: hidden) and all other sets stay visible. Not runnable in this container.Documentation
/docs).Plugin Impact
content-loaderplugin. The change is additive/backward-compatible (optionalvisibilitypassthrough), so per the repo's plugin-versioning policy the plugin version is intentionally not bumped. Backend model/response + tests updated.Checklist
Notes for the reviewer
Discover.tsxcomputes facets over the fullallSets) + a render-time guard.rowToCachedEntry(manifest-unreachable fallback) has novisibilitycolumn on the Dexie row, so an offline, previously-downloaded hidden fixture defaults to visible. Avoided a Dexie schema bump for this rare case; the live-manifest path (the normal case) filters it correctly.🤖 Generated with Claude Code
Generated by Claude Code