feat(certifications): free-text agency & level for "Other" - #954
Open
etlami wants to merge 2 commits into
Open
Conversation
Picking "Other" for the agency or the level now reveals a text field to type the actual name, instead of silently collapsing to the literal "Other". The custom values persist and feed the auto-derived certification title (e.g. agency "TSA" + level "Full Cave" -> title "Full Cave"), so an agency or certification that isn't in the built-in lists is captured properly rather than lost. - Add nullable agency_custom / level_custom columns (v148 migration; the columns were already free TEXT so existing data is unaffected). - Certification entity + repository carry the two fields. - certification_title's effective-label/derivation helpers use the custom text when the agency/level is "Other". - The edit form shows the free-text field only when "Other" is selected. Deliberately does NOT reintroduce name pre-fill: the title is still derived (and a repetitive stored name suppressed) per the 2026-08 change; the name field remains the override. Tests: v148 migration (fresh + stranded-db backstop), and title/derivation helpers for the custom-agency/level cases.
Contributor
|
📦 Build artifacts for this PR · commit
Artifacts expire in 7 days. Downloading requires being signed in to GitHub. macOS needs two extractions: unzip the downloaded artifact, then unzip the Updated automatically on each push. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add a v147->148 onUpgrade migration test and widget tests for the free-text Other agency/level fields (prefill, reveal-on-Other, and round-trip persistence on save). Key the two custom TextFormFields so the fields can be targeted directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Entering a certification funnels agency and level through fixed dropdowns. When a diver's agency or level isn't in the list, the only option is "Other" — which discards the real name (it's stored as the literal
"other"). The DB columns are already freeTEXT, so this was purely a UI limitation.What this does
Picking "Other" for the agency or the level now reveals a free-text field to type the actual name. The custom value persists and flows into the auto-derived certification title — e.g. agency "TSA" + level "Full Cave" → title "Full Cave" — so an unlisted agency/certification is captured properly instead of lost.
agency_custom/level_customcolumns (v148 migration +beforeOpenbackstop). The columns were already free TEXT, so existing data is unaffected and no CHECK/enum constraint changes.Certificationentity + repository (both read mappers, both write companions) carry the two fields.certification_title.dartgainseffectiveAgencyLabel/effectiveLevelLabel; the derived title,hasDerivedName, and subtitle use the custom text when the agency/level is "Other".certifications_edit_label_agencyCustom/_levelCustomlocalizations across all locales.Deliberately out of scope
This does not reintroduce pre-filling the name from agency+level — the title is still derived (and a name that merely repeats agency+level is suppressed) per the 2026-08 change. The name field stays the override.
Tests
migration_v148_certification_custom_test: fresh schema has the columns; a stranded pre-v148 DB gains them via thebeforeOpenbackstop; no-op when the table is absent.certification_title_test: added a group for the custom-agency/level cases (effective labels, derived title, and custom-name detection).Verified locally (Flutter 3.44.8 / Dart 3.12.2):
flutter analyze libandflutter analyze testclean,dart formatclean,flutter gen-l10n+ drift codegen run, certifications / database-migration / arb-parity suites green.