Skip to content

feat(api,ui): Narrative ENUM migration (retain, remove, refine) #1320

Open
rogeruiz wants to merge 3 commits into
rogeruiz/1016/narrative-data-select-dropdownfrom
rogeruiz/1016/narrative-enum-migration
Open

feat(api,ui): Narrative ENUM migration (retain, remove, refine) #1320
rogeruiz wants to merge 3 commits into
rogeruiz/1016/narrative-data-select-dropdownfrom
rogeruiz/1016/narrative-enum-migration

Conversation

@rogeruiz
Copy link
Copy Markdown
Collaborator

@rogeruiz rogeruiz commented Jun 4, 2026

🔀 PULL REQUEST

💡 Summary

This patch migrates the narrative field from a boolean type to a three-value
enum across the API and client. This prepares the API and the client for the
work being done for #1195. This work is independent of
#1317 and #1318 but closely
related to them. The latter needs to be safely integrated with this patch to
ensure the changes don't conflict with one another.

Important

This patch is continuing the work from #1317 and #1318. It's as independent as
possible from those changes but should be carefully integrated when #1318 is
approved and merged.

🔗 Related Issue

✅ Acceptance Criteria

  • Convert narrative data options to a drop-down
  • Reconstruct option appears in the drop-down when available for that
    section
  • Reconstruction option grayed out unless "refine" is selected for coded
    data
  • Updated table column names (coded data, narrative data)
  • Updated coded data options copy (keep original, refine)
  • Updated tooltip copy
  • If user has "reconstruct" for the narrative and tries to change coded
    data to "keep original", error appears under the toggle
  • Default settings are "refine" for coded data and "keep original" for
    narrative
  • Should retain pattern of blanking out excluded rows (not showing options
    for coded data or refined data)

🧪 How to test

  1. Start the dev server: just dev up
  2. Manually test the changes in the application
    • Open the app and navigate to a configuration's section settings
    • Toggle the narrative switch for various sections
    • Verify the API requests send narrative: "retain" or narrative: "remove" (not true/false)
    • Check that the UI correctly reflects the current narrative state
    • Test creating a new configuration and verify default narrative values
  3. Migrate the database: just migrate local
  4. Verify the narrative column has a type of section_narative (enum) instead of
    boolean: just db query "\d configurations_sections"
  5. Run server tests: just server test
  6. Run client tests: just client test

ℹ️ Additional Information

Note

The work related to #1195 will be applied in four different patches/PRs
continuing with this one. Each patch will be as independent as possible and rely
only on prior patches as strictly necessary. This patch should be independent
of the others.

@rogeruiz rogeruiz self-assigned this Jun 4, 2026
@rogeruiz rogeruiz added dibbs-ecr-refiner ux/ui Primarily client-side work with minimal server work needed. server-side Primarily server-side work with minimal client work needed. labels Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🔒 Security Scan Results

⚠️ Found 8 vulnerabilities

Severity Total
🟠 High 8

📦 refiner-app

⚠️ Could not parse results for refiner-app

📦 refiner-lambda

No vulnerabilities found

📦 refiner-ops

Severity Count
🟠 High 8

View detailed results: Security tab
Last updated: 2026-06-04 14:12:36 UTC

@rogeruiz rogeruiz changed the title Rogeruiz/1016/narrative enum migration feat(api,ui): Narrative ENUM migration (retain, remove, refine) Jun 4, 2026
@rogeruiz rogeruiz changed the base branch from main to rogeruiz/1016/narrative-data-select-dropdown June 4, 2026 14:08
jakewheeler and others added 3 commits June 4, 2026 10:08
This patch migrates the narrative field from a boolean type to a three-value
enum across the API and client. This prepares the API and the client for the
work being done for #1195. This work is independent of
#1317 and #1318 but closely
related to them. The latter needs to be safely integrated with this patch to
ensure the changes don't conflict with one another.
@rogeruiz rogeruiz force-pushed the rogeruiz/1016/narrative-enum-migration branch from f287450 to 730b827 Compare June 4, 2026 14:09
@rogeruiz rogeruiz marked this pull request as ready for review June 4, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dibbs-ecr-refiner server-side Primarily server-side work with minimal client work needed. ux/ui Primarily client-side work with minimal server work needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants