feat(onboarding): activation quick wins on the Hem checklist (#1461)

* feat(onboarding): activation quick wins on the Hem checklist

First implementation slice of the approved activation concept
(artifact de543d57, dev_docs/onboarding_activation_analysis.md §9):

- New "Kvitton och underlag" checklist step, gated on the invoice-inbox
  extension like the Skatteverket step; done once the company has ever
  received an inbox item (email/WhatsApp/upload). Non-AI companies route
  to billing, matching the assistant step.
- Personalized VAT line in the Skatteverket step: the company's real next
  momsdeklaration due date from the deadlines table, with an explicit
  "välj momsperiod" prompt when vat_registered is set but moms_period is
  null (that state silently generates zero VAT deadlines).
- Truthful Att göra empty state: while the setup checklist is open and no
  journal entry is posted, the all-clear reads "Bokföringen är tom än"
  instead of a false "Allt klart!".
- Activation funnel events (onboarding_setup_step_started / _completed /
  _dismissed) via posthog-js, mirroring the existing guarded capture
  pattern; sandbox never renders the block so no extra gate is needed.

Pure helpers live in lib/onboarding/checklist.ts with tests; step
numbering now adapts to both optional extensions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: record the receipts-signal and moms-period-guard decisions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(onboarding): review triage: error-safe emptyLedger, stale-state guard, copy

- A failed posted-entries count no longer reads as an empty ledger.
- Confirming a suggested match books an entry, so the empty-ledger copy
  retires for the rest of the session (postedSinceLoad).
- 'Bokföringen är tom än så länge' reads naturally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-08-08 15:14:34 +02:00
committed by GitHub
co-authored by Claude Fable 5 Jakob Wennberg
parent ddbe9b1379
commit 44cff5e5e4
11 changed files with 356 additions and 34 deletions
+11 -1
View File
@@ -1325,7 +1325,14 @@
"dismiss": "Hide",
"step_skv_title": "Connect Skatteverket",
"step_skv_description": "See the tax account and file VAT and employer declarations right from here. Connects with BankID in a couple of minutes.",
"step_skv_action": "Connect Skatteverket"
"step_skv_action": "Connect Skatteverket",
"step_skv_next_vat": "First VAT return: {date}.",
"step_skv_choose_period": "Pick a VAT period in settings, otherwise no VAT deadlines are tracked.",
"step_receipts_title": "Receipts and documents",
"step_receipts_description": "Photo the receipt or forward the email to your inbox address, and the document is read and waiting for you.",
"step_receipts_action": "Open the inbox",
"step_receipts_channels": "Email · WhatsApp · upload",
"step_receipts_channels_no_wa": "Email · upload"
},
"tax_assessment_notices": {
"title": "Final tax notices and remaining tax",
@@ -5659,6 +5666,9 @@
"att_gora_left": "{count} left",
"att_gora_empty_title": "All caught up!",
"att_gora_empty_body": "No transactions to record and no documents to handle.",
"att_gora_new_status": "Nothing here yet",
"att_gora_new_title": "Your books are empty so far",
"att_gora_new_body": "The get-started steps above will fill them: your history, the bank and the receipts.",
"band_bokfor": "Record",
"band_granska": "Review & complete",
"band_bevaka": "Monitor",
+11 -1
View File
@@ -1325,7 +1325,14 @@
"dismiss": "Dölj",
"step_skv_title": "Anslut Skatteverket",
"step_skv_description": "Se skattekontot och lämna moms- och arbetsgivardeklarationer direkt härifrån. Ansluts med BankID på ett par minuter.",
"step_skv_action": "Anslut Skatteverket"
"step_skv_action": "Anslut Skatteverket",
"step_skv_next_vat": "Första momsdeklarationen: {date}.",
"step_skv_choose_period": "Välj momsperiod i inställningarna, annars bevakas inga momsdeadlines.",
"step_receipts_title": "Kvitton och underlag",
"step_receipts_description": "Fota kvittot eller vidarebefordra mejlet till er inkorgsadress, så tolkas underlaget och väntar på dig.",
"step_receipts_action": "Öppna inkorgen",
"step_receipts_channels": "Mejl · WhatsApp · uppladdning",
"step_receipts_channels_no_wa": "Mejl · uppladdning"
},
"tax_assessment_notices": {
"title": "Slutskattebesked och kvarskatt",
@@ -5659,6 +5666,9 @@
"att_gora_left": "{count} kvar",
"att_gora_empty_title": "Allt klart!",
"att_gora_empty_body": "Inga transaktioner att bokföra och inga underlag att hantera.",
"att_gora_new_status": "Inget här än",
"att_gora_new_title": "Bokföringen är tom än så länge",
"att_gora_new_body": "Kom igång-stegen ovan fyller den: historiken, banken och kvittona.",
"band_bokfor": "Bokför",
"band_granska": "Granska & komplettera",
"band_bevaka": "Bevaka",