Skip to content

Fill records, part 1: core rules - #33

Merged
firegiant9000 merged 7 commits into
feat/fill-recordsfrom
records/pr1-core
Nov 21, 2026
Merged

firegiant9000 merged 7 commits into
feat/fill-recordsfrom
records/pr1-core

Conversation

@firegiant9000

Copy link
Copy Markdown
Owner

PR 1 of 3 for roadmap item 3: a fill records "what I told them" on the linked application. This PR adds the pure core/ rules only. Nothing in the popup calls them yet; that comes in PR 2.

What changes

  • Record fields (optional, no schema bump): Statement.source?: 'fill', Statement.question?: string, Application.formUrls?: string[]. Editing a statement drops source, because the value is now the owner's. Export and restore keep the new fields, and a test proves it.
  • core/src/form-link.ts:
    • formUrlKey turns a form address into its posting address. It strips /apply on Lever and /application on Ashby.
    • findApplicationsForForm looks for a match in three steps: hand-linked formUrls first, then the job's canonical URL, then the application's own URL. Archived applications are excluded.
    • linkFormOps adds the key to the chosen application and moves it off any other, capped at 20 keys.
  • core/src/fill-records.ts: fillRecordOps makes one statement per answer row the fill wrote or found already matching, with the form's question (trimmed, at most 300 characters). It skips values already recorded, so filling the same form again adds nothing. It sets the site type only when that is empty and not other.
  • core/src/told-panel.ts: toldPanel lists the canonical answers not yet recorded on the application and says whether to offer Mark Applied (no status, or Interested). recordTickedOps and markAppliedOps build the writes for its buttons.
  • core/src/form-application.ts: newApplicationFromFormOps builds the job, the application and any held fill's statements as one list of writes. The new job's canonical URL is the form key, so the form matches on reopen.

Every reader tolerates odd restored data: non-array formUrls, non-string entries, null values, and missing applications (these return missing: true and write nothing). Each builder returns one list of writes for a single apply.

No change to shell/fill/**, the fill lint rules, guard/**, FILL_TOKENS or permissions.

Gate

npm run gate passes: 1920 unit tests (baseline 1857), 18 build tests, ESLint 0 warnings, web-ext lint 0 errors and 2 warnings (unchanged).

Notes for PR 2

Both linkFormOps and fillRecordOps can write the whole application record. When the popup links a form and records a held fill in the same apply, it must feed the linked record into fillRecordOps. Otherwise the last write would drop either formUrls or siteType.

@firegiant9000
firegiant9000 merged commit 10c497b into feat/fill-records Nov 21, 2026
1 check passed
@firegiant9000
firegiant9000 deleted the records/pr1-core branch November 22, 2026 00:27
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