2.1.0: modal and bulk subreddit folder/theme assignment #13
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/12-bulk-subreddit-assignments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changes
Evidence
Acceptance
CUR-11 is Awaiting live test. Representative user acceptance is still pending; the existing Lyra 2.0.0 services have not been replaced by this feature build.
Related to #12.
Automated code review
Reviewed commit:
53f0e09d5d89ca51c23a06bab25a6857b9498ca8Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
This PR implements CUR-11, adding modal-based folder and theme assignment for subreddits in Redview v2.1.0. It introduces new API endpoints (
/api/subreddits/assignments/previewand/api/subreddits/assignments) and a React dialog component to handle single and bulk assignments. The implementation supports atomic updates, additive theme logic with an explicit overwrite toggle, and ensures folder assignment only changes routing metadata without moving files. Tests confirm the new behavior, including draft/cancel workflows and error handling.Blocking findings
None.
Important findings
const fields = mode === 'folder' ? { folder_id: folderId === '' ? null : Number(folderId) } ...
Impact: The dialog uses a special sentinel value '__choose' for the folder select when assignments are mixed. While this prevents submission, the conversion logic
Number(folderId)will result inNaNiffolderIdis not a valid number string (other than empty). Although the UI controls this via the select element, relying onNumber()without validation is fragile.Suggested fix: Validate that
folderIdis a valid integer before conversion or useparseInt(folderId, 10)with an explicit check forNaN.Suggestions
Missing Accessibility Label for Bulk Theme Overwrite Toggle (web/src/subreddit-assignment-dialog.tsx:96; high confidence)
<input type="checkbox" aria-label="Overwrite existing themes" ... /> Overwrite existing themes
Impact: The checkbox has an
aria-label, but the label text is also visible. This is generally fine, but ensure screen readers announce the state correctly. The current implementation is acceptable.Suggested fix: No action required, but verify with a screen reader that the toggle state is clear.
Hardcoded Limit in API Schema (src/app.ts:2013; medium confidence)
theme_ids: { type: 'array', maxItems: 100, items: { type: 'integer', minimum: 1 } },
Impact: The API schema limits theme assignments to 100 per request. This is a reasonable safeguard but should be documented or configurable if the system expects larger batches.
Suggested fix: Consider making this limit configurable or documenting it in the API spec comments.
Tests and validation
Questions
subreddit_folder_maptable synchronization when using the new bulk assignment API?Review limitations
Diff coverage
CHANGELOG.md: reviewed — included in a context-limited batchPRIORITIES.md: reviewed — included in a context-limited batchREQUIREMENTS-TRACE.md: reviewed — included in a context-limited batchREQUIREMENTS.md: reviewed — included in a context-limited batchVERSION: reviewed — included in a context-limited batchpackage.json: reviewed — included in a context-limited batchscripts/browser-gallery-smoke.mjs: reviewed — included in a context-limited batchscripts/browser-subreddit-assignments.mjs: reviewed — included in a context-limited batchsrc/app.ts: reviewed — included in a context-limited batchtests/subreddit-assignments.test.mjs: reviewed — included in a context-limited batchweb/src/main.tsx: reviewed — included in a context-limited batchweb/src/style.css: reviewed — included in a context-limited batchweb/src/subreddit-assignment-dialog.tsx: reviewed — included in a context-limited batchReview metadata
Pre-merge assessment of the advisory review at
53f0e09:__choosebefore conversion; both Apply buttons also disable that state. Other select values are the explicit empty default or integer folder IDs from API schemas. The batch API independently validates integer IDs and enabled targets. Treating arbitrary internal-state injection as a present UI defect is unsupported by the current control flow.aria-label; the review itself says no action required. Screen-reader acceptance is not claimed.maxItems: 100themes, 1000 subreddit IDs), consistent with the existing single-theme route.Build and advisory workflow checks pass on this exact commit. The user explicitly requested merging; CUR-11 remains Awaiting live test and merging does not claim its acceptance or deployment.