Skip to content

Custom fields in the post-match screen - #85

Open
MangoSwirl wants to merge 10 commits into
mainfrom
custom-fields
Open

Custom fields in the post-match screen#85
MangoSwirl wants to merge 10 commits into
mainfrom
custom-fields

Conversation

@MangoSwirl

@MangoSwirl MangoSwirl commented Aug 2, 2026

Copy link
Copy Markdown
Member

Adds custom fields to the collection app: scouting leads' custom questions appear in an "Asked by your team" section at the bottom of the post-match screen and are submitted with the scout report.

What's here

  • New getCustomFields fetcher hitting the team-scoped manifest endpoint (/v1/manager/customfields/manifest); treats a 404 as "feature absent → no fields".
  • New offline-cached custom-fields service (createGenericServiceStore), fetched in the service loader and reflected in the home status pill.
  • Snapshotting: field definitions are captured into the report at match start, so a mid-match manifest refresh can't desync the form.
  • customFieldAnswers added to report state, exportScoutReport(), and the Zod payload — flows to both the direct-upload and QR paths automatically. Unanswered fields are omitted (QR size).
  • Post-match UI: an "Asked by your team" section, hidden entirely when the team has no fields. Text → multiline input, Number → validated numeric input, Single/Multi select → the existing inset picker. All optional.

No scoutReportMigrations entry needed (the payload change is additive/optional).

Testing

Drove the full match flow on an iOS simulator against a local server: the section renders all four field types, answers submit through the real upload path, and the values land in the DB exactly (number/single/multi correct, blank text omitted). ts:check, lint, format:check clean.


Related PRs — this feature spans four repos:

Scouting leads' custom questions (text, number, single-select,
multi-select) now appear in an "Asked by your team" section at the bottom
of the post-match screen and are submitted with the scout report.

- New getCustomFields fetcher hitting the team-scoped manifest endpoint
- New offline-cached custom-fields service, fetched in the service loader
  and shown in the home status pill
- Field definitions snapshotted into the report at match start so a
  mid-match manifest refresh can't desync the form
- customFieldAnswers added to report state, export, and Zod payload;
  flows to both the direct upload and QR paths automatically
- Section hidden entirely when the team has no fields; number inputs
  validate; all questions optional

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MangoSwirl and others added 9 commits August 1, 2026 23:01
- Replace the section header with a labeled divider (muted hairline with a
  break for small centered text) so it reads as a section break rather than
  a heading.
- Inset picker: when an option has no description, render a single compact,
  vertically-centered row so the label lines up with the selection
  indicator. Options with descriptions are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Use a 2px line in gray.default, matching the NavBar's divider, instead of
a thin hairline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Custom select fields have no option descriptions, so the filled row
containers felt too heavy for the little content. Add a `contained` prop
to Picker (default true); when false, drop the filled backgrounds and
horizontal padding to render bare selection rows. Custom field selectors
use it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
In the uncontained variant, use a uniform 5px top/bottom padding so the
24px selection indicators sit 10px apart, and drop the leading/trailing
padding overrides (unnecessary without a container).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Notes block above adds an 18px bottom margin on top of the column
gap, so the divider sat closer to the custom fields below it. Add a
matching 18px below the divider so it's centered between the two sections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reduce the space on both sides of the divider (from ~32px to ~18px) while
keeping it centered between the Notes block and the custom fields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Without a container to hug, the on-press background flash looked stray, so
keep uncontained rows transparent on press. Haptics and the selection
indicator still convey the tap. Contained pickers are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Match the uncontained picker rows to Lovat's other labeled checkboxes
(e.g. "Robot broke"): a muted body-colored label and a 10px gap between
the selection indicator and the label. Contained pickers are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26.0.5 is a closed App Store train (already released), so ship the custom
fields build under 26.0.6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant