← All repositories

reportage

A life-logging app for iPhone

git clone https://code.inqk.net/reportage.git


commit 9c4e43435d3ec8ba92d8e069b01a414ddaa2744c
parent 2fc9601cefd243ff352d10f979d48d831ea073ce
Author: Michael Camilleri <[email protected]>
Date:   Fri, 16 Oct 2026 16:26:50 +0900

Add the survey and default questions

This commit begins Phase 2 of the design. Until now the app showed a
placeholder and had no way to make a report. Now the home screen lists
reports, newest first and each in its own local time, and the + button
starts a report, with wake and bedtime reports in its menu.

The survey shows one question per page, as Reporter did, with Back, Skip
and Next along the bottom. Yes/no and choice answers move on by
themselves after a moment, so the selection can be seen. Activity,
people and place questions list past answers, most used first and then
most recently used, with a search field that also adds a new answer when
nothing matches. Every question in the survey gets a response, with no
value when it was skipped, and the report is saved together with any
tokens created while answering it. A token added and then deselected is
not saved.

Suggestions come from a local index built from response history. Uses of
a merged token count towards the token it was merged into, and archived
or merged tokens are not offered. Yes/no answers are stored as the fixed
values 'Yes' and 'No', as Reporter stored them, with only their labels
translated.

Places are picked from past answers or typed by name for now, without a
coordinate; location capture and MapKit search come later in the phase.

A fresh install starts with a default question set covering every
question kind. The defaults are only added to a store with no questions,
so they never mix with an imported archive, and they have fixed IDs so
two devices that both seed them end up with the same questions once
they sync. The design document records this.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Diffstat

MNotes/Design.md | 8++++++++
MReportage.xcodeproj/project.pbxproj | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
MReportage/ReportageApp.swift | 14+++++++++++++-
DReportage/Views/ContentView.swift | 12------------
AReportage/Views/Environment.swift | 6++++++
AReportage/Views/HomeView.swift | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AReportage/Views/ReportKind+Title.swift | 12++++++++++++
AReportage/Views/Survey/QuestionPage.swift | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AReportage/Views/Survey/SurveyModel.swift | 274+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AReportage/Views/Survey/SurveyView.swift | 213+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AReportage/Views/Survey/TokenAnswer.swift | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AShared/Models/DefaultQuestions.swift | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MShared/Models/Response.swift | 7+++++++
AShared/Persistence/ReportStore.swift | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AShared/Persistence/Vocabulary.swift | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATests/Unit/ReportStoreTests.swift | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATests/Unit/SurveyModelTests.swift | 217+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

17 files changed, 1600 insertions(+), 17 deletions(-)

diff --git a/Notes/Design.md b/Notes/Design.md

@@ -98,6 +98,14 @@ appeared in.
 The export doesn't include the answer lists for choice questions either. The
 importer rebuilds them from the answers given, most common first.
 
+A fresh install starts with a default question set covering every question
+kind (`DefaultQuestions`). The defaults are only added to a store with no
+questions at all, so they never mix with an imported archive. They have fixed
+IDs (`reportage-default-` plus a name), so seeding is idempotent and two
+devices that both seed them end up with the same questions after syncing.
+Their prompts are written in the user's language at seeding time and are
+ordinary data after that.
+
 ### Report
 
 | Field         | Notes                                                        |

diff --git a/Reportage.xcodeproj/project.pbxproj b/Reportage.xcodeproj/project.pbxproj

@@ -9,6 +9,7 @@
 /* Begin PBXBuildFile section */
 		047D3797389624E8B4AF44B4 /* ReportageExporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD433A98973E8B13E42230A1 /* ReportageExporter.swift */; };
 		06415D2A2EDA6E92ECAC96FA /* Report.swift in Sources */ = {isa = PBXBuildFile; fileRef = B03734F91822E7F161432075 /* Report.swift */; };
+		0F052B8A2C73437F57E927E7 /* ReportStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E55C093BA98D8700F406AE /* ReportStoreTests.swift */; };
 		25BC9F95DC40E31B1E4C6FBA /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BE62142CCC4A791F05163A /* Token.swift */; };
 		28D2CDAAB0777233D4465A83 /* ReporterArchiveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F88C880B5DE69964C6A37 /* ReporterArchiveTests.swift */; };
 		3175E324135E1CF5A73683D1 /* ReporterTimeZones.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7196D553D769071DB876B606 /* ReporterTimeZones.swift */; };
@@ -17,23 +18,33 @@
 		3FBE5C53D33EF78752BEACE0 /* ReporterImportVerifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED0CAE575381DCB86FB8EE9 /* ReporterImportVerifier.swift */; };
 		406D536D7764B3FEB140CAA0 /* EntityMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BE7248E73E2859EFF232170 /* EntityMapping.swift */; };
 		4A0DEFB7E69A9FC5EAAD99D4 /* RealExportVerificationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DF3B490F336FCE1E1E3DDBA /* RealExportVerificationTests.swift */; };
+		540CA20A213B0446B6F71885 /* Vocabulary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74FF461F6E8A0241C18357B2 /* Vocabulary.swift */; };
 		68DDAB8BB2E679EB7EC1E9C1 /* ReporterImportPlan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798E1DE82BD53EC5BEBA76B7 /* ReporterImportPlan.swift */; };
 		6F06CC539C4D17B343A9321C /* LegacyBlob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30FFB17809ADA84F1036E2A7 /* LegacyBlob.swift */; };
+		85A36A88AB170F0EAC0DAC03 /* QuestionPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A77AE6DE479403D1D4C9CF /* QuestionPage.swift */; };
+		89AC740ACEABE2AE5453E683 /* SurveyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844ABAD88442C143BA239374 /* SurveyModel.swift */; };
 		89AD9247DEBDB7017EC8E017 /* reporter-fixture.json in Resources */ = {isa = PBXBuildFile; fileRef = 60457C07EF790C11D6C47EDF /* reporter-fixture.json */; };
 		8ADBA81D5D9ECCDCD5BDA742 /* JSONSlicerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AFF3D49ED9E8AC69390925 /* JSONSlicerTests.swift */; };
 		8AF60BB296144ED9D11EA053 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6024EA06BE24A189D4F7D0E4 /* Response.swift */; };
 		961848A8D899BC67FA43F475 /* ReportageApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 383FF2C73A8FBAA2AB13D653 /* ReportageApp.swift */; };
 		964408E4D25713F627048C77 /* ModelCodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C606A9B0EF8D84950B9681B /* ModelCodingTests.swift */; };
+		97BC8348B7F48AF0473691FC /* ReportStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28AD66BC8ED4AEABF6640108 /* ReportStore.swift */; };
 		9EF3CB3707CD6B5AFFD3B767 /* ReporterArchive.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1C5F0F722477CDA949F018 /* ReporterArchive.swift */; };
-		AD22705E9154633961006403 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A5B8284AB637F8542721C8A /* ContentView.swift */; };
+		B00AC94E13BC9C602179953E /* SurveyModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E382405EE9DBEC8EE616C1D /* SurveyModelTests.swift */; };
 		B510BB2C1C11D72DFE15E3C7 /* ReportageExportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DB6FF151DCEBC3913131834 /* ReportageExportTests.swift */; };
+		BD8D81CBF8C3DE544BB7540C /* DefaultQuestions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94DB0CA378AEF82B3CB27B67 /* DefaultQuestions.swift */; };
 		C5D94FEC4507054E6497E85B /* PersistenceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C0B5BB02ECDBE84F5F73FA /* PersistenceController.swift */; };
+		C71E99843CC3D9DE4468B36B /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878CE0FF7A2598F4197E8E61 /* Environment.swift */; };
 		C8E02DEA2119E61D31667FFE /* ReporterImportPlanTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FD562C0C92C1D59881C771E /* ReporterImportPlanTests.swift */; };
+		D7F95FB1236974113EBE93FA /* ReportKind+Title.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5591E042089D038B59B26E9F /* ReportKind+Title.swift */; };
+		D9A8839569734F5CEAC43A44 /* TokenAnswer.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF998798373C9CCAD65999B3 /* TokenAnswer.swift */; };
 		DF632654B427EE32C44C6F78 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F200EBD30BC12D2313E6C6F /* Context.swift */; };
 		E0137FEEBF13F5D14C07656F /* ReportageExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7F1ECC4B803EFFD88FFF52B /* ReportageExport.swift */; };
 		E68EF6274FD2F6D54D49F5BD /* ReporterImporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917C4579342FAC42F6C616FC /* ReporterImporterTests.swift */; };
 		E8CC84072697836F87D8A00D /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A20C574BC234EDBD4056E2B7 /* TestHelpers.swift */; };
+		EA730F4FD060F5843CC5B422 /* SurveyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7998F9826B899741323C0C7 /* SurveyView.swift */; };
 		EFF44121C9ECBFBCAC1D7730 /* ReportageModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = A49FBFD55992A79B9A6492C4 /* ReportageModel.xcdatamodeld */; };
+		F19C484161953117D77C2CB1 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854283FD34C4320F3F3136FF /* HomeView.swift */; };
 		F38A1CCFAF016AB982EAB791 /* Question.swift in Sources */ = {isa = PBXBuildFile; fileRef = B007E6BACAA214C7332EF77C /* Question.swift */; };
 /* End PBXBuildFile section */
 
@@ -50,12 +61,15 @@
 /* Begin PBXFileReference section */
 		0B35602A218BE4EE399835FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
 		1F200EBD30BC12D2313E6C6F /* Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = "<group>"; };
+		24A77AE6DE479403D1D4C9CF /* QuestionPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionPage.swift; sourceTree = "<group>"; };
+		28AD66BC8ED4AEABF6640108 /* ReportStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportStore.swift; sourceTree = "<group>"; };
 		30FFB17809ADA84F1036E2A7 /* LegacyBlob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyBlob.swift; sourceTree = "<group>"; };
 		383FF2C73A8FBAA2AB13D653 /* ReportageApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportageApp.swift; sourceTree = "<group>"; };
 		3DF3B490F336FCE1E1E3DDBA /* RealExportVerificationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealExportVerificationTests.swift; sourceTree = "<group>"; };
 		3ED0CAE575381DCB86FB8EE9 /* ReporterImportVerifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImportVerifier.swift; sourceTree = "<group>"; };
 		487F88C880B5DE69964C6A37 /* ReporterArchiveTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterArchiveTests.swift; sourceTree = "<group>"; };
 		48D44876FDE4293FA0460595 /* ReporterImporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImporter.swift; sourceTree = "<group>"; };
+		5591E042089D038B59B26E9F /* ReportKind+Title.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ReportKind+Title.swift"; sourceTree = "<group>"; };
 		5BE7248E73E2859EFF232170 /* EntityMapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntityMapping.swift; sourceTree = "<group>"; };
 		5C2AB8F226532A0889E2BCAD /* Reportage.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Reportage.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		5C606A9B0EF8D84950B9681B /* ModelCodingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelCodingTests.swift; sourceTree = "<group>"; };
@@ -63,17 +77,25 @@
 		60457C07EF790C11D6C47EDF /* reporter-fixture.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "reporter-fixture.json"; sourceTree = "<group>"; };
 		61C0B5BB02ECDBE84F5F73FA /* PersistenceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistenceController.swift; sourceTree = "<group>"; };
 		643C730A99F0B7BA8C1F8A8E /* JSONSlicer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONSlicer.swift; sourceTree = "<group>"; };
+		6E382405EE9DBEC8EE616C1D /* SurveyModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyModelTests.swift; sourceTree = "<group>"; };
 		7196D553D769071DB876B606 /* ReporterTimeZones.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterTimeZones.swift; sourceTree = "<group>"; };
+		74FF461F6E8A0241C18357B2 /* Vocabulary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vocabulary.swift; sourceTree = "<group>"; };
 		798E1DE82BD53EC5BEBA76B7 /* ReporterImportPlan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImportPlan.swift; sourceTree = "<group>"; };
 		7ABE75DB46245AFDE8A44A48 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
 		7DB6FF151DCEBC3913131834 /* ReportageExportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportageExportTests.swift; sourceTree = "<group>"; };
 		7FD562C0C92C1D59881C771E /* ReporterImportPlanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImportPlanTests.swift; sourceTree = "<group>"; };
+		844ABAD88442C143BA239374 /* SurveyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyModel.swift; sourceTree = "<group>"; };
+		84E55C093BA98D8700F406AE /* ReportStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportStoreTests.swift; sourceTree = "<group>"; };
+		854283FD34C4320F3F3136FF /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
+		878CE0FF7A2598F4197E8E61 /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = "<group>"; };
 		917C4579342FAC42F6C616FC /* ReporterImporterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImporterTests.swift; sourceTree = "<group>"; };
-		9A5B8284AB637F8542721C8A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
+		94DB0CA378AEF82B3CB27B67 /* DefaultQuestions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultQuestions.swift; sourceTree = "<group>"; };
 		A20C574BC234EDBD4056E2B7 /* TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHelpers.swift; sourceTree = "<group>"; };
 		A3BE62142CCC4A791F05163A /* Token.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Token.swift; sourceTree = "<group>"; };
 		B007E6BACAA214C7332EF77C /* Question.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Question.swift; sourceTree = "<group>"; };
 		B03734F91822E7F161432075 /* Report.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Report.swift; sourceTree = "<group>"; };
+		B7998F9826B899741323C0C7 /* SurveyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyView.swift; sourceTree = "<group>"; };
+		BF998798373C9CCAD65999B3 /* TokenAnswer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenAnswer.swift; sourceTree = "<group>"; };
 		CC1C5F0F722477CDA949F018 /* ReporterArchive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterArchive.swift; sourceTree = "<group>"; };
 		CD433A98973E8B13E42230A1 /* ReportageExporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportageExporter.swift; sourceTree = "<group>"; };
 		D03D0770BA2E26D7E4A7DECC /* ReportageModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = ReportageModel.xcdatamodel; sourceTree = "<group>"; };
@@ -83,6 +105,17 @@
 /* End PBXFileReference section */
 
 /* Begin PBXGroup section */
+		23711442404F0476532D0FC2 /* Survey */ = {
+			isa = PBXGroup;
+			children = (
+				24A77AE6DE479403D1D4C9CF /* QuestionPage.swift */,
+				844ABAD88442C143BA239374 /* SurveyModel.swift */,
+				B7998F9826B899741323C0C7 /* SurveyView.swift */,
+				BF998798373C9CCAD65999B3 /* TokenAnswer.swift */,
+			);
+			path = Survey;
+			sourceTree = "<group>";
+		};
 		4C708676FBAD641AD92F8CA0 /* Reportage */ = {
 			isa = PBXGroup;
 			children = (
@@ -98,6 +131,7 @@
 			isa = PBXGroup;
 			children = (
 				1F200EBD30BC12D2313E6C6F /* Context.swift */,
+				94DB0CA378AEF82B3CB27B67 /* DefaultQuestions.swift */,
 				B007E6BACAA214C7332EF77C /* Question.swift */,
 				B03734F91822E7F161432075 /* Report.swift */,
 				6024EA06BE24A189D4F7D0E4 /* Response.swift */,
@@ -144,6 +178,8 @@
 				487F88C880B5DE69964C6A37 /* ReporterArchiveTests.swift */,
 				917C4579342FAC42F6C616FC /* ReporterImporterTests.swift */,
 				7FD562C0C92C1D59881C771E /* ReporterImportPlanTests.swift */,
+				84E55C093BA98D8700F406AE /* ReportStoreTests.swift */,
+				6E382405EE9DBEC8EE616C1D /* SurveyModelTests.swift */,
 			);
 			name = Unit;
 			path = Tests/Unit;
@@ -185,6 +221,8 @@
 				5BE7248E73E2859EFF232170 /* EntityMapping.swift */,
 				30FFB17809ADA84F1036E2A7 /* LegacyBlob.swift */,
 				61C0B5BB02ECDBE84F5F73FA /* PersistenceController.swift */,
+				28AD66BC8ED4AEABF6640108 /* ReportStore.swift */,
+				74FF461F6E8A0241C18357B2 /* Vocabulary.swift */,
 				A49FBFD55992A79B9A6492C4 /* ReportageModel.xcdatamodeld */,
 			);
 			path = Persistence;
@@ -193,7 +231,10 @@
 		CA92EB21187B147C08A112F7 /* Views */ = {
 			isa = PBXGroup;
 			children = (
-				9A5B8284AB637F8542721C8A /* ContentView.swift */,
+				878CE0FF7A2598F4197E8E61 /* Environment.swift */,
+				854283FD34C4320F3F3136FF /* HomeView.swift */,
+				5591E042089D038B59B26E9F /* ReportKind+Title.swift */,
+				23711442404F0476532D0FC2 /* Survey */,
 			);
 			path = Views;
 			sourceTree = "<group>";
@@ -316,10 +357,12 @@
 				8ADBA81D5D9ECCDCD5BDA742 /* JSONSlicerTests.swift in Sources */,
 				964408E4D25713F627048C77 /* ModelCodingTests.swift in Sources */,
 				4A0DEFB7E69A9FC5EAAD99D4 /* RealExportVerificationTests.swift in Sources */,
+				0F052B8A2C73437F57E927E7 /* ReportStoreTests.swift in Sources */,
 				B510BB2C1C11D72DFE15E3C7 /* ReportageExportTests.swift in Sources */,
 				28D2CDAAB0777233D4465A83 /* ReporterArchiveTests.swift in Sources */,
 				C8E02DEA2119E61D31667FFE /* ReporterImportPlanTests.swift in Sources */,
 				E68EF6274FD2F6D54D49F5BD /* ReporterImporterTests.swift in Sources */,
+				B00AC94E13BC9C602179953E /* SurveyModelTests.swift in Sources */,
 				E8CC84072697836F87D8A00D /* TestHelpers.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -328,14 +371,19 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				AD22705E9154633961006403 /* ContentView.swift in Sources */,
 				DF632654B427EE32C44C6F78 /* Context.swift in Sources */,
+				BD8D81CBF8C3DE544BB7540C /* DefaultQuestions.swift in Sources */,
 				406D536D7764B3FEB140CAA0 /* EntityMapping.swift in Sources */,
+				C71E99843CC3D9DE4468B36B /* Environment.swift in Sources */,
+				F19C484161953117D77C2CB1 /* HomeView.swift in Sources */,
 				3244B8439B5E4F79FF84C156 /* JSONSlicer.swift in Sources */,
 				6F06CC539C4D17B343A9321C /* LegacyBlob.swift in Sources */,
 				C5D94FEC4507054E6497E85B /* PersistenceController.swift in Sources */,
 				F38A1CCFAF016AB982EAB791 /* Question.swift in Sources */,
+				85A36A88AB170F0EAC0DAC03 /* QuestionPage.swift in Sources */,
 				06415D2A2EDA6E92ECAC96FA /* Report.swift in Sources */,
+				D7F95FB1236974113EBE93FA /* ReportKind+Title.swift in Sources */,
+				97BC8348B7F48AF0473691FC /* ReportStore.swift in Sources */,
 				961848A8D899BC67FA43F475 /* ReportageApp.swift in Sources */,
 				E0137FEEBF13F5D14C07656F /* ReportageExport.swift in Sources */,
 				047D3797389624E8B4AF44B4 /* ReportageExporter.swift in Sources */,
@@ -346,7 +394,11 @@
 				36A35625365E87B39CB88194 /* ReporterImporter.swift in Sources */,
 				3175E324135E1CF5A73683D1 /* ReporterTimeZones.swift in Sources */,
 				8AF60BB296144ED9D11EA053 /* Response.swift in Sources */,
+				89AC740ACEABE2AE5453E683 /* SurveyModel.swift in Sources */,
+				EA730F4FD060F5843CC5B422 /* SurveyView.swift in Sources */,
 				25BC9F95DC40E31B1E4C6FBA /* Token.swift in Sources */,
+				D9A8839569734F5CEAC43A44 /* TokenAnswer.swift in Sources */,
+				540CA20A213B0446B6F71885 /* Vocabulary.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

diff --git a/Reportage/ReportageApp.swift b/Reportage/ReportageApp.swift

@@ -1,13 +1,25 @@
+import OSLog
 import SwiftUI
 
 @main
 struct ReportageApp: App {
     private let persistence = PersistenceController()
+    private let logger = Logger(subsystem: "net.inqk.reportage", category: "App")
 
     var body: some Scene {
         WindowGroup {
-            ContentView()
+            HomeView()
                 .environment(\.managedObjectContext, persistence.viewContext)
+                .environment(\.reportStore, ReportStore(persistence: persistence))
+                .task { await seedDefaultQuestions() }
+        }
+    }
+
+    private func seedDefaultQuestions() async {
+        do {
+            try await ReportStore(persistence: persistence).seedDefaultQuestionsIfNeeded()
+        } catch {
+            logger.error("Couldn't add the default questions: \(error)")
         }
     }
 }

diff --git a/Reportage/Views/ContentView.swift b/Reportage/Views/ContentView.swift

@@ -1,12 +0,0 @@
-import SwiftUI
-
-/// Placeholder until the Phase 2 survey and report list exist.
-struct ContentView: View {
-    var body: some View {
-        ContentUnavailableView("Reportage", systemImage: "list.bullet.clipboard")
-    }
-}
-
-#Preview {
-    ContentView()
-}

diff --git a/Reportage/Views/Environment.swift b/Reportage/Views/Environment.swift

@@ -0,0 +1,6 @@
+import SwiftUI
+
+extension EnvironmentValues {
+    /// The app's store. `nil` only in previews that don't provide one.
+    @Entry var reportStore: ReportStore? = nil
+}

diff --git a/Reportage/Views/HomeView.swift b/Reportage/Views/HomeView.swift

@@ -0,0 +1,104 @@
+import CoreData
+import SwiftUI
+
+/// The app's main screen: recent reports, and the button that starts one.
+struct HomeView: View {
+    @State private var survey: SurveyRequest?
+
+    var body: some View {
+        NavigationStack {
+            ReportList()
+                .navigationTitle("Reportage")
+                .toolbar {
+                    ToolbarItem(placement: .primaryAction) {
+                        NewReportMenu { kind in survey = SurveyRequest(kind: kind) }
+                    }
+                }
+        }
+        .sheet(item: $survey) { request in
+            SurveySheet(request: request)
+        }
+    }
+}
+
+struct NewReportMenu: View {
+    let onStart: (ReportKind) -> Void
+
+    var body: some View {
+        Menu {
+            Button("Report", systemImage: "square.and.pencil") { onStart(.manual) }
+            Button("Wake Report", systemImage: "sunrise") { onStart(.wake) }
+            Button("Bedtime Report", systemImage: "moon") { onStart(.bedtime) }
+        } label: {
+            Label("New Report", systemImage: "plus")
+        } primaryAction: {
+            onStart(.manual)
+        }
+    }
+}
+
+/// Reports, newest first.
+struct ReportList: View {
+    @FetchRequest(fetchRequest: ReportList.request) private var reports: FetchedResults<ReportEntity>
+
+    private static var request: NSFetchRequest<ReportEntity> {
+        let request = ReportEntity.fetchRequest()
+        request.sortDescriptors = [NSSortDescriptor(key: "date", ascending: false)]
+        request.fetchBatchSize = 50
+        return request
+    }
+
+    var body: some View {
+        if reports.isEmpty {
+            ContentUnavailableView(
+                "No Reports",
+                systemImage: "list.bullet.clipboard",
+                description: Text("Tap + to make your first report.")
+            )
+        } else {
+            List(reports) { report in
+                ReportRow(
+                    date: report.date,
+                    timeZone: report.timeZone,
+                    kind: report.kind.flatMap(ReportKind.init)
+                )
+            }
+        }
+    }
+}
+
+struct ReportRow: View {
+    let date: Date?
+    let timeZone: String?
+    let kind: ReportKind?
+
+    var body: some View {
+        VStack(alignment: .leading) {
+            Text((kind ?? .manual).title)
+                .font(.headline)
+            if let date {
+                Text(date, format: Self.format(in: timeZone))
+                    .font(.subheadline)
+                    .foregroundStyle(.secondary)
+            }
+        }
+    }
+
+    /// Reports show their own local time, wherever they were made.
+    private static func format(in timeZone: String?) -> Date.FormatStyle {
+        var style = Date.FormatStyle(date: .abbreviated, time: .shortened)
+        if let zone = timeZone.flatMap(TimeZone.init(identifier:)) {
+            style.timeZone = zone
+        }
+        return style
+    }
+}
+
+#Preview {
+    let persistence = PersistenceController(inMemory: true)
+    let store = ReportStore(persistence: persistence)
+    HomeView()
+        .environment(\.managedObjectContext, persistence.viewContext)
+        .environment(\.reportStore, store)
+        .task { _ = try? await store.seedDefaultQuestionsIfNeeded() }
+}

diff --git a/Reportage/Views/ReportKind+Title.swift b/Reportage/Views/ReportKind+Title.swift

@@ -0,0 +1,12 @@
+import Foundation
+
+extension ReportKind {
+    var title: LocalizedStringResource {
+        switch self {
+        case .random: "Prompted Report"
+        case .manual: "Report"
+        case .wake: "Wake Report"
+        case .bedtime: "Bedtime Report"
+        }
+    }
+}

diff --git a/Reportage/Views/Survey/QuestionPage.swift b/Reportage/Views/Survey/QuestionPage.swift

@@ -0,0 +1,159 @@
+import SwiftUI
+
+/// One page of a survey: the prompt, and the answer control for its kind.
+struct QuestionPage: View {
+    let question: Question
+    let model: SurveyModel
+    /// Called when a single tap has answered the question.
+    let onAnswer: () -> Void
+
+    var body: some View {
+        @Bindable var model = model
+        VStack(alignment: .leading, spacing: 20) {
+            Text(question.prompt)
+                .font(.title2.bold())
+                .frame(maxWidth: .infinity, alignment: .leading)
+                .padding(.horizontal)
+            switch question.kind {
+            case .yesNo:
+                YesNoAnswer(selection: $model[optionFor: question.id], onAnswer: onAnswer)
+            case .choice:
+                ChoiceAnswer(
+                    options: question.options,
+                    selection: $model[optionFor: question.id],
+                    onAnswer: onAnswer
+                )
+            case .tokens, .people, .location:
+                if let picker = model.pickers[question.id] {
+                    TokenAnswer(picker: picker, placeholder: question.placeholder)
+                }
+            case .number:
+                NumberAnswer(value: $model[numberFor: question.id], placeholder: question.placeholder)
+            case .note:
+                NoteAnswer(text: $model[textFor: question.id])
+            }
+        }
+        .padding(.top)
+        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
+    }
+}
+
+/// A full-width answer button, highlighted when selected.
+struct AnswerOptionButton: View {
+    let title: Text
+    let isSelected: Bool
+    let action: () -> Void
+
+    var body: some View {
+        Button(action: action) {
+            HStack {
+                title
+                Spacer()
+                if isSelected {
+                    Image(systemName: "checkmark")
+                        .fontWeight(.semibold)
+                }
+            }
+            .font(.title3)
+            .padding()
+            .frame(maxWidth: .infinity)
+            .contentShape(.rect)
+            .background(
+                isSelected ? AnyShapeStyle(.tint.opacity(0.2)) : AnyShapeStyle(.fill.tertiary),
+                in: .rect(cornerRadius: 12)
+            )
+        }
+        .buttonStyle(.plain)
+        .accessibilityAddTraits(isSelected ? .isSelected : [])
+    }
+}
+
+struct YesNoAnswer: View {
+    @Binding var selection: String?
+    let onAnswer: () -> Void
+
+    var body: some View {
+        VStack(spacing: 12) {
+            AnswerOptionButton(
+                title: Text("Yes", comment: "Answer to a yes/no question"),
+                isSelected: selection == ResponseValue.yesOption
+            ) {
+                select(ResponseValue.yesOption)
+            }
+            AnswerOptionButton(
+                title: Text("No", comment: "Answer to a yes/no question"),
+                isSelected: selection == ResponseValue.noOption
+            ) {
+                select(ResponseValue.noOption)
+            }
+        }
+        .padding(.horizontal)
+    }
+
+    private func select(_ option: String) {
+        selection = option
+        onAnswer()
+    }
+}
+
+struct ChoiceAnswer: View {
+    let options: [String]
+    @Binding var selection: String?
+    let onAnswer: () -> Void
+
+    var body: some View {
+        ScrollView {
+            VStack(spacing: 12) {
+                ForEach(options, id: \.self) { option in
+                    AnswerOptionButton(title: Text(option), isSelected: selection == option) {
+                        selection = option
+                        onAnswer()
+                    }
+                }
+            }
+            .padding(.horizontal)
+        }
+    }
+}
+
+struct NumberAnswer: View {
+    @Binding var value: Decimal?
+    let placeholder: String?
+
+    @State private var text = ""
+    @FocusState private var isFocused: Bool
+
+    var body: some View {
+        TextField(placeholder ?? String(localized: "Number"), text: $text)
+            .keyboardType(.decimalPad)
+            .font(.largeTitle.monospacedDigit())
+            .focused($isFocused)
+            .padding()
+            .background(.fill.tertiary, in: .rect(cornerRadius: 12))
+            .padding(.horizontal)
+            .onAppear {
+                text = value?.formatted() ?? ""
+                isFocused = true
+            }
+            .onChange(of: text) {
+                let trimmed = text.trimmingCharacters(in: .whitespaces)
+                value = trimmed.isEmpty ? nil : try? Decimal(trimmed, format: .number)
+            }
+    }
+}
+
+struct NoteAnswer: View {
+    @Binding var text: String
+
+    @FocusState private var isFocused: Bool
+
+    var body: some View {
+        TextEditor(text: $text)
+            .focused($isFocused)
+            .scrollContentBackground(.hidden)
+            .padding(8)
+            .background(.fill.tertiary, in: .rect(cornerRadius: 12))
+            .padding(.horizontal)
+            .onAppear { isFocused = true }
+    }
+}

diff --git a/Reportage/Views/Survey/SurveyModel.swift b/Reportage/Views/Survey/SurveyModel.swift

@@ -0,0 +1,274 @@
+import Foundation
+import Observation
+
+/// One survey in progress: the questions it asks, one per page, and the
+/// answers given so far. Nothing is saved until `makeReport(now:)` is used.
+@MainActor
+@Observable
+final class SurveyModel {
+    let kind: ReportKind
+    /// The moment the report describes: when the survey was started.
+    let date: Date
+    let timeZone: String
+    let questions: [Question]
+    /// Pickers for `tokens`, `people` and `location` questions, by question
+    /// ID. They're created once so each page keeps its search and selection.
+    let pickers: [String: TokenPicker]
+
+    private(set) var index = 0
+    /// Whether the last page change went forwards, for the page transition.
+    private(set) var isMovingForward = true
+    private var answers: [String: ResponseValue] = [:]
+
+    init(
+        kind: ReportKind,
+        date: Date,
+        timeZone: TimeZone = .current,
+        questions: [Question],
+        vocabulary: [String: [VocabularyEntry]]
+    ) {
+        self.kind = kind
+        self.date = date
+        self.timeZone = timeZone.identifier
+        self.questions = questions
+        var pickers: [String: TokenPicker] = [:]
+        for question in questions {
+            let allowsMultiple: Bool
+            switch question.kind {
+            case .tokens, .people: allowsMultiple = true
+            case .location: allowsMultiple = false
+            case .yesNo, .choice, .number, .note: continue
+            }
+            pickers[question.id] = TokenPicker(
+                questionID: question.id,
+                allowsMultiple: allowsMultiple,
+                isPlace: question.kind == .location,
+                entries: vocabulary[question.id] ?? []
+            )
+        }
+        self.pickers = pickers
+    }
+
+    var currentQuestion: Question? {
+        questions.indices.contains(index) ? questions[index] : nil
+    }
+
+    var isLastQuestion: Bool { index >= questions.count - 1 }
+
+    /// Whether anything has been answered, so cancelling would lose work.
+    var hasAnswers: Bool {
+        questions.contains { value(for: $0) != nil }
+    }
+
+    // MARK: Answers
+
+    /// The chosen option of a `yesNo` or `choice` question.
+    subscript(optionFor questionID: String) -> String? {
+        get {
+            guard case .options(let options) = answers[questionID] else { return nil }
+            return options.first
+        }
+        set { answers[questionID] = newValue.map { .options([$0]) } }
+    }
+
+    subscript(numberFor questionID: String) -> Decimal? {
+        get {
+            guard case .number(let number) = answers[questionID] else { return nil }
+            return number
+        }
+        set { answers[questionID] = newValue.map { .number($0) } }
+    }
+
+    subscript(textFor questionID: String) -> String {
+        get {
+            guard case .text(let text) = answers[questionID] else { return "" }
+            return text
+        }
+        set { answers[questionID] = newValue.isEmpty ? nil : .text(newValue) }
+    }
+
+    /// The answer to `question`, or `nil` if it has none.
+    func value(for question: Question) -> ResponseValue? {
+        switch question.kind {
+        case .yesNo, .choice, .number:
+            return answers[question.id]
+        case .note:
+            guard case .text(let text) = answers[question.id],
+                !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
+            else { return nil }
+            return .text(text)
+        case .tokens, .people:
+            guard let selection = pickers[question.id]?.selection, !selection.isEmpty else {
+                return nil
+            }
+            return .tokens(selection)
+        case .location:
+            guard let tokenID = pickers[question.id]?.selection.first else { return nil }
+            return .place(PlaceAnswer(tokenID: tokenID))
+        }
+    }
+
+    // MARK: Paging
+
+    /// Moves to the next question. Returns `false` on the last question.
+    @discardableResult
+    func advance() -> Bool {
+        guard !isLastQuestion else { return false }
+        isMovingForward = true
+        index += 1
+        return true
+    }
+
+    /// Moves to the next question if `index` is still the current one, so an
+    /// answer tapped twice doesn't skip the question after it.
+    func advance(from index: Int) {
+        guard index == self.index else { return }
+        advance()
+    }
+
+    func goBack() {
+        guard index > 0 else { return }
+        isMovingForward = false
+        index -= 1
+    }
+
+    /// Clears the current question's answer, so it's recorded as skipped.
+    func clearCurrent() {
+        guard let question = currentQuestion else { return }
+        answers[question.id] = nil
+        pickers[question.id]?.clear()
+    }
+
+    // MARK: Saving
+
+    /// The finished report, with a response for every question in the
+    /// survey (skipped questions have no value), and the tokens created
+    /// while answering that the report uses.
+    func makeReport(id: UUID = UUID(), now: Date) -> (report: Report, newTokens: [Token]) {
+        let responses = questions.map { question in
+            Response(questionID: question.id, prompt: question.prompt, value: value(for: question))
+        }
+        let newTokens = questions.flatMap { question in
+            pickers[question.id]?.usedNewTokens(now: now) ?? []
+        }
+        let report = Report(
+            id: id,
+            date: date,
+            timeZone: timeZone,
+            kind: kind,
+            trigger: .app,
+            state: .complete,
+            completedAt: now,
+            responses: responses,
+            modifiedAt: now
+        )
+        return (report, newTokens)
+    }
+}
+
+/// Searching, selecting and adding tokens for one question.
+@MainActor
+@Observable
+final class TokenPicker {
+    let questionID: String
+    let allowsMultiple: Bool
+    let isPlace: Bool
+
+    var query = "" {
+        didSet { updateVisibleEntries() }
+    }
+
+    /// The entries matching `query`, in rank order.
+    private(set) var visibleEntries: [VocabularyEntry] = []
+    /// Whether `query` names no existing entry, so it can be added.
+    private(set) var canAddQuery = false
+    /// Selected token IDs, in the order they were chosen.
+    private(set) var selection: [String] = [] {
+        didSet { updateSelectedEntries() }
+    }
+    private(set) var selectedEntries: [VocabularyEntry] = []
+
+    private var entries: [VocabularyEntry] {
+        didSet {
+            updateVisibleEntries()
+            updateSelectedEntries()
+        }
+    }
+    /// Texts of tokens added in this survey, by ID.
+    private var newTokenTexts: [String: String] = [:]
+
+    init(questionID: String, allowsMultiple: Bool, isPlace: Bool, entries: [VocabularyEntry]) {
+        self.questionID = questionID
+        self.allowsMultiple = allowsMultiple
+        self.isPlace = isPlace
+        self.entries = entries
+        updateVisibleEntries()
+    }
+
+    func isSelected(_ id: String) -> Bool { selection.contains(id) }
+
+    func toggle(_ id: String) {
+        if let position = selection.firstIndex(of: id) {
+            selection.remove(at: position)
+        } else if allowsMultiple {
+            selection.append(id)
+        } else {
+            selection = [id]
+        }
+    }
+
+    /// Selects the entry `query` names, adding it as a new token if there's
+    /// none, and clears the query.
+    func addQuery() {
+        let text = query.trimmingCharacters(in: .whitespacesAndNewlines)
+        guard !text.isEmpty else { return }
+        if let existing = entry(named: text) {
+            if !isSelected(existing.id) { toggle(existing.id) }
+        } else {
+            let id = UUID().uuidString
+            newTokenTexts[id] = text
+            entries.insert(VocabularyEntry(id: id, text: text, useCount: 0), at: 0)
+            toggle(id)
+        }
+        query = ""
+    }
+
+    func clear() {
+        selection = []
+        query = ""
+    }
+
+    /// Tokens added in this survey that are still selected.
+    func usedNewTokens(now: Date) -> [Token] {
+        selection.compactMap { id in
+            newTokenTexts[id].map { text in
+                Token(
+                    id: id,
+                    questionID: questionID,
+                    text: text,
+                    place: isPlace ? PlaceDetails() : nil,
+                    modifiedAt: now
+                )
+            }
+        }
+    }
+
+    private func entry(named text: String) -> VocabularyEntry? {
+        entries.first {
+            $0.text.compare(text, options: [.caseInsensitive, .diacriticInsensitive])
+                == .orderedSame
+        }
+    }
+
+    private func updateVisibleEntries() {
+        let text = query.trimmingCharacters(in: .whitespacesAndNewlines)
+        visibleEntries =
+            text.isEmpty ? entries : entries.filter { $0.text.localizedStandardContains(text) }
+        canAddQuery = !text.isEmpty && entry(named: text) == nil
+    }
+
+    private func updateSelectedEntries() {
+        let byID = Dictionary(entries.map { ($0.id, $0) }, uniquingKeysWith: { first, _ in first })
+        selectedEntries = selection.compactMap { byID[$0] }
+    }
+}

diff --git a/Reportage/Views/Survey/SurveyView.swift b/Reportage/Views/Survey/SurveyView.swift

@@ -0,0 +1,213 @@
+import SwiftUI
+
+/// What to survey: a report of `kind` describing `date`.
+struct SurveyRequest: Identifiable {
+    let id = UUID()
+    var kind: ReportKind
+    var date = Date()
+}
+
+/// Loads the questions and suggestions for a survey, then presents it.
+struct SurveySheet: View {
+    let request: SurveyRequest
+
+    @Environment(\.reportStore) private var store
+    @State private var model: SurveyModel?
+    @State private var loadError: String?
+
+    var body: some View {
+        Group {
+            if let model {
+                SurveyView(model: model)
+            } else if let loadError {
+                ContentUnavailableView(
+                    "Couldn't Load Survey",
+                    systemImage: "exclamationmark.triangle",
+                    description: Text(loadError)
+                )
+            } else {
+                ProgressView()
+            }
+        }
+        .task { await load() }
+    }
+
+    private func load() async {
+        guard model == nil, let store else { return }
+        do {
+            let questions = try await store.surveyQuestions(for: request.kind)
+            let tokenQuestions = questions.filter {
+                [QuestionKind.tokens, .people, .location].contains($0.kind)
+            }
+            let vocabulary = try await store.vocabulary(for: tokenQuestions.map(\.id))
+            model = SurveyModel(
+                kind: request.kind,
+                date: request.date,
+                questions: questions,
+                vocabulary: vocabulary
+            )
+        } catch {
+            loadError = error.localizedDescription
+        }
+    }
+}
+
+/// A survey, one question per page.
+struct SurveyView: View {
+    let model: SurveyModel
+
+    @Environment(\.reportStore) private var store
+    @Environment(\.dismiss) private var dismiss
+    @State private var isConfirmingCancel = false
+    @State private var isSaving = false
+    @State private var saveError: String?
+    @State private var isShowingSaveError = false
+
+    var body: some View {
+        NavigationStack {
+            ZStack(alignment: .top) {
+                if let question = model.currentQuestion {
+                    QuestionPage(question: question, model: model, onAnswer: answered)
+                        .id(question.id)
+                        .transition(.push(from: model.isMovingForward ? .trailing : .leading))
+                } else {
+                    ContentUnavailableView(
+                        "No Questions",
+                        systemImage: "list.bullet.clipboard",
+                        description: Text("This survey has no questions. The report will be saved with its time.")
+                    )
+                }
+            }
+            .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
+            .clipped()
+            .navigationBarTitleDisplayMode(.inline)
+            .toolbar {
+                ToolbarItem(placement: .cancellationAction) {
+                    Button("Cancel", role: .cancel) {
+                        if model.hasAnswers {
+                            isConfirmingCancel = true
+                        } else {
+                            dismiss()
+                        }
+                    }
+                    .confirmationDialog(
+                        "Discard this report?",
+                        isPresented: $isConfirmingCancel,
+                        titleVisibility: .visible
+                    ) {
+                        Button("Discard Report", role: .destructive) { dismiss() }
+                    }
+                }
+                ToolbarItem(placement: .principal) {
+                    SurveyTitle(
+                        kind: model.kind,
+                        position: model.index + 1,
+                        count: model.questions.count
+                    )
+                }
+            }
+            .safeAreaInset(edge: .bottom) {
+                SurveyControls(
+                    canGoBack: model.index > 0,
+                    isLastQuestion: model.isLastQuestion,
+                    isSaving: isSaving,
+                    onBack: { withAnimation { model.goBack() } },
+                    onSkip: skip,
+                    onNext: next
+                )
+            }
+            .alert("Couldn't Save Report", isPresented: $isShowingSaveError) {
+                Button("OK", role: .cancel) {}
+            } message: {
+                if let saveError { Text(saveError) }
+            }
+        }
+        .interactiveDismissDisabled(model.hasAnswers)
+    }
+
+    /// Yes/no and choice answers move on by themselves, after a moment so
+    /// the selection can be seen.
+    private func answered() {
+        let index = model.index
+        guard !model.isLastQuestion else { return }
+        Task {
+            try? await Task.sleep(for: .milliseconds(250))
+            withAnimation { model.advance(from: index) }
+        }
+    }
+
+    private func skip() {
+        model.clearCurrent()
+        next()
+    }
+
+    private func next() {
+        if model.isLastQuestion {
+            save()
+        } else {
+            withAnimation { _ = model.advance() }
+        }
+    }
+
+    private func save() {
+        guard let store, !isSaving else { return }
+        isSaving = true
+        let (report, newTokens) = model.makeReport(now: Date())
+        Task {
+            do {
+                try await store.insert(report, newTokens: newTokens)
+                dismiss()
+            } catch {
+                saveError = error.localizedDescription
+                isShowingSaveError = true
+                isSaving = false
+            }
+        }
+    }
+}
+
+struct SurveyTitle: View {
+    let kind: ReportKind
+    let position: Int
+    let count: Int
+
+    var body: some View {
+        VStack(spacing: 0) {
+            Text(kind.title)
+                .font(.headline)
+            if count > 0 {
+                Text("\(position) of \(count)", comment: "Survey progress: the current question number, then the number of questions.")
+                    .font(.caption)
+                    .foregroundStyle(.secondary)
+                    .monospacedDigit()
+            }
+        }
+    }
+}
+
+struct SurveyControls: View {
+    let canGoBack: Bool
+    let isLastQuestion: Bool
+    let isSaving: Bool
+    let onBack: () -> Void
+    let onSkip: () -> Void
+    let onNext: () -> Void
+
+    var body: some View {
+        HStack {
+            Button("Back", systemImage: "chevron.backward", action: onBack)
+                .labelStyle(.iconOnly)
+                .disabled(!canGoBack)
+            Spacer()
+            Button("Skip", action: onSkip)
+            Button(action: onNext) {
+                Text(isLastQuestion ? "Done" : "Next")
+                    .frame(minWidth: 80)
+            }
+            .buttonStyle(.borderedProminent)
+        }
+        .controlSize(.large)
+        .disabled(isSaving)
+        .padding()
+    }
+}

diff --git a/Reportage/Views/Survey/TokenAnswer.swift b/Reportage/Views/Survey/TokenAnswer.swift

@@ -0,0 +1,137 @@
+import SwiftUI
+
+/// Answers a `tokens`, `people` or `location` question by picking from past
+/// answers, most used first, or adding a new one.
+struct TokenAnswer: View {
+    let picker: TokenPicker
+    let placeholder: String?
+
+    var body: some View {
+        @Bindable var picker = picker
+        VStack(spacing: 12) {
+            if !picker.selectedEntries.isEmpty {
+                SelectedTokens(entries: picker.selectedEntries, onRemove: picker.toggle)
+            }
+            TokenSearchField(
+                query: $picker.query,
+                placeholder: placeholder,
+                onSubmit: picker.addQuery
+            )
+            TokenList(picker: picker)
+        }
+    }
+}
+
+/// The chosen tokens, in the order they were picked. Tapping one removes it.
+struct SelectedTokens: View {
+    let entries: [VocabularyEntry]
+    let onRemove: (String) -> Void
+
+    var body: some View {
+        ScrollView(.horizontal) {
+            HStack {
+                ForEach(entries) { entry in
+                    Button {
+                        onRemove(entry.id)
+                    } label: {
+                        Label(entry.text, systemImage: "xmark")
+                            .labelStyle(TrailingIconLabelStyle())
+                    }
+                    .buttonStyle(.borderedProminent)
+                    .buttonBorderShape(.capsule)
+                    .accessibilityHint(Text("Removes this answer"))
+                }
+            }
+            .padding(.horizontal)
+        }
+        .scrollIndicators(.hidden)
+    }
+}
+
+struct TrailingIconLabelStyle: LabelStyle {
+    func makeBody(configuration: Configuration) -> some View {
+        HStack(spacing: 4) {
+            configuration.title
+            configuration.icon
+                .imageScale(.small)
+        }
+    }
+}
+
+struct TokenSearchField: View {
+    @Binding var query: String
+    let placeholder: String?
+    let onSubmit: () -> Void
+
+    var body: some View {
+        HStack {
+            Image(systemName: "magnifyingglass")
+                .foregroundStyle(.secondary)
+            TextField(placeholder ?? String(localized: "Search or add"), text: $query)
+                .autocorrectionDisabled()
+                .submitLabel(.done)
+                .onSubmit(onSubmit)
+            if !query.isEmpty {
+                Button("Clear", systemImage: "xmark.circle.fill") { query = "" }
+                    .labelStyle(.iconOnly)
+                    .foregroundStyle(.secondary)
+            }
+        }
+        .padding(10)
+        .background(.fill.tertiary, in: .rect(cornerRadius: 10))
+        .padding(.horizontal)
+    }
+}
+
+struct TokenList: View {
+    let picker: TokenPicker
+
+    var body: some View {
+        List {
+            if picker.canAddQuery {
+                Button {
+                    picker.addQuery()
+                } label: {
+                    Label {
+                        Text("Add “\(picker.query.trimmingCharacters(in: .whitespacesAndNewlines))”",
+                             comment: "Adds the typed text as a new answer")
+                    } icon: {
+                        Image(systemName: "plus.circle.fill")
+                    }
+                }
+            }
+            ForEach(picker.visibleEntries) { entry in
+                TokenRow(
+                    text: entry.text,
+                    isSelected: picker.isSelected(entry.id),
+                    onToggle: { picker.toggle(entry.id) }
+                )
+            }
+        }
+        .listStyle(.plain)
+        .scrollDismissesKeyboard(.immediately)
+    }
+}
+
+struct TokenRow: View {
+    let text: String
+    let isSelected: Bool
+    let onToggle: () -> Void
+
+    var body: some View {
+        Button(action: onToggle) {
+            HStack {
+                Text(text)
+                    .foregroundStyle(.primary)
+                Spacer()
+                if isSelected {
+                    Image(systemName: "checkmark")
+                        .foregroundStyle(.tint)
+                        .fontWeight(.semibold)
+                }
+            }
+            .contentShape(.rect)
+        }
+        .accessibilityAddTraits(isSelected ? .isSelected : [])
+    }
+}

diff --git a/Shared/Models/DefaultQuestions.swift b/Shared/Models/DefaultQuestions.swift

@@ -0,0 +1,98 @@
+import Foundation
+
+/// The questions a fresh install starts with, covering every question kind.
+///
+/// IDs are fixed rather than random so that seeding is idempotent, and so two
+/// devices that both seed the defaults end up with the same questions once
+/// they sync. Prompts and options are resolved in the user's language when the
+/// questions are seeded; after that they're ordinary data the user can edit.
+enum DefaultQuestions {
+    static func make(now: Date) -> [Question] {
+        func question(
+            _ id: String,
+            _ prompt: String,
+            _ kind: QuestionKind,
+            options: [String] = [],
+            askOn: SurveyKinds
+        ) -> Question {
+            Question(
+                id: "reportage-default-\(id)",
+                prompt: prompt,
+                kind: kind,
+                options: options,
+                askOn: askOn,
+                order: 0,
+                modifiedAt: now
+            )
+        }
+
+        let questions = [
+            question(
+                "sleep-quality",
+                String(localized: "How did you sleep?", comment: "Default wake question"),
+                .choice,
+                options: [
+                    String(localized: "Well", comment: "Answer to 'How did you sleep?'"),
+                    String(localized: "Okay", comment: "Answer to 'How did you sleep?'"),
+                    String(localized: "Poorly", comment: "Answer to 'How did you sleep?'"),
+                ],
+                askOn: .wake
+            ),
+            question(
+                "working",
+                String(localized: "Are you working?", comment: "Default question"),
+                .yesNo,
+                askOn: .random
+            ),
+            question(
+                "activity",
+                String(localized: "What are you doing?", comment: "Default question"),
+                .tokens,
+                askOn: .random
+            ),
+            question(
+                "location",
+                String(localized: "Where are you?", comment: "Default question"),
+                .location,
+                askOn: .random
+            ),
+            question(
+                "people",
+                String(localized: "Who are you with?", comment: "Default question"),
+                .people,
+                askOn: .random
+            ),
+            question(
+                "mood",
+                String(localized: "How do you feel?", comment: "Default question"),
+                .choice,
+                options: [
+                    String(localized: "Great", comment: "Answer to 'How do you feel?'"),
+                    String(localized: "Good", comment: "Answer to 'How do you feel?'"),
+                    String(localized: "Okay", comment: "Answer to 'How do you feel?'"),
+                    String(localized: "Bad", comment: "Answer to 'How do you feel?'"),
+                ],
+                askOn: .random
+            ),
+            question(
+                "coffee",
+                String(
+                    localized: "How many coffees did you have today?",
+                    comment: "Default bedtime question"),
+                .number,
+                askOn: .bedtime
+            ),
+            question(
+                "learned",
+                String(localized: "What did you learn today?", comment: "Default bedtime question"),
+                .note,
+                askOn: .bedtime
+            ),
+        ]
+        return questions.enumerated().map { index, question in
+            var question = question
+            question.order = index
+            return question
+        }
+    }
+}

diff --git a/Shared/Models/Response.swift b/Shared/Models/Response.swift

@@ -22,6 +22,13 @@ enum ResponseValue: Hashable, Sendable {
     case place(PlaceAnswer)
 }
 
+extension ResponseValue {
+    /// The options `yesNo` answers are stored with. These are fixed values
+    /// rather than display text, as they were in Reporter.
+    static let yesOption = "Yes"
+    static let noOption = "No"
+}
+
 extension ResponseValue: Codable {
     private enum CodingKeys: String, CodingKey {
         case options

diff --git a/Shared/Persistence/ReportStore.swift b/Shared/Persistence/ReportStore.swift

@@ -0,0 +1,64 @@
+import CoreData
+import Foundation
+
+/// Reads and writes the store for the app's screens. Each call runs on its
+/// own background context and returns value types.
+struct ReportStore: Sendable {
+    let persistence: PersistenceController
+
+    /// Adds the default questions if the store has no questions at all, so a
+    /// fresh install has a survey to show. A store with imported or edited
+    /// questions is left alone.
+    @discardableResult
+    func seedDefaultQuestionsIfNeeded(now: Date = Date()) async throws -> Bool {
+        let context = persistence.newBackgroundContext()
+        return try await context.perform {
+            let request = QuestionEntity.fetchRequest()
+            request.fetchLimit = 1
+            guard try context.count(for: request) == 0 else { return false }
+            for question in DefaultQuestions.make(now: now) {
+                try QuestionEntity(context: context).update(from: question)
+            }
+            try context.save()
+            return true
+        }
+    }
+
+    /// The questions a report of `kind` asks, in survey order.
+    func surveyQuestions(for kind: ReportKind) async throws -> [Question] {
+        let survey = SurveyKinds(surveyFor: kind)
+        let context = persistence.newBackgroundContext()
+        return try await context.perform {
+            let request = QuestionEntity.fetchRequest()
+            request.predicate = NSPredicate(format: "archivedAt == nil")
+            request.sortDescriptors = [
+                NSSortDescriptor(key: "order", ascending: true),
+                NSSortDescriptor(key: "id", ascending: true),
+            ]
+            return try context.fetch(request)
+                .map { try $0.question() }
+                .filter { $0.askOn.contains(survey) }
+        }
+    }
+
+    /// Ranked suggestions for each of `questionIDs`. See `Vocabulary`.
+    func vocabulary(for questionIDs: [String]) async throws -> [String: [VocabularyEntry]] {
+        let context = persistence.newBackgroundContext()
+        return try await context.perform {
+            try Vocabulary.entries(for: questionIDs, in: context)
+        }
+    }
+
+    /// Saves a new report together with the tokens created while answering
+    /// it, in one transaction.
+    func insert(_ report: Report, newTokens: [Token] = []) async throws {
+        let context = persistence.newBackgroundContext()
+        try await context.perform {
+            for token in newTokens {
+                try TokenEntity(context: context).update(from: token)
+            }
+            try ReportEntity(context: context).update(from: report)
+            try context.save()
+        }
+    }
+}

diff --git a/Shared/Persistence/Vocabulary.swift b/Shared/Persistence/Vocabulary.swift

@@ -0,0 +1,90 @@
+import CoreData
+import Foundation
+
+/// A token offered as a suggestion when answering a `tokens`, `people` or
+/// `location` question.
+struct VocabularyEntry: Identifiable, Hashable, Sendable {
+    var id: String
+    var text: String
+    var useCount: Int
+    var lastUsed: Date?
+}
+
+/// The derived, local-only index that ranks suggestions from response
+/// history. It's rebuilt from responses and never synced: token identity and
+/// text live in the `Token` records.
+enum Vocabulary {
+    /// Suggestions for each of `questionIDs`, most used first, then most
+    /// recently used. Archived tokens and tokens merged into others are left
+    /// out; uses of a merged token count towards the token it was merged into.
+    static func entries(
+        for questionIDs: [String],
+        in context: NSManagedObjectContext
+    ) throws -> [String: [VocabularyEntry]] {
+        guard !questionIDs.isEmpty else { return [:] }
+
+        let tokenRequest = TokenEntity.fetchRequest()
+        tokenRequest.predicate = NSPredicate(format: "questionID IN %@", questionIDs)
+        let tokens = try context.fetch(tokenRequest).map { try $0.token() }
+        let mergedInto = Dictionary(
+            uniqueKeysWithValues: tokens.compactMap { token in
+                token.mergedInto.map { (token.id, $0) }
+            })
+
+        func canonical(_ id: String) -> String {
+            var id = id
+            var seen: Set<String> = [id]
+            while let next = mergedInto[id], seen.insert(next).inserted {
+                id = next
+            }
+            return id
+        }
+
+        var useCounts: [String: Int] = [:]
+        var lastUsed: [String: Date] = [:]
+        let responseRequest = NSFetchRequest<NSDictionary>(entityName: "ResponseEntity")
+        responseRequest.resultType = .dictionaryResultType
+        responseRequest.predicate = NSPredicate(
+            format: "questionID IN %@ AND value != nil", questionIDs)
+        responseRequest.propertiesToFetch = ["value", "report.date"]
+        for row in try context.fetch(responseRequest) {
+            guard let data = row["value"] as? Data else { continue }
+            let ids: [String]
+            switch try ModelCoding.decode(ResponseValue.self, from: data) {
+            case .tokens(let tokenIDs): ids = tokenIDs
+            case .place(let place): ids = [place.tokenID]
+            default: continue
+            }
+            let date = row["report.date"] as? Date
+            for id in Set(ids.map(canonical)) {
+                useCounts[id, default: 0] += 1
+                if let date, date > lastUsed[id] ?? .distantPast {
+                    lastUsed[id] = date
+                }
+            }
+        }
+
+        var entries: [String: [VocabularyEntry]] = [:]
+        for token in tokens where token.mergedInto == nil && token.archivedAt == nil {
+            entries[token.questionID, default: []].append(
+                VocabularyEntry(
+                    id: token.id,
+                    text: token.text,
+                    useCount: useCounts[token.id] ?? 0,
+                    lastUsed: lastUsed[token.id]
+                ))
+        }
+        for questionID in entries.keys {
+            entries[questionID]?.sort(by: ranksBefore)
+        }
+        return entries
+    }
+
+    static func ranksBefore(_ lhs: VocabularyEntry, _ rhs: VocabularyEntry) -> Bool {
+        if lhs.useCount != rhs.useCount { return lhs.useCount > rhs.useCount }
+        let lhsDate = lhs.lastUsed ?? .distantPast
+        let rhsDate = rhs.lastUsed ?? .distantPast
+        if lhsDate != rhsDate { return lhsDate > rhsDate }
+        return lhs.text.localizedStandardCompare(rhs.text) == .orderedAscending
+    }
+}

diff --git a/Tests/Unit/ReportStoreTests.swift b/Tests/Unit/ReportStoreTests.swift

@@ -0,0 +1,142 @@
+import CoreData
+import Foundation
+import Testing
+
+@testable import Reportage
+
+@Suite("ReportStore")
+struct ReportStoreTests {
+
+    private let persistence = makeTestPersistence()
+
+    private var store: ReportStore { ReportStore(persistence: persistence) }
+
+    private func questionCount() async throws -> Int {
+        let context = persistence.newBackgroundContext()
+        return try await context.perform {
+            try context.count(for: QuestionEntity.fetchRequest())
+        }
+    }
+
+    private static func report(
+        _ number: Int, kind: ReportKind = .manual, responses: [Response]
+    ) -> Report {
+        Report(
+            id: Fixtures.reportID(number),
+            date: Date(timeIntervalSince1970: TimeInterval(number) * 3600),
+            timeZone: "Asia/Tokyo",
+            kind: kind,
+            trigger: .app,
+            state: .complete,
+            responses: responses,
+            modifiedAt: Date(timeIntervalSince1970: 0)
+        )
+    }
+
+    private static func token(_ id: String, _ text: String, mergedInto: String? = nil) -> Token {
+        Token(
+            id: id, questionID: "Q", text: text, mergedInto: mergedInto,
+            modifiedAt: Date(timeIntervalSince1970: 0))
+    }
+
+    @Test("Default questions are seeded once, covering every question kind")
+    func seeding() async throws {
+        #expect(try await store.seedDefaultQuestionsIfNeeded())
+        #expect(try await !store.seedDefaultQuestionsIfNeeded())
+
+        let defaults = DefaultQuestions.make(now: Date())
+        #expect(try await questionCount() == defaults.count)
+        #expect(Set(defaults.map(\.kind)) == Set(QuestionKind.allCases))
+        #expect(defaults.map(\.order) == Array(defaults.indices))
+    }
+
+    @Test("Default questions are not seeded into a store that has questions")
+    func noSeedingOverImport() async throws {
+        _ = try await ReporterImporter(persistence: persistence)
+            .importArchive(try Fixtures.reporterExport())
+        let imported = try await questionCount()
+        #expect(try await !store.seedDefaultQuestionsIfNeeded())
+        #expect(try await questionCount() == imported)
+    }
+
+    @Test("A survey asks its own unarchived questions, in order")
+    func surveyQuestions() async throws {
+        try await store.seedDefaultQuestionsIfNeeded()
+        let random = try await store.surveyQuestions(for: .random)
+        let manual = try await store.surveyQuestions(for: .manual)
+        let wake = try await store.surveyQuestions(for: .wake)
+
+        #expect(random == manual)
+        #expect(random.allSatisfy { $0.askOn.contains(.random) })
+        #expect(random.map(\.order) == random.map(\.order).sorted())
+        #expect(wake.map(\.id) == ["reportage-default-sleep-quality"])
+
+        let context = persistence.newBackgroundContext()
+        try await context.perform {
+            let request = QuestionEntity.fetchRequest()
+            request.predicate = NSPredicate(format: "id == %@", "reportage-default-sleep-quality")
+            let entity = try #require(try context.fetch(request).first)
+            var question = try entity.question()
+            question.archivedAt = Date()
+            try entity.update(from: question)
+            try context.save()
+        }
+        #expect(try await store.surveyQuestions(for: .wake).isEmpty)
+    }
+
+    @Test("Suggestions rank by use, then recency, and follow merges")
+    func vocabulary() async throws {
+        let tokens = [
+            Self.token("A", "Alpha"),
+            Self.token("B", "Bravo"),
+            Self.token("C", "Charlie"),
+            Self.token("D", "Delta", mergedInto: "C"),
+            Self.token("E", "Echo"),
+        ]
+        func answer(_ ids: String...) -> Response {
+            Response(questionID: "Q", prompt: "P", value: .tokens(ids))
+        }
+        try await store.insert(Self.report(1, responses: [answer("A", "B")]), newTokens: tokens)
+        try await store.insert(Self.report(2, responses: [answer("A")]))
+        try await store.insert(Self.report(3, responses: [answer("D")]))
+        try await store.insert(Self.report(4, responses: [answer("B", "C")]))
+        try await store.insert(
+            Self.report(5, responses: [Response(questionID: "Q", prompt: "P", value: nil)]))
+
+        let entries = try #require(try await store.vocabulary(for: ["Q"])["Q"])
+        // A and B and C (with D merged in) each have two uses; B and C were
+        // last used in report 4 and C sorts after B by name. Echo is unused.
+        #expect(entries.map(\.id) == ["B", "C", "A", "E"])
+        #expect(entries.map(\.useCount) == [2, 2, 2, 0])
+        #expect(entries[0].lastUsed == Date(timeIntervalSince1970: 4 * 3600))
+    }
+
+    @Test("Place answers count towards their place token")
+    func placeVocabulary() async throws {
+        let home = Token(
+            id: "H", questionID: "L", text: "Home", place: PlaceDetails(),
+            modifiedAt: Date(timeIntervalSince1970: 0))
+        let response = Response(questionID: "L", prompt: "P", value: .place(PlaceAnswer(tokenID: "H")))
+        try await store.insert(Self.report(1, responses: [response]), newTokens: [home])
+        let entries = try await store.vocabulary(for: ["L"])
+        #expect(entries["L"]?.map(\.useCount) == [1])
+    }
+
+    @Test("A report and its new tokens are saved together")
+    func insert() async throws {
+        let token = Self.token("N", "New")
+        let report = Self.report(
+            1, responses: [Response(questionID: "Q", prompt: "P", value: .tokens(["N"]))])
+        try await store.insert(report, newTokens: [token])
+
+        let context = persistence.newBackgroundContext()
+        let (reports, tokens) = try await context.perform {
+            (
+                try context.fetch(ReportEntity.fetchRequest()).map { try $0.report() },
+                try context.fetch(TokenEntity.fetchRequest()).map { try $0.token() }
+            )
+        }
+        #expect(reports == [report])
+        #expect(tokens == [token])
+    }
+}

diff --git a/Tests/Unit/SurveyModelTests.swift b/Tests/Unit/SurveyModelTests.swift

@@ -0,0 +1,217 @@
+import Foundation
+import Testing
+
+@testable import Reportage
+
+@MainActor
+@Suite("SurveyModel")
+struct SurveyModelTests {
+
+    private static func question(_ id: String, _ kind: QuestionKind, order: Int) -> Question {
+        Question(
+            id: id, prompt: "Prompt \(id)", kind: kind, askOn: .random, order: order,
+            modifiedAt: Date(timeIntervalSince1970: 0))
+    }
+
+    private static let questions = [
+        question("yes", .yesNo, order: 0),
+        question("choice", .choice, order: 1),
+        question("tokens", .tokens, order: 2),
+        question("place", .location, order: 3),
+        question("number", .number, order: 4),
+        question("note", .note, order: 5),
+    ]
+
+    private static func entry(_ id: String, _ text: String) -> VocabularyEntry {
+        VocabularyEntry(id: id, text: text, useCount: 1)
+    }
+
+    private func makeModel() -> SurveyModel {
+        SurveyModel(
+            kind: .manual,
+            date: Date(timeIntervalSince1970: 100),
+            timeZone: TimeZone(identifier: "Asia/Tokyo")!,
+            questions: Self.questions,
+            vocabulary: [
+                "tokens": [Self.entry("T1", "Reading"), Self.entry("T2", "Cooking")],
+                "place": [Self.entry("P1", "Home"), Self.entry("P2", "Café")],
+            ]
+        )
+    }
+
+    @Test("Every question gets a response, with no value when skipped")
+    func skippedResponses() {
+        let model = makeModel()
+        let (report, newTokens) = model.makeReport(now: Date(timeIntervalSince1970: 200))
+
+        #expect(report.responses.map(\.questionID) == Self.questions.map(\.id))
+        #expect(report.responses.map(\.prompt) == Self.questions.map(\.prompt))
+        #expect(report.responses.allSatisfy { $0.value == nil })
+        #expect(newTokens.isEmpty)
+        #expect(report.date == Date(timeIntervalSince1970: 100))
+        #expect(report.completedAt == Date(timeIntervalSince1970: 200))
+        #expect(report.timeZone == "Asia/Tokyo")
+        #expect(report.kind == .manual)
+        #expect(report.trigger == .app)
+        #expect(report.state == .complete)
+        #expect(!model.hasAnswers)
+    }
+
+    @Test("Answers of every kind become response values")
+    func answers() throws {
+        let model = makeModel()
+        model[optionFor: "yes"] = ResponseValue.yesOption
+        model[optionFor: "choice"] = "Good"
+        model.pickers["tokens"]?.toggle("T2")
+        model.pickers["tokens"]?.toggle("T1")
+        model.pickers["place"]?.toggle("P1")
+        model.pickers["place"]?.toggle("P2")
+        model[numberFor: "number"] = Decimal(string: "2.5")
+        model[textFor: "note"] = "A note"
+
+        let values = model.makeReport(now: Date()).report.responses.map(\.value)
+        #expect(
+            values == [
+                .options(["Yes"]),
+                .options(["Good"]),
+                .tokens(["T2", "T1"]),
+                .place(PlaceAnswer(tokenID: "P2")),
+                .number(Decimal(string: "2.5")!),
+                .text("A note"),
+            ])
+        #expect(model.hasAnswers)
+    }
+
+    @Test("A note of only whitespace counts as skipped")
+    func blankNote() {
+        let model = makeModel()
+        model[textFor: "note"] = "  \n"
+        #expect(model.makeReport(now: Date()).report.responses.last?.value == nil)
+    }
+
+    @Test("Paging stops at both ends, and a repeated advance is ignored")
+    func paging() {
+        let model = makeModel()
+        model.goBack()
+        #expect(model.index == 0)
+
+        model.advance(from: 0)
+        model.advance(from: 0)
+        #expect(model.index == 1)
+        #expect(model.isMovingForward)
+
+        model.goBack()
+        #expect(model.index == 0)
+        #expect(!model.isMovingForward)
+
+        for _ in Self.questions { model.advance() }
+        #expect(model.index == Self.questions.count - 1)
+        #expect(model.isLastQuestion)
+        #expect(!model.advance())
+    }
+
+    @Test("Clearing the current question removes its answer")
+    func clearCurrent() {
+        let model = makeModel()
+        model[optionFor: "yes"] = ResponseValue.noOption
+        model.clearCurrent()
+        #expect(model[optionFor: "yes"] == nil)
+
+        model.advance()
+        model.advance()
+        model.pickers["tokens"]?.toggle("T1")
+        model.clearCurrent()
+        #expect(model.pickers["tokens"]?.selection == [])
+    }
+
+    @Test("Only new tokens that are still selected are saved")
+    func newTokens() throws {
+        let model = makeModel()
+        let picker = try #require(model.pickers["tokens"])
+        picker.query = "Walking"
+        picker.addQuery()
+        picker.query = "Swimming"
+        picker.addQuery()
+        let swimming = try #require(picker.selection.last)
+        picker.toggle(swimming)
+
+        let newTokens = model.makeReport(now: Date(timeIntervalSince1970: 5)).newTokens
+        #expect(newTokens.map(\.text) == ["Walking"])
+        #expect(newTokens.first?.questionID == "tokens")
+        #expect(newTokens.first?.place == nil)
+        #expect(newTokens.first?.modifiedAt == Date(timeIntervalSince1970: 5))
+    }
+
+    @Test("New place tokens carry place details")
+    func newPlace() throws {
+        let model = makeModel()
+        let picker = try #require(model.pickers["place"])
+        picker.query = "Library"
+        picker.addQuery()
+        let newTokens = model.makeReport(now: Date()).newTokens
+        #expect(newTokens.map(\.text) == ["Library"])
+        #expect(newTokens.first?.place == PlaceDetails())
+    }
+}
+
+@MainActor
+@Suite("TokenPicker")
+struct TokenPickerTests {
+
+    private func makePicker(allowsMultiple: Bool = true) -> TokenPicker {
+        TokenPicker(
+            questionID: "Q",
+            allowsMultiple: allowsMultiple,
+            isPlace: false,
+            entries: [
+                VocabularyEntry(id: "1", text: "Reading", useCount: 3),
+                VocabularyEntry(id: "2", text: "Cooking", useCount: 2),
+                VocabularyEntry(id: "3", text: "Café work", useCount: 1),
+            ]
+        )
+    }
+
+    @Test("Searching filters entries and offers to add unknown text")
+    func search() {
+        let picker = makePicker()
+        #expect(picker.visibleEntries.map(\.id) == ["1", "2", "3"])
+        #expect(!picker.canAddQuery)
+
+        picker.query = "cafe"
+        #expect(picker.visibleEntries.map(\.id) == ["3"])
+        #expect(picker.canAddQuery)
+
+        picker.query = " reading "
+        #expect(picker.visibleEntries.map(\.id) == ["1"])
+        #expect(!picker.canAddQuery)
+    }
+
+    @Test("Adding text that names an entry selects the entry")
+    func addExisting() {
+        let picker = makePicker()
+        picker.query = "COOKING"
+        picker.addQuery()
+        #expect(picker.selection == ["2"])
+        #expect(picker.query.isEmpty)
+        #expect(picker.usedNewTokens(now: Date()).isEmpty)
+    }
+
+    @Test("A new token is listed first and selected")
+    func addNew() {
+        let picker = makePicker()
+        picker.query = "Walking"
+        picker.addQuery()
+        #expect(picker.visibleEntries.first?.text == "Walking")
+        #expect(picker.selectedEntries.map(\.text) == ["Walking"])
+    }
+
+    @Test("Single selection replaces the selected entry")
+    func singleSelection() {
+        let picker = makePicker(allowsMultiple: false)
+        picker.toggle("1")
+        picker.toggle("2")
+        #expect(picker.selection == ["2"])
+        picker.toggle("2")
+        #expect(picker.selection.isEmpty)
+    }
+}