diff --git a/Levain.xcodeproj/project.pbxproj b/Levain.xcodeproj/project.pbxproj index 37520b0..b486ba4 100644 --- a/Levain.xcodeproj/project.pbxproj +++ b/Levain.xcodeproj/project.pbxproj @@ -18,12 +18,12 @@ 0D244B36BB2D2FBD61B00E07 /* Date+Levain.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4FAA5A66043B616FE6D1EEB /* Date+Levain.swift */; }; 117C421943BF09675D867489 /* SystemFormulaLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88067D9DEA0402EE4E48496A /* SystemFormulaLoader.swift */; }; 19909D6C120DD64EDE45A9BA /* SectionCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EF66CC37AE507FB215CFF22 /* SectionCard.swift */; }; - 2A3B4C5D6E7F8A9B0C1D2E3F /* DescriptionBulletList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A2B3C4D5E6F7A8B9C0D1E2F /* DescriptionBulletList.swift */; }; 1B203CD85910F7A753EA7B7E /* knowledge.json in Resources */ = {isa = PBXBuildFile; fileRef = 40446C7081740B9B23D8ADD4 /* knowledge.json */; }; 1BE392C607BBCEC2EAF5137D /* KefirReminderPlannerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083F30497BFDB52B2F385962 /* KefirReminderPlannerTests.swift */; }; 1F99F650F9715E660F28D7D1 /* DomainFixtures.swift in Sources */ = {isa = PBXBuildFile; fileRef = B103892E03A334196B1D10CE /* DomainFixtures.swift */; }; 20066B89AB8228C6E5C18C67 /* BakeReminderPlannerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F702B38C52B89746F9D8DE1 /* BakeReminderPlannerTests.swift */; }; 21CA3CFE43B3EDC7290C5241 /* TodayOperationalCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B78544D1490C8484385BAFBD /* TodayOperationalCardView.swift */; }; + 22E21188FFE699FD262EA83F /* FormInputUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D632E5F50188534077133D11 /* FormInputUITests.swift */; }; 23592D376BA4BB9645E3755F /* KefirBatchPresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66277E1D52967557EA871DEB /* KefirBatchPresentation.swift */; }; 26045D68DC5B6B88BC79FA0D /* BakeStepDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E8199167A33F653C5C7BD8E /* BakeStepDetailView.swift */; }; 263CE789C470376E617AAB9D /* KefirBatchManageSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F4E7C83EE3E491B01BC1D07 /* KefirBatchManageSheet.swift */; }; @@ -43,6 +43,7 @@ 47704AD0CE398C15C49B22E5 /* BakeSchedulerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B39BE3A6D9E872507ECAB51 /* BakeSchedulerTests.swift */; }; 4AA374A3237C2CCB24C3625A /* KnowledgeCategoryPillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67516C2C986793F18606EC30 /* KnowledgeCategoryPillView.swift */; }; 4B0D6B3EC6DE9A8516EE27BF /* RecipeFormulaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03068B3858AD919A409B16D5 /* RecipeFormulaTests.swift */; }; + 4B276E1D6CD1E8CFC6713BF9 /* DescriptionBulletList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94A95C9220E9C36B836BE153 /* DescriptionBulletList.swift */; }; 4E537EEE2ECC83C497858DA4 /* FormulaStepEditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF8C7A1E97DF7299C6E9B7A6 /* FormulaStepEditorView.swift */; }; 4FCFC5305EEE296E84DCF165 /* FlourSelectionEditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05BB2A8E3BCF16B390C67996 /* FlourSelectionEditorView.swift */; }; 5AAE0BB77D877CE7A8802DC2 /* BakesFlowUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E8B96E2C8D2CE83E5D72CD /* BakesFlowUITests.swift */; }; @@ -80,6 +81,7 @@ A72AB65E92A8FBAD29E07734 /* TodayFlowUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DAE057C970FA6A827C1AC37 /* TodayFlowUITests.swift */; }; A9950169D4FF9217C2B29CD8 /* SystemFormula.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82808E94CC2A7217CDAAFE45 /* SystemFormula.swift */; }; AC4C1CBFA44C0269CD84573D /* EmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0CD69CAD160F8964E04E38 /* EmptyStateView.swift */; }; + AE808A5B216892607BA30954 /* FormFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E48F7B735A532DF2AD1DF60 /* FormFields.swift */; }; AFE15E3C2C2B00406C25D6D8 /* ModelContainerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCF69DF1AB4A6F4ADD87ECC4 /* ModelContainerFactory.swift */; }; B03377B35FA0B15E8A905AEF /* KefirEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9BA9E5B4AA49505BDDFD328 /* KefirEvent.swift */; }; B5E9CD6022D24A67C2CD7C74 /* StarterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDA7E52937AA625C6BE4336 /* StarterTests.swift */; }; @@ -110,6 +112,7 @@ DB9B2922D41F33DC0C0834C5 /* KefirJournalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CD2B15E96D25693E9554923 /* KefirJournalView.swift */; }; DCCEBF31D5C991DFA2894BA6 /* AppSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAB2C1827C62E47C070528C /* AppSettings.swift */; }; DDB4A3789C278F00C5E04131 /* KefirBatchComparisonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D112680B5E99DF09CDE5947 /* KefirBatchComparisonView.swift */; }; + DF4006B33356546C819C1190 /* logo-squircle.svg in Resources */ = {isa = PBXBuildFile; fileRef = BF852AB20022BDE733C1532C /* logo-squircle.svg */; }; E1B4B8B57517B854F49572E0 /* BackupService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E01C62CC5536C52C2331B21 /* BackupService.swift */; }; E51AA3D045B8F6386DBEE0FE /* StarterReminderPlannerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 529741780FA026FA8C458250 /* StarterReminderPlannerTests.swift */; }; E60D19B33CA5F87D9D711D49 /* FormulaStepTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240767BF4294389BF07F152B /* FormulaStepTemplate.swift */; }; @@ -153,13 +156,12 @@ 019C5DED2589ED39E611C1A1 /* KnowledgeLoaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeLoaderTests.swift; sourceTree = ""; }; 03068B3858AD919A409B16D5 /* RecipeFormulaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecipeFormulaTests.swift; sourceTree = ""; }; 031DE41E33A5A47BB92E1B84 /* LevainApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LevainApp.swift; sourceTree = ""; }; - 03C325E845719C6FC294C6FE /* logo-01.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "logo-01.svg"; sourceTree = ""; }; + 03C325E845719C6FC294C6FE /* logo-01.svg */ = {isa = PBXFileReference; path = "logo-01.svg"; sourceTree = ""; }; 0488D5D97917ED1EDCE7A49E /* KnowledgeRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeRowView.swift; sourceTree = ""; }; 05BB2A8E3BCF16B390C67996 /* FlourSelectionEditorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlourSelectionEditorView.swift; sourceTree = ""; }; - 0829A06D388058C26EB78A33 /* starter.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = starter.svg; sourceTree = ""; }; + 0829A06D388058C26EB78A33 /* starter.svg */ = {isa = PBXFileReference; path = starter.svg; sourceTree = ""; }; 083F30497BFDB52B2F385962 /* KefirReminderPlannerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirReminderPlannerTests.swift; sourceTree = ""; }; 0EF66CC37AE507FB215CFF22 /* SectionCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionCard.swift; sourceTree = ""; }; - 1A2B3C4D5E6F7A8B9C0D1E2F /* DescriptionBulletList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DescriptionBulletList.swift; sourceTree = ""; }; 0F4E7C83EE3E491B01BC1D07 /* KefirBatchManageSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirBatchManageSheet.swift; sourceTree = ""; }; 0F73F2107220BBBBD20F36DA /* TodayStarterReminderRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayStarterReminderRow.swift; sourceTree = ""; }; 0FF36CA3FB5AF886EBFB28C7 /* KefirFlowUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirFlowUITests.swift; sourceTree = ""; }; @@ -174,7 +176,8 @@ 25425933BA83B4B7162BE06A /* KefirBatchCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirBatchCardView.swift; sourceTree = ""; }; 2974CC1E6E482DB4EAF2E6FE /* SystemFormulaLoaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemFormulaLoaderTests.swift; sourceTree = ""; }; 2AC91F1BE2D66E6CA2B2D162 /* RefreshHistoryRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshHistoryRow.swift; sourceTree = ""; }; - 2EFA2DE8D87323F11D4B16F3 /* LevainTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LevainTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 2E48F7B735A532DF2AD1DF60 /* FormFields.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormFields.swift; sourceTree = ""; }; + 2EFA2DE8D87323F11D4B16F3 /* LevainTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = LevainTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 2F702B38C52B89746F9D8DE1 /* BakeReminderPlannerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeReminderPlannerTests.swift; sourceTree = ""; }; 2F8DFC3E0B70BF05BE48DA6B /* BakeReminderPlanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeReminderPlanner.swift; sourceTree = ""; }; 2F987C31F0C39CE7F5933AE5 /* KefirEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirEventTests.swift; sourceTree = ""; }; @@ -206,7 +209,7 @@ 623F69F7E6BA861E103B1791 /* YeastConversionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YeastConversionService.swift; sourceTree = ""; }; 624AD82924BEAD344125588C /* KnowledgeDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeDetailView.swift; sourceTree = ""; }; 638576BACCFFCBDAB792082C /* KefirBatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirBatch.swift; sourceTree = ""; }; - 65564B7A1CCBBD895F8BE550 /* LevainUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LevainUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 65564B7A1CCBBD895F8BE550 /* LevainUITests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = LevainUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 66277E1D52967557EA871DEB /* KefirBatchPresentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirBatchPresentation.swift; sourceTree = ""; }; 67516C2C986793F18606EC30 /* KnowledgeCategoryPillView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeCategoryPillView.swift; sourceTree = ""; }; 6983B1F948DFA6BE209403E8 /* SeedDataLoaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedDataLoaderTests.swift; sourceTree = ""; }; @@ -217,19 +220,20 @@ 762C7FC5CFEB6829E4E7BEC1 /* FermentationsFlowUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FermentationsFlowUITests.swift; sourceTree = ""; }; 7762E15F65697D717FBB038F /* StateBadgeToneTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateBadgeToneTests.swift; sourceTree = ""; }; 79D4C487A002E34766EBC3F2 /* AppEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppEnvironment.swift; sourceTree = ""; }; - 7A93F72E454DE1667B080E9C /* bake.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = bake.svg; sourceTree = ""; }; + 7A93F72E454DE1667B080E9C /* bake.svg */ = {isa = PBXFileReference; path = bake.svg; sourceTree = ""; }; 7BD7C03D5139BD3131B782AE /* AppRouterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppRouterTests.swift; sourceTree = ""; }; 7D19BA59B3A928A04BD8843E /* FermentationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FermentationsView.swift; sourceTree = ""; }; 82808E94CC2A7217CDAAFE45 /* SystemFormula.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemFormula.swift; sourceTree = ""; }; 88067D9DEA0402EE4E48496A /* SystemFormulaLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemFormulaLoader.swift; sourceTree = ""; }; - 89BAF4761DDB1090512623FB /* logo.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = logo.svg; sourceTree = ""; }; + 89BAF4761DDB1090512623FB /* logo.svg */ = {isa = PBXFileReference; path = logo.svg; sourceTree = ""; }; 8B39BE3A6D9E872507ECAB51 /* BakeSchedulerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeSchedulerTests.swift; sourceTree = ""; }; 8CBB82511329EC43AD7BC640 /* StarterDetailHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StarterDetailHeaderView.swift; sourceTree = ""; }; 8E9AA4021F43AE9655D8F68C /* StateBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateBadge.swift; sourceTree = ""; }; 9069286C22B79776F290E460 /* KnowledgeLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeLoader.swift; sourceTree = ""; }; + 94A95C9220E9C36B836BE153 /* DescriptionBulletList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DescriptionBulletList.swift; sourceTree = ""; }; 9527884010C3C4CC2BA7DF2D /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 9A9E648F721B49CD581E8B10 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; - 9B4004713422E6E47C0B76CD /* Levain.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Levain.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9B4004713422E6E47C0B76CD /* Levain.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Levain.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9FC08F220B40EB7C51A3AB1B /* KefirBatchListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirBatchListView.swift; sourceTree = ""; }; A061F753EFB622786D154A83 /* KnowledgeItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnowledgeItem.swift; sourceTree = ""; }; A327533FEB9FDE64DDA58C58 /* AppLaunchOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLaunchOptions.swift; sourceTree = ""; }; @@ -249,12 +253,14 @@ B78544D1490C8484385BAFBD /* TodayOperationalCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayOperationalCardView.swift; sourceTree = ""; }; BC0451D6E4DCF1F8EF2C78E7 /* BakeIngredientsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeIngredientsView.swift; sourceTree = ""; }; BCF69DF1AB4A6F4ADD87ECC4 /* ModelContainerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelContainerFactory.swift; sourceTree = ""; }; + BF852AB20022BDE733C1532C /* logo-squircle.svg */ = {isa = PBXFileReference; path = "logo-squircle.svg"; sourceTree = ""; }; C25872A58F8373FE1A2CF530 /* ToastBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastBannerView.swift; sourceTree = ""; }; C3719CAB830F30160F021B55 /* BakeScheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeScheduler.swift; sourceTree = ""; }; CDA0457086F14FDAC1DC627A /* ShiftTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShiftTimelineView.swift; sourceTree = ""; }; CEAB2C1827C62E47C070528C /* AppSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSettings.swift; sourceTree = ""; }; CF8C7A1E97DF7299C6E9B7A6 /* FormulaStepEditorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormulaStepEditorView.swift; sourceTree = ""; }; CFF203DD5A6EA2502E937535 /* NotificationRouteUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationRouteUITests.swift; sourceTree = ""; }; + D632E5F50188534077133D11 /* FormInputUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormInputUITests.swift; sourceTree = ""; }; D7C76E6286DA83E2BCAB2DA6 /* KefirEventRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KefirEventRecorder.swift; sourceTree = ""; }; D88945036E9817121C4963FC /* system_formulas.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = system_formulas.json; sourceTree = ""; }; D9ECE5A0429356DA9B30ED63 /* SeedDataLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedDataLoader.swift; sourceTree = ""; }; @@ -281,6 +287,7 @@ children = ( 7A93F72E454DE1667B080E9C /* bake.svg */, 03C325E845719C6FC294C6FE /* logo-01.svg */, + BF852AB20022BDE733C1532C /* logo-squircle.svg */, 9A9E648F721B49CD581E8B10 /* logo.png */, 89BAF4761DDB1090512623FB /* logo.svg */, 0829A06D388058C26EB78A33 /* starter.svg */, @@ -428,9 +435,10 @@ 632408C7CA7F874D37AE66CB /* Components */ = { isa = PBXGroup; children = ( + 94A95C9220E9C36B836BE153 /* DescriptionBulletList.swift */, 4D09C0219515B0C58E80A791 /* DesignPrimitives.swift */, - 1A2B3C4D5E6F7A8B9C0D1E2F /* DescriptionBulletList.swift */, DB0CD69CAD160F8964E04E38 /* EmptyStateView.swift */, + 2E48F7B735A532DF2AD1DF60 /* FormFields.swift */, 0EF66CC37AE507FB215CFF22 /* SectionCard.swift */, 8E9AA4021F43AE9655D8F68C /* StateBadge.swift */, ); @@ -573,6 +581,7 @@ children = ( 74E8B96E2C8D2CE83E5D72CD /* BakesFlowUITests.swift */, 762C7FC5CFEB6829E4E7BEC1 /* FermentationsFlowUITests.swift */, + D632E5F50188534077133D11 /* FormInputUITests.swift */, 0FF36CA3FB5AF886EBFB28C7 /* KefirFlowUITests.swift */, F2C6374ED12D33A5878CF5F3 /* KnowledgeFlowUITests.swift */, 61243C17854EB5B5F0148C16 /* LevainUITests.swift */, @@ -658,13 +667,14 @@ LastUpgradeCheck = 2640; TargetAttributes = { 00849C44FA575554ED75F76A = { - DevelopmentTeam = ""; + DevelopmentTeam = C974BPN56D; }; 3B49ED6DA58469A7F9B8E54F = { - DevelopmentTeam = ""; + DevelopmentTeam = C974BPN56D; TestTargetID = 8E84F0B210E0A11CDE4A5962; }; 8E84F0B210E0A11CDE4A5962 = { + DevelopmentTeam = C974BPN56D; ProvisioningStyle = Automatic; }; }; @@ -699,6 +709,7 @@ 0AD978B4F088E30BC5FA053D /* bake.svg in Resources */, 1B203CD85910F7A753EA7B7E /* knowledge.json in Resources */, E830FEAADF68120783747C70 /* logo-01.svg in Resources */, + DF4006B33356546C819C1190 /* logo-squircle.svg in Resources */, B77F7DCD7B30591E5A2CDC66 /* logo.png in Resources */, 7F84475AA184AE8C7AE6A84D /* logo.svg in Resources */, F61E1B0737AD9DD1C7957726 /* starter.svg in Resources */, @@ -715,6 +726,7 @@ files = ( 5AAE0BB77D877CE7A8802DC2 /* BakesFlowUITests.swift in Sources */, F3F3B920908C803B4A114684 /* FermentationsFlowUITests.swift in Sources */, + 22E21188FFE699FD262EA83F /* FormInputUITests.swift in Sources */, CE0386037363277B0ADAEC91 /* KefirFlowUITests.swift in Sources */, F4F46A97B9F0EE28E5B4E275 /* KnowledgeFlowUITests.swift in Sources */, 8F7B429D77A05781C4E826F9 /* LevainUITests.swift in Sources */, @@ -773,12 +785,13 @@ 2C9CAFB2E374A422B8C0300F /* BreadHubView.swift in Sources */, 0D244B36BB2D2FBD61B00E07 /* Date+Levain.swift in Sources */, 6F7C689E9224FA177FE49E9D /* DateFormattingService.swift in Sources */, - 2A3B4C5D6E7F8A9B0C1D2E3F /* DescriptionBulletList.swift in Sources */, + 4B276E1D6CD1E8CFC6713BF9 /* DescriptionBulletList.swift in Sources */, 7D3DA6A05B6CB6132F859BC1 /* DesignPrimitives.swift in Sources */, 6FB2EAAC65EC1C0350BDCFCB /* DomainEnums.swift in Sources */, AC4C1CBFA44C0269CD84573D /* EmptyStateView.swift in Sources */, FCCC7A6B486A9359BDAE7F6D /* FermentationsView.swift in Sources */, 4FCFC5305EEE296E84DCF165 /* FlourSelectionEditorView.swift in Sources */, + AE808A5B216892607BA30954 /* FormFields.swift in Sources */, D7BBC6CAA904668226675EA3 /* FormulaDetailView.swift in Sources */, A44ED48046434A743314F4CB /* FormulaEditorView.swift in Sources */, FFA273A8F2496E91BA328B92 /* FormulaListView.swift in Sources */, @@ -942,7 +955,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = C974BPN56D; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -1046,7 +1059,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = C974BPN56D; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -1095,7 +1108,6 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = C974BPN56D; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Levain/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Batch; diff --git a/Levain.xcodeproj/xcshareddata/xcschemes/Levain.xcscheme b/Levain.xcodeproj/xcshareddata/xcschemes/Levain.xcscheme index 48871f2..09f531a 100644 --- a/Levain.xcodeproj/xcshareddata/xcschemes/Levain.xcscheme +++ b/Levain.xcodeproj/xcshareddata/xcschemes/Levain.xcscheme @@ -1,10 +1,12 @@ + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic" + runPostActionsOnFailure = "NO"> + shouldUseLaunchSchemeArgsEnv = "YES" + onlyGenerateCoverageForSpecifiedTargets = "NO"> + + + + + + diff --git a/Levain/App/AppLaunchOptions.swift b/Levain/App/AppLaunchOptions.swift index 95467e6..fdfe1ab 100644 --- a/Levain/App/AppLaunchOptions.swift +++ b/Levain/App/AppLaunchOptions.swift @@ -33,6 +33,10 @@ enum AppLaunchOptions { /// When present, simulates a cold launch opened from a notification route. static let keyPendingNotificationRoute = "LEVAIN_PENDING_NOTIFICATION_ROUTE" + /// `"1"` → start without the animated splash so automation can interact + /// with the UI immediately. + static let keySkipSplash = "LEVAIN_SKIP_SPLASH" + // MARK: - Resolved Values /// Whether the current process was launched with an isolated in-memory store. @@ -61,4 +65,8 @@ enum AppLaunchOptions { static var pendingNotificationRoute: String? { ProcessInfo.processInfo.environment[keyPendingNotificationRoute] } + + static var shouldSkipSplash: Bool { + ProcessInfo.processInfo.environment[keySkipSplash] == "1" + } } diff --git a/Levain/App/LevainApp.swift b/Levain/App/LevainApp.swift index 0c02558..161e9d4 100644 --- a/Levain/App/LevainApp.swift +++ b/Levain/App/LevainApp.swift @@ -8,7 +8,7 @@ struct LevainApp: App { @StateObject private var router = AppRouter() @StateObject private var environment = AppEnvironment() - @State private var showSplash = true + @State private var showSplash = !AppLaunchOptions.shouldSkipSplash let container: ModelContainer @@ -36,6 +36,10 @@ struct LevainApp: App { } } .task { + guard showSplash else { + environment.markLaunchTransitionComplete() + return + } try? await Task.sleep(for: .seconds(1.9)) withAnimation(.easeIn(duration: 0.55)) { showSplash = false @@ -128,7 +132,9 @@ private struct SplashView: View { private struct SplashLogoAnimationView: View { let reduceMotion: Bool - @State private var player = SplashLogoAnimationAsset.makePlayer() + // Created once in onAppear: a default-value expression here would run on every + // re-init of this view (the splash re-renders while it animates). + @State private var player: AVPlayer? var body: some View { ZStack { @@ -145,6 +151,9 @@ private struct SplashLogoAnimationView: View { } .accessibilityHidden(true) .onAppear { + if player == nil { + player = SplashLogoAnimationAsset.makePlayer() + } guard reduceMotion == false else { return } player?.seek(to: .zero) player?.play() @@ -209,7 +218,10 @@ private final class PlayerContainerView: UIView { } private enum SplashLogoAnimationAsset { - static func makePlayer() -> AVPlayer? { + /// Copies the bundled video to a temporary file once per install and reuses it, + /// so the file is never rewritten while a player is reading it. + @MainActor + private static let fileURL: URL? = { guard let dataAsset = NSDataAsset(name: "BatchLogoLoading") else { return nil } @@ -218,13 +230,23 @@ private enum SplashLogoAnimationAsset { .appendingPathComponent("batch-logo-loading") .appendingPathExtension("mov") + let existingSize = (try? FileManager.default.attributesOfItem(atPath: url.path))?[.size] as? Int + if existingSize == dataAsset.data.count { + return url + } + do { try dataAsset.data.write(to: url, options: [.atomic]) + return url } catch { return nil } + }() - let player = AVPlayer(url: url) + @MainActor + static func makePlayer() -> AVPlayer? { + guard let fileURL else { return nil } + let player = AVPlayer(url: fileURL) player.isMuted = true player.actionAtItemEnd = .pause return player diff --git a/Levain/DesignSystem/Components/FormFields.swift b/Levain/DesignSystem/Components/FormFields.swift new file mode 100644 index 0000000..b21bda0 --- /dev/null +++ b/Levain/DesignSystem/Components/FormFields.swift @@ -0,0 +1,111 @@ +import SwiftUI +import UIKit + +/// Labeled text row for forms. The whole row is tappable and moves focus to +/// the field, so the user does not have to aim at the trailing text area. +struct FormTextRow: View { + let title: String + let placeholder: String + @Binding var text: String + var autofocus: Bool = false + var capitalization: TextInputAutocapitalization = .sentences + var keyboard: UIKeyboardType = .default + var fieldAccessibilityIdentifier: String? + + @FocusState private var isFocused: Bool + + var body: some View { + LabeledContent(title) { + field + } + .contentShape(Rectangle()) + .onTapGesture { isFocused = true } + .task { + guard autofocus else { return } + // Wait for the sheet presentation to settle before raising the keyboard. + try? await Task.sleep(for: .milliseconds(450)) + isFocused = true + } + } + + @ViewBuilder + private var field: some View { + let base = TextField(placeholder, text: $text) + .multilineTextAlignment(.trailing) + .keyboardType(keyboard) + .textInputAutocapitalization(capitalization) + .submitLabel(.done) + .focused($isFocused) + + if let fieldAccessibilityIdentifier { + base.accessibilityIdentifier(fieldAccessibilityIdentifier) + } else { + base + } + } +} + +/// Labeled numeric row for forms: decimal keypad, whole-row tap target and +/// the current value selected on focus so typing replaces it. +struct NumericField: View { + let title: String + @Binding var value: Double + + @FocusState private var isFocused: Bool + + var body: some View { + LabeledContent(title) { + TextField("0", value: $value, format: .number) + .keyboardType(.decimalPad) + .multilineTextAlignment(.trailing) + .focused($isFocused) + .onReceive(NotificationCenter.default.publisher(for: UITextField.textDidBeginEditingNotification)) { notification in + guard isFocused, let field = notification.object as? UITextField else { return } + Task { @MainActor in + field.selectAll(nil) + } + } + } + .contentShape(Rectangle()) + .onTapGesture { isFocused = true } + } +} + +extension View { + /// Adds a "Fine" button above the keyboard (decimal pads have no return key) + /// and lets the user dismiss the keyboard by scrolling the form. + func formKeyboardToolbar() -> some View { + scrollDismissesKeyboard(.interactively) + .toolbar { + ToolbarItemGroup(placement: .keyboard) { + Spacer() + Button("Fine") { + UIApplication.shared.sendAction( + #selector(UIResponder.resignFirstResponder), + to: nil, + from: nil, + for: nil + ) + } + .fontWeight(.semibold) + } + } + } + + /// Makes the full row (including the empty space created by `Spacer`) + /// respond to taps in plain-styled buttons. + func formRowHitArea() -> some View { + frame(maxWidth: .infinity, alignment: .leading) + .contentShape(Rectangle()) + } +} + +/// Plain button style whose whole label frame is tappable, including the empty +/// space created by `Spacer`. Use it for full-width rows instead of `.plain`. +struct FullRowPlainButtonStyle: ButtonStyle { + func makeBody(configuration: Configuration) -> some View { + configuration.label + .contentShape(Rectangle()) + .opacity(configuration.isPressed ? 0.55 : 1) + } +} diff --git a/Levain/Features/Bakes/BakeCreationView.swift b/Levain/Features/Bakes/BakeCreationView.swift index 8f0f335..e3e5c60 100644 --- a/Levain/Features/Bakes/BakeCreationView.swift +++ b/Levain/Features/Bakes/BakeCreationView.swift @@ -112,6 +112,7 @@ struct BakeCreationView: View { .lineLimit(3...5) } } + .formKeyboardToolbar() .navigationTitle("Nuovo impasto") .tint(Theme.Control.primaryFill) .toolbar { diff --git a/Levain/Features/Bakes/BakesView.swift b/Levain/Features/Bakes/BakesView.swift index 444c1da..1c8f394 100644 --- a/Levain/Features/Bakes/BakesView.swift +++ b/Levain/Features/Bakes/BakesView.swift @@ -190,7 +190,7 @@ struct BakesView: View { .foregroundStyle(Theme.muted) } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) } .listRowSeparator(.hidden) .listRowBackground(Color.clear) @@ -471,19 +471,6 @@ struct FormulaStatRow: View { } } -struct NumericField: View { - let title: String - @Binding var value: Double - - var body: some View { - LabeledContent(title) { - TextField("", value: $value, format: .number) - .keyboardType(.decimalPad) - .multilineTextAlignment(.trailing) - } - } -} - #Preview("Bakes") { NavigationStack { BakesView() diff --git a/Levain/Features/Bakes/FormulaEditorView.swift b/Levain/Features/Bakes/FormulaEditorView.swift index 4d4a5e1..ec0389e 100644 --- a/Levain/Features/Bakes/FormulaEditorView.swift +++ b/Levain/Features/Bakes/FormulaEditorView.swift @@ -50,10 +50,13 @@ struct FormulaEditorView: View { var body: some View { Form { Section("Identità") { - LabeledContent("Nome della ricetta") { - TextField("es. Pane di Segale", text: $name) - .multilineTextAlignment(.trailing) - } + FormTextRow( + title: "Nome della ricetta", + placeholder: "es. Pane di Segale", + text: $name, + autofocus: formula == nil, + capitalization: .words + ) Picker("Tipo", selection: $type) { ForEach(RecipeCategory.allCases) { option in Text(option.title).tag(option) @@ -150,6 +153,7 @@ struct FormulaEditorView: View { Image(systemName: "chevron.right") .foregroundStyle(Theme.muted) } + .formRowHitArea() } .buttonStyle(.plain) } @@ -177,6 +181,7 @@ struct FormulaEditorView: View { Text("Note") } } + .formKeyboardToolbar() .navigationTitle(formula == nil ? "Nuova ricetta" : "Modifica ricetta") .tint(Theme.Control.primaryFill) .toolbar { diff --git a/Levain/Features/Bakes/FormulaListView.swift b/Levain/Features/Bakes/FormulaListView.swift index edb8ea3..b8e258c 100644 --- a/Levain/Features/Bakes/FormulaListView.swift +++ b/Levain/Features/Bakes/FormulaListView.swift @@ -131,7 +131,7 @@ struct FormulaListView: View { .foregroundStyle(Theme.muted) } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) .listRowSeparator(.hidden) .listRowBackground(Color.clear) .listRowInsets(.levainListRow(top: Theme.Spacing.xs, bottom: Theme.Spacing.xs)) diff --git a/Levain/Features/Bakes/FormulaStepEditorView.swift b/Levain/Features/Bakes/FormulaStepEditorView.swift index 2bbc162..247e79a 100644 --- a/Levain/Features/Bakes/FormulaStepEditorView.swift +++ b/Levain/Features/Bakes/FormulaStepEditorView.swift @@ -38,10 +38,11 @@ struct FormulaStepEditorView: View { Text(option.title).tag(option) } } - LabeledContent("Nome della fase") { - TextField("es. Autolisi", text: $name) - .multilineTextAlignment(.trailing) - } + FormTextRow( + title: "Nome della fase", + placeholder: "es. Autolisi", + text: $name + ) VStack(alignment: .leading, spacing: 6) { Text("Dettagli") .font(.subheadline) @@ -65,6 +66,7 @@ struct FormulaStepEditorView: View { Text(DateFormattingService.duration(minutes: durationMinutes)) .foregroundStyle(Theme.muted) } + .formRowHitArea() } .buttonStyle(.plain) @@ -77,19 +79,24 @@ struct FormulaStepEditorView: View { Text(reminderOffsetMinutes == 0 ? "Nessun promemoria" : "\(reminderOffsetMinutes) min prima") .foregroundStyle(Theme.muted) } + .formRowHitArea() } .buttonStyle(.plain) } Section("Target qualitativi") { - LabeledContent("Temperatura") { - TextField("es. 24-26°C", text: $temperatureRange) - .multilineTextAlignment(.trailing) - } - LabeledContent("Target volume") { - TextField("es. Raddoppio", text: $volumeTarget) - .multilineTextAlignment(.trailing) - } + FormTextRow( + title: "Temperatura", + placeholder: "es. 24-26°C", + text: $temperatureRange, + capitalization: .never, + keyboard: .numbersAndPunctuation + ) + FormTextRow( + title: "Target volume", + placeholder: "es. Raddoppio", + text: $volumeTarget + ) VStack(alignment: .leading, spacing: 6) { Text("Note") .font(.subheadline) @@ -103,6 +110,7 @@ struct FormulaStepEditorView: View { .listRowInsets(EdgeInsets(top: 10, leading: 16, bottom: 10, trailing: 16)) } } + .formKeyboardToolbar() .navigationTitle(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? "Fase" : name) .scrollContentBackground(.hidden) .background(Theme.Surface.app) diff --git a/Levain/Features/BreadHub/BreadHubView.swift b/Levain/Features/BreadHub/BreadHubView.swift index 8c6b81c..f1e112f 100644 --- a/Levain/Features/BreadHub/BreadHubView.swift +++ b/Levain/Features/BreadHub/BreadHubView.swift @@ -155,6 +155,7 @@ struct BreadHubView: View { ) { showingBakeEditor = true } + .accessibilityElement(children: .contain) .accessibilityIdentifier("BreadHubBakesEmptyState") } } @@ -201,7 +202,7 @@ struct BreadHubView: View { } } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) .accessibilityIdentifier("BreadHubBakeCard_\(row.bake.id)") .listRowInsets(.levainListRow(bottom: Theme.Spacing.xs)) .listRowBackground(Color.clear) @@ -230,6 +231,7 @@ struct BreadHubView: View { editingStarter = nil showingStarterEditor = true } + .accessibilityElement(children: .contain) .accessibilityIdentifier("BreadHubStartersEmptyState") } } @@ -290,7 +292,7 @@ struct BreadHubView: View { } } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) .accessibilityIdentifier("BreadHubFormuleRow") } .listRowInsets(.levainListRow(bottom: Theme.Spacing.md)) diff --git a/Levain/Features/Kefir/KefirArchiveView.swift b/Levain/Features/Kefir/KefirArchiveView.swift index a07c7c1..99687ef 100644 --- a/Levain/Features/Kefir/KefirArchiveView.swift +++ b/Levain/Features/Kefir/KefirArchiveView.swift @@ -29,6 +29,7 @@ struct KefirArchiveView: View { } .padding(.horizontal, 20) .padding(.vertical, 24) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirArchiveView") } .accessibilityIdentifier("KefirArchiveScrollView") @@ -58,6 +59,7 @@ struct KefirArchiveView: View { StateBadge(text: "\(archivedCount) archiviati", tone: .count) } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirArchiveHeaderCard") } @@ -72,6 +74,7 @@ struct KefirArchiveView: View { .foregroundStyle(Theme.muted) } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirArchiveEmptyCard") } @@ -129,6 +132,7 @@ struct KefirArchiveView: View { .accessibilityIdentifier("KefirArchiveDeriveButton-\(batch.accessibilityStem)") } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirArchiveBatchCard-\(batch.accessibilityStem)") } } diff --git a/Levain/Features/Kefir/KefirBatchCardView.swift b/Levain/Features/Kefir/KefirBatchCardView.swift index 8d617d1..b97222b 100644 --- a/Levain/Features/Kefir/KefirBatchCardView.swift +++ b/Levain/Features/Kefir/KefirBatchCardView.swift @@ -11,6 +11,7 @@ struct KefirBatchCardView: View { var body: some View { sectionCard + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirBatchCard-\(batch.accessibilityStem)") } diff --git a/Levain/Features/Kefir/KefirBatchComparisonView.swift b/Levain/Features/Kefir/KefirBatchComparisonView.swift index 12bb119..ae0a81c 100644 --- a/Levain/Features/Kefir/KefirBatchComparisonView.swift +++ b/Levain/Features/Kefir/KefirBatchComparisonView.swift @@ -30,6 +30,7 @@ struct KefirBatchComparisonView: View { } .padding(.horizontal, 20) .padding(.vertical, 24) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirBatchComparisonView") } .background(Theme.background.ignoresSafeArea()) @@ -55,6 +56,7 @@ struct KefirBatchComparisonView: View { } } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirComparisonHeaderCard") } @@ -84,6 +86,7 @@ struct KefirBatchComparisonView: View { accessibilityIdentifier: "KefirComparisonSourceCard" ) } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirComparisonSourceSection") } @@ -105,6 +108,7 @@ struct KefirBatchComparisonView: View { ) } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirComparisonDerivedSection") } diff --git a/Levain/Features/Kefir/KefirBatchDetailView.swift b/Levain/Features/Kefir/KefirBatchDetailView.swift index 22ee674..e129d38 100644 --- a/Levain/Features/Kefir/KefirBatchDetailView.swift +++ b/Levain/Features/Kefir/KefirBatchDetailView.swift @@ -36,6 +36,7 @@ struct KefirBatchDetailView: View { } .padding(.horizontal, 20) .padding(.vertical, 24) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirBatchDetailView") } .contentMargins(.bottom, 88, for: .scrollContent) @@ -155,6 +156,7 @@ struct KefirBatchDetailView: View { .accessibilityIdentifier("KefirDetailOpenJournalButton") } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirBatchRecentHistoryCard") } @@ -173,6 +175,7 @@ struct KefirBatchDetailView: View { secondaryQuickActions } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirBatchActionsCard") } diff --git a/Levain/Features/Kefir/KefirBatchEditorView.swift b/Levain/Features/Kefir/KefirBatchEditorView.swift index 45b3131..8b6bd0f 100644 --- a/Levain/Features/Kefir/KefirBatchEditorView.swift +++ b/Levain/Features/Kefir/KefirBatchEditorView.swift @@ -84,6 +84,7 @@ struct KefirBatchEditorView: View { contextSection notesSection } + .formKeyboardToolbar() .navigationTitle(mode.title) .tint(Theme.Control.primaryFill) .scrollContentBackground(.hidden) @@ -109,14 +110,16 @@ struct KefirBatchEditorView: View { private var identitySection: some View { Section("Identità") { - LabeledContent("Nome batch") { - TextField("es. Batch cucina", text: $name) - .multilineTextAlignment(.trailing) - .autocorrectionDisabled() - .textInputAutocapitalization(.words) - .textContentType(.none) - .accessibilityIdentifier("KefirBatchNameField") - } + FormTextRow( + title: "Nome batch", + placeholder: "es. Batch cucina", + text: $name, + autofocus: isCreating, + capitalization: .words, + fieldAccessibilityIdentifier: "KefirBatchNameField" + ) + .autocorrectionDisabled() + .textContentType(.none) Picker("Conservazione", selection: $storageMode) { ForEach(KefirStorageMode.allCases) { option in @@ -177,6 +180,11 @@ struct KefirBatchEditorView: View { } } + private var isCreating: Bool { + if case .create = mode { return true } + return false + } + private var trimmedName: String { name.trimmingCharacters(in: .whitespacesAndNewlines) } diff --git a/Levain/Features/Kefir/KefirBatchListView.swift b/Levain/Features/Kefir/KefirBatchListView.swift index d9f7111..3b7c506 100644 --- a/Levain/Features/Kefir/KefirBatchListView.swift +++ b/Levain/Features/Kefir/KefirBatchListView.swift @@ -82,7 +82,7 @@ struct KefirBatchListView: View { .foregroundStyle(Theme.Text.secondary) } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) .accessibilityIdentifier("KefirArchiveSectionHeader") } } diff --git a/Levain/Features/Kefir/KefirHubView.swift b/Levain/Features/Kefir/KefirHubView.swift index b1dac22..f647a40 100644 --- a/Levain/Features/Kefir/KefirHubView.swift +++ b/Levain/Features/Kefir/KefirHubView.swift @@ -93,6 +93,7 @@ struct KefirHubView: View { .listRowInsets(.levainListRow(top: Theme.Spacing.sm, bottom: Theme.Spacing.xs)) .listRowBackground(Color.clear) .listRowSeparator(.hidden) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirHubSummaryCard") } diff --git a/Levain/Features/Kefir/KefirJournalView.swift b/Levain/Features/Kefir/KefirJournalView.swift index 9c3e42c..b11eb98 100644 --- a/Levain/Features/Kefir/KefirJournalView.swift +++ b/Levain/Features/Kefir/KefirJournalView.swift @@ -45,6 +45,7 @@ struct KefirJournalView: View { } .padding(.horizontal, 20) .padding(.vertical, 24) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirJournalView") } .accessibilityIdentifier("KefirJournalScrollView") @@ -64,11 +65,13 @@ struct KefirJournalView: View { RoundedRectangle(cornerRadius: Theme.Radius.card, style: .continuous) .stroke(Theme.Border.danger, lineWidth: focusBatch.derivedState == .overdue ? 1.5 : 0) ) + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirJournalHeaderCard") } else { SectionCard(emphasis: .tinted) { headerBody(renderState: renderState) } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirJournalHeaderCard") } } @@ -106,6 +109,7 @@ struct KefirJournalView: View { .accessibilityIdentifier("KefirJournalOpenArchiveButton") } } + .accessibilityElement(children: .contain) .accessibilityIdentifier("KefirJournalArchiveSection") } diff --git a/Levain/Features/Shared/FlourSelectionEditorView.swift b/Levain/Features/Shared/FlourSelectionEditorView.swift index cf6a712..a82a886 100644 --- a/Levain/Features/Shared/FlourSelectionEditorView.swift +++ b/Levain/Features/Shared/FlourSelectionEditorView.swift @@ -25,12 +25,18 @@ struct FlourSelectionEditorView: View { .foregroundStyle(Theme.Control.primaryFill) } } + .formRowHitArea() } .buttonStyle(.plain) } if flour.category == .custom { - TextField("Nome personalizzato", text: $flour.customName) + FormTextRow( + title: "Nome", + placeholder: "Nome personalizzato", + text: $flour.customName, + autofocus: flour.customName.isEmpty + ) } } @@ -39,7 +45,7 @@ struct FlourSelectionEditorView: View { showingPercentagePicker = true } label: { SelectionFormRow( - title: "Percentuale sul totale flour", + title: "Percentuale sul totale farine", value: "\(Int(flour.percentage.rounded()))%" ) } @@ -48,6 +54,7 @@ struct FlourSelectionEditorView: View { } .scrollContentBackground(.hidden) .background(Theme.Surface.app) + .formKeyboardToolbar() .navigationTitle("Farina") .navigationBarTitleDisplayMode(.inline) .toolbar { @@ -92,6 +99,7 @@ struct SelectionFormRow: View { .font(.footnote.weight(.semibold)) .foregroundStyle(Theme.muted) } + .formRowHitArea() } } diff --git a/Levain/Features/Shared/ToastBannerView.swift b/Levain/Features/Shared/ToastBannerView.swift index be2c459..1f0254f 100644 --- a/Levain/Features/Shared/ToastBannerView.swift +++ b/Levain/Features/Shared/ToastBannerView.swift @@ -26,6 +26,7 @@ struct ToastBannerView: View { RoundedRectangle(cornerRadius: Theme.Radius.control, style: .continuous) .stroke(Theme.Border.emphasis, lineWidth: 1) ) + .accessibilityElement(children: .contain) .accessibilityIdentifier("ToastBannerView") } } diff --git a/Levain/Features/Starter/RefreshLogView.swift b/Levain/Features/Starter/RefreshLogView.swift index d4a91a9..0a2dcd6 100644 --- a/Levain/Features/Starter/RefreshLogView.swift +++ b/Levain/Features/Starter/RefreshLogView.swift @@ -42,7 +42,13 @@ struct RefreshLogView: View { Section("Dettagli") { DatePicker("Quando", selection: $dateTime) - TextField("Rapporto", text: $ratioText) + FormTextRow( + title: "Rapporto", + placeholder: "1:4:4", + text: $ratioText, + capitalization: .never, + keyboard: .numbersAndPunctuation + ) NumericField(title: "Temp. ambiente (°C)", value: $ambientTemp) } @@ -61,6 +67,7 @@ struct RefreshLogView: View { .font(.footnote.weight(.semibold)) .foregroundStyle(Theme.muted) } + .formRowHitArea() } .buttonStyle(.plain) } @@ -99,6 +106,7 @@ struct RefreshLogView: View { .lineLimit(2...5) } } + .formKeyboardToolbar() .navigationTitle("Rinfresco") .tint(Theme.Control.primaryFill) .toolbar { diff --git a/Levain/Features/Starter/StarterDetailView.swift b/Levain/Features/Starter/StarterDetailView.swift index 3d32a6c..18b8642 100644 --- a/Levain/Features/Starter/StarterDetailView.swift +++ b/Levain/Features/Starter/StarterDetailView.swift @@ -93,7 +93,7 @@ struct StarterDetailView: View { .foregroundStyle(Theme.muted) } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) } } } diff --git a/Levain/Features/Starter/StarterEditorView.swift b/Levain/Features/Starter/StarterEditorView.swift index b57e583..834880b 100644 --- a/Levain/Features/Starter/StarterEditorView.swift +++ b/Levain/Features/Starter/StarterEditorView.swift @@ -35,10 +35,13 @@ struct StarterEditorView: View { var body: some View { Form { Section("Identità") { - LabeledContent("Nome dello starter") { - TextField("es. Ciccio", text: $name) - .multilineTextAlignment(.trailing) - } + FormTextRow( + title: "Nome dello starter", + placeholder: "es. Ciccio", + text: $name, + autofocus: starter == nil, + capitalization: .words + ) } Section("Setup") { @@ -76,6 +79,7 @@ struct StarterEditorView: View { .font(.footnote.weight(.semibold)) .foregroundStyle(Theme.muted) } + .formRowHitArea() } .buttonStyle(.plain) } @@ -107,6 +111,7 @@ struct StarterEditorView: View { .lineLimit(3...6) } } + .formKeyboardToolbar() .navigationTitle(starter == nil ? "Nuovo starter" : "Modifica starter") .tint(Theme.Control.primaryFill) .scrollContentBackground(.hidden) diff --git a/Levain/Features/Starter/StarterView.swift b/Levain/Features/Starter/StarterView.swift index e607314..75d420f 100644 --- a/Levain/Features/Starter/StarterView.swift +++ b/Levain/Features/Starter/StarterView.swift @@ -102,7 +102,7 @@ struct StarterView: View { .foregroundStyle(Theme.muted) } } - .buttonStyle(.plain) + .buttonStyle(FullRowPlainButtonStyle()) .listRowSeparator(.hidden) .listRowBackground(Color.clear) .listRowInsets(.levainListRow(top: Theme.Spacing.md, bottom: Theme.Spacing.xs)) diff --git a/Levain/Features/Today/TodayStepCardView.swift b/Levain/Features/Today/TodayStepCardView.swift index 011e865..3cc0e08 100644 --- a/Levain/Features/Today/TodayStepCardView.swift +++ b/Levain/Features/Today/TodayStepCardView.swift @@ -19,6 +19,7 @@ struct TodayStepCardView: View { onCustomShift: allowsShift ? onOpenShift : nil, onQuickShift: allowsShift ? onQuickShift : nil ) + .accessibilityElement(children: .contain) .accessibilityIdentifier("TodayOperationalCard") } diff --git a/Levain/Persistence/SeedDataLoader.swift b/Levain/Persistence/SeedDataLoader.swift index 88fd3d7..c7a46e7 100644 --- a/Levain/Persistence/SeedDataLoader.swift +++ b/Levain/Persistence/SeedDataLoader.swift @@ -297,6 +297,19 @@ enum SeedDataLoader { notes: "Solo ricetta salvata, nessun lavoro in agenda." ) context.insert(formula) + + // Recipes alone do not count as user data on Today: an archived kefir + // batch makes the store non-empty without creating any work or preview. + let archivedBatch = KefirBatch( + name: "Batch archiviato", + createdAt: .now.adding(minutes: -20 * 24 * 60), + lastManagedAt: .now.adding(minutes: -12 * 24 * 60), + expectedRoutineHours: 24, + storageMode: .roomTemperature, + notes: "Chiuso, nessuna azione richiesta.", + archivedAt: .now.adding(minutes: -10 * 24 * 60) + ) + context.insert(archivedBatch) } private static func insertOperationalKefirHistory( diff --git a/LevainUITests/BakesFlowUITests.swift b/LevainUITests/BakesFlowUITests.swift index a55e0e8..c7463f5 100644 --- a/LevainUITests/BakesFlowUITests.swift +++ b/LevainUITests/BakesFlowUITests.swift @@ -50,7 +50,7 @@ final class BakesFlowUITests: XCTestCase { XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "BakesScrollView").firstMatch.waitForExistence(timeout: 8)) XCTAssertTrue(app.staticTexts["Nessun impasto ancora"].waitForExistence(timeout: 8)) - XCTAssertTrue(app.buttons["Crea il tuo primo impasto"].waitForExistence(timeout: 8)) + XCTAssertTrue(app.buttons["Nuovo impasto"].waitForExistence(timeout: 8)) } func testNewBakeShowsSystemTemplatesInRecipePicker() throws { diff --git a/LevainUITests/FormInputUITests.swift b/LevainUITests/FormInputUITests.swift new file mode 100644 index 0000000..ea5baec --- /dev/null +++ b/LevainUITests/FormInputUITests.swift @@ -0,0 +1,58 @@ +import XCTest + +@MainActor +final class FormInputUITests: XCTestCase { + override func setUpWithError() throws { + continueAfterFailure = false + } + + private func openNewStarterEditor(in app: XCUIApplication) { + let batchTab = app.tabBars.buttons["Batch"] + XCTAssertTrue(batchTab.waitForExistence(timeout: 8)) + batchTab.tap() + let menu = app.buttons["Nuova preparazione"].firstMatch + XCTAssertTrue(menu.waitForExistence(timeout: 8)) + menu.tap() + let newStarter = app.buttons["Nuovo starter"].firstMatch + XCTAssertTrue(newStarter.waitForExistence(timeout: 5)) + newStarter.tap() + XCTAssertTrue(app.navigationBars["Nuovo starter"].waitForExistence(timeout: 8)) + } + + func testNewStarterFocusesNameAndRowsAreFullyTappable() throws { + let app = XCUIApplication() + app.launchEmpty() + openNewStarterEditor(in: app) + + // Name field is focused automatically: typing goes straight into it. + let nameField = app.textFields["es. Ciccio"] + XCTAssertTrue(nameField.waitForExistence(timeout: 5)) + XCTAssertTrue(app.keyboards.firstMatch.waitForExistence(timeout: 5), "Keyboard should open on its own for a new starter") + app.typeText("Ciccio") + XCTAssertEqual(nameField.value as? String, "Ciccio") + app.toolbars.buttons["Fine"].firstMatch.tap() + XCTAssertTrue(app.keyboards.firstMatch.waitForNonExistence(timeout: 5)) + + // Tapping the row label focuses the numeric field and shows a numeric keypad. + app.staticTexts["Peso contenitore (g)"].tap() + XCTAssertTrue(app.keyboards.firstMatch.waitForExistence(timeout: 5)) + XCTAssertFalse(app.keyboards.keys["q"].exists, "Numeric fields must show the number pad") + app.typeText("350") + app.toolbars.buttons["Fine"].firstMatch.tap() + XCTAssertTrue(app.keyboards.firstMatch.waitForNonExistence(timeout: 5)) + + // Flour category rows react to taps in the empty middle area. + app.buttons["Aggiungi farina"].tap() + XCTAssertTrue(app.navigationBars["Farina"].waitForExistence(timeout: 5)) + let ryeRow = app.buttons["Segale"].firstMatch + XCTAssertTrue(ryeRow.waitForExistence(timeout: 5)) + ryeRow.coordinate(withNormalizedOffset: CGVector(dx: 0.6, dy: 0.5)).tap() + XCTAssertTrue(app.images["checkmark"].waitForExistence(timeout: 3)) + app.navigationBars["Farina"].buttons["Conferma"].tap() + + let flourRow = app.buttons.matching(NSPredicate(format: "label CONTAINS 'Segale'")).firstMatch + XCTAssertTrue(flourRow.waitForExistence(timeout: 5)) + flourRow.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap() + XCTAssertTrue(app.navigationBars["Farina"].waitForExistence(timeout: 5), "Tapping the middle of a flour row should open its editor") + } +} diff --git a/LevainUITests/KefirFlowUITests.swift b/LevainUITests/KefirFlowUITests.swift index 1040eb2..c77e1a2 100644 --- a/LevainUITests/KefirFlowUITests.swift +++ b/LevainUITests/KefirFlowUITests.swift @@ -14,7 +14,8 @@ final class KefirFlowUITests: XCTestCase { let card = app.descendants(matching: .any).matching(identifier: "KefirHubCard").firstMatch XCTAssertTrue(card.waitForExistence(timeout: 8)) - XCTAssertEqual(card.value as? String, "1 da seguire · 1 in corso · 2 in pausa") + // The tile shows at most two rows (most urgent first). + XCTAssertEqual(card.value as? String, "1 da rinnovare · 1 in corso") } func testSeededKefirHubShowsGroupedBatchSections() throws { @@ -28,8 +29,12 @@ final class KefirFlowUITests: XCTestCase { XCTAssertTrue(app.staticTexts["Batch kefir cucina"].exists) XCTAssertTrue(app.staticTexts["Batch kefir colazione"].exists) XCTAssertTrue(scrollUntilVisible(app.descendants(matching: .any).matching(identifier: "KefirSection-paused").firstMatch, in: app)) - XCTAssertTrue(scrollUntilVisible(app.descendants(matching: .any).matching(identifier: "KefirSection-archived").firstMatch, in: app)) XCTAssertTrue(scrollUntilVisible(app.staticTexts["Backup frigo"], in: app)) + // Archived batches live in a collapsible section, closed by default. + let archiveHeader = app.buttons["KefirArchiveSectionHeader"].firstMatch + XCTAssertTrue(scrollUntilVisible(archiveHeader, in: app)) + XCTAssertFalse(app.staticTexts["Batch test derivato"].exists) + archiveHeader.tap() XCTAssertTrue(scrollUntilVisible(app.staticTexts["Batch test derivato"], in: app)) } @@ -75,9 +80,12 @@ final class KefirFlowUITests: XCTestCase { app.launchEmpty() openFermentations(in: app) - let quickNewKefirButton = app.descendants(matching: .any).matching(identifier: "QuickNewKefirButton").firstMatch - XCTAssertTrue(quickNewKefirButton.waitForExistence(timeout: 8)) - quickNewKefirButton.tap() + let newPreparationMenu = app.buttons["Nuova preparazione"].firstMatch + XCTAssertTrue(newPreparationMenu.waitForExistence(timeout: 8)) + newPreparationMenu.tap() + let newKefirButton = app.buttons["Nuovo batch kefir"].firstMatch + XCTAssertTrue(newKefirButton.waitForExistence(timeout: 5)) + newKefirButton.tap() XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "KefirBatchEditorView").firstMatch.waitForExistence(timeout: 8)) let nameField = app.textFields["KefirBatchNameField"] diff --git a/LevainUITests/LevainUITests.swift b/LevainUITests/LevainUITests.swift index f740515..d13103d 100644 --- a/LevainUITests/LevainUITests.swift +++ b/LevainUITests/LevainUITests.swift @@ -14,6 +14,7 @@ extension XCUIApplication { launchEnvironment["LEVAIN_SUPPRESS_NOTIFICATIONS"] = suppressNotifications ? "1" : "0" launchEnvironment["LEVAIN_SEED_SCENARIO"] = seedScenario launchEnvironment["LEVAIN_FORCE_NOTIFICATIONS_DENIED"] = forceNotificationsDenied ? "1" : "0" + launchEnvironment["LEVAIN_SKIP_SPLASH"] = "1" if let pendingNotificationRoute { launchEnvironment["LEVAIN_PENDING_NOTIFICATION_ROUTE"] = pendingNotificationRoute } diff --git a/LevainUITests/LifecycleUITests.swift b/LevainUITests/LifecycleUITests.swift index cc69283..ece0f7c 100644 --- a/LevainUITests/LifecycleUITests.swift +++ b/LevainUITests/LifecycleUITests.swift @@ -50,7 +50,8 @@ final class LifecycleUITests: XCTestCase { let route = "levain://starter/\(UUID().uuidString)" app.launchSeededWithPendingNotificationRoute(route) + // A route to a starter that no longer exists falls back to the Batch root. XCTAssertTrue(app.tabBars.buttons["Batch"].waitForExistence(timeout: 8)) - XCTAssertTrue(app.scrollViews["StarterScrollView"].waitForExistence(timeout: 8)) + XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "FermentationsView").firstMatch.waitForExistence(timeout: 8)) } } diff --git a/LevainUITests/NotificationRouteUITests.swift b/LevainUITests/NotificationRouteUITests.swift index f152457..c8d856c 100644 --- a/LevainUITests/NotificationRouteUITests.swift +++ b/LevainUITests/NotificationRouteUITests.swift @@ -25,7 +25,7 @@ final class NotificationRouteUITests: XCTestCase { // Direct-object routing: missing bake → Batch with empty path → FermentationsView XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "FermentationsView").firstMatch.waitForExistence(timeout: 8)) - let bannerProbe = app.otherElements["ToastBannerProbe"] + let bannerProbe = app.staticTexts["ToastBannerMessage"] XCTAssertTrue(bannerProbe.waitForExistence(timeout: 8)) XCTAssertEqual(bannerProbe.label, "Questo impasto non è più disponibile") } @@ -37,7 +37,7 @@ final class NotificationRouteUITests: XCTestCase { // Direct-object routing: missing starter → Batch with empty path → FermentationsView XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "FermentationsView").firstMatch.waitForExistence(timeout: 8)) - let bannerProbe = app.otherElements["ToastBannerProbe"] + let bannerProbe = app.staticTexts["ToastBannerMessage"] XCTAssertTrue(bannerProbe.waitForExistence(timeout: 8)) XCTAssertEqual(bannerProbe.label, "Starter non trovato") } @@ -56,7 +56,7 @@ final class NotificationRouteUITests: XCTestCase { app.launchSeededWithPendingNotificationRoute(route) XCTAssertTrue(app.descendants(matching: .any).matching(identifier: "FermentationsView").firstMatch.waitForExistence(timeout: 8)) - let bannerProbe = app.otherElements["ToastBannerProbe"] + let bannerProbe = app.staticTexts["ToastBannerMessage"] XCTAssertTrue(bannerProbe.waitForExistence(timeout: 8)) XCTAssertEqual(bannerProbe.label, "Batch non trovato") } @@ -75,7 +75,7 @@ final class NotificationRouteUITests: XCTestCase { app.launchEmptyWithDeniedNotifications() XCTAssertTrue(app.scrollViews["TodayScrollView"].waitForExistence(timeout: 8)) - let bannerProbe = app.otherElements["ToastBannerProbe"] + let bannerProbe = app.staticTexts["ToastBannerMessage"] XCTAssertTrue(bannerProbe.waitForExistence(timeout: 8)) XCTAssertEqual(bannerProbe.label, "Attiva le notifiche per ricevere i promemoria") } diff --git a/LevainUITests/TodayFlowUITests.swift b/LevainUITests/TodayFlowUITests.swift index 625f1f8..2d23e99 100644 --- a/LevainUITests/TodayFlowUITests.swift +++ b/LevainUITests/TodayFlowUITests.swift @@ -89,8 +89,8 @@ final class TodayFlowUITests: XCTestCase { XCTAssertTrue(refreshButton.waitForExistence(timeout: 5)) refreshButton.tap() - XCTAssertTrue(app.navigationBars["Log rinfresco"].waitForExistence(timeout: 5)) - app.navigationBars["Log rinfresco"].buttons["Salva"].tap() + XCTAssertTrue(app.navigationBars["Rinfresco"].waitForExistence(timeout: 5)) + app.navigationBars["Rinfresco"].buttons["Salva"].tap() XCTAssertTrue(app.scrollViews["TodayScrollView"].waitForExistence(timeout: 5)) XCTAssertFalse(app.buttons["Rinfresca"].firstMatch.exists) diff --git a/docs/knowledge-export/README.md b/docs/knowledge-export/README.md index 757a329..630ea23 100644 --- a/docs/knowledge-export/README.md +++ b/docs/knowledge-export/README.md @@ -12,8 +12,9 @@ Questa cartella contiene una copia Markdown esterna della knowledge base usata d - App runtime: `Levain/Resources/knowledge.json` - Sorgente editoriale: `docs/levain-knowledge.md` +- Rigenerazione: `python3 scripts/export_knowledge.py` -Articoli runtime esportati: **8**. +Articoli runtime esportati: **13**. ## Articoli per categoria @@ -24,14 +25,19 @@ Articoli runtime esportati: **8**. ### Fermentazione - [Bulk fermentation](items/bulk-fermentation-basics.md) — `bulk-fermentation-basics` +- [Appretto](items/appretto-guide.md) — `appretto-guide` - [Formatura e preforma](items/shaping-guide.md) — `shaping-guide` - [Cold retard](items/cold-retard-guide.md) — `cold-retard-guide` +- [Autolisi](items/autolisi-guide.md) — `autolisi-guide` +- [Pieghe e stretch & fold](items/pieghe-guide.md) — `pieghe-guide` +- [Bollitura](items/bollitura-guide.md) — `bollitura-guide` ### Starter - [Basi del lievito madre](items/starter-basics.md) — `starter-basics` - [Manutenzione starter in frigo](items/starter-maintenance-fridge.md) — `starter-maintenance-fridge` - [Recuperare uno starter pigro](items/starter-recovery.md) — `starter-recovery` +- [Levain](items/levain-guide.md) — `levain-guide` ### Troubleshooting diff --git a/docs/knowledge-export/items/appretto-guide.md b/docs/knowledge-export/items/appretto-guide.md new file mode 100644 index 0000000..ae4a2e2 --- /dev/null +++ b/docs/knowledge-export/items/appretto-guide.md @@ -0,0 +1,36 @@ +--- +id: "appretto-guide" +title: "Appretto" +category: "fermentation" +tags: ["appretto", "proof", "lievitazione finale"] +aliases: ["proof", "final proof", "second rise", "seconda lievitazione", "lievitazione finale"] +relatedStepTypes: ["proof"] +relatedStarterStates: [] +source: "Levain/Resources/knowledge.json" +--- + +# Appretto + +**ID:** `appretto-guide` +**Categoria:** `fermentation` + +**Tag:** `appretto`, `proof`, `lievitazione finale` + +**Alias:** `proof`, `final proof`, `second rise`, `seconda lievitazione`, `lievitazione finale` + +## Sintesi + +Come riconoscere l'appretto giusto prima della cottura o del passaggio in frigo. + +## Contenuto + +L'appretto è la lievitazione finale dopo la formatura. In questa fase l'impasto deve gonfiarsi senza perdere tensione: deve risultare più leggero, leggermente elastico al tatto e capace di recuperare lentamente se premi la superficie con un dito infarinato. Un appretto troppo corto porta a pane fitto e tagli che si aprono in modo irregolare; troppo lungo porta invece a poca spinta in forno e struttura fragile. Se prevedi un cold retard, l'impasto deve entrare in frigo già ben formato ma non al limite della sovralievitazione. + +## Collegamenti app + +- Step collegati: `proof` +- Stati starter collegati: nessuno + +--- + +[Torna all'indice](../README.md) diff --git a/docs/knowledge-export/items/autolisi-guide.md b/docs/knowledge-export/items/autolisi-guide.md new file mode 100644 index 0000000..8317788 --- /dev/null +++ b/docs/knowledge-export/items/autolisi-guide.md @@ -0,0 +1,36 @@ +--- +id: "autolisi-guide" +title: "Autolisi" +category: "fermentation" +tags: ["autolisi", "impasto", "idratazione"] +aliases: ["autolysis"] +relatedStepTypes: ["autolysis", "mix"] +relatedStarterStates: [] +source: "Levain/Resources/knowledge.json" +--- + +# Autolisi + +**ID:** `autolisi-guide` +**Categoria:** `fermentation` + +**Tag:** `autolisi`, `impasto`, `idratazione` + +**Alias:** `autolysis` + +## Sintesi + +Perché lasciare farina e liquidi a riposo prima dell'impasto completo può migliorare struttura ed estensibilità. + +## Contenuto + +L'autolisi è un riposo iniziale di farina e acqua, oppure farina e parte dei liquidi, prima di inserire sale, grassi o inoculo. In questo tempo la farina si idrata meglio e il glutine inizia a organizzarsi da solo, così l'impasto richiede meno lavoro meccanico e diventa più estensibile. Nelle ricette ricche o molto dolci l'autolisi va tenuta breve e controllata, perché latte, uova, zucchero e burro cambiano il comportamento dell'impasto rispetto a un pane magro. + +## Collegamenti app + +- Step collegati: `autolysis`, `mix` +- Stati starter collegati: nessuno + +--- + +[Torna all'indice](../README.md) diff --git a/docs/knowledge-export/items/bakers-math.md b/docs/knowledge-export/items/bakers-math.md index 9062ccd..0cd9f2d 100644 --- a/docs/knowledge-export/items/bakers-math.md +++ b/docs/knowledge-export/items/bakers-math.md @@ -3,7 +3,7 @@ id: "bakers-math" title: "Baker's math e idratazione" category: "bakerMath" tags: ["percentuale", "idratazione", "calcolo"] -aliases: [] +aliases: ["baker's math", "bakers math", "idratazione", "hydration"] relatedStepTypes: ["mix"] relatedStarterStates: [] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `percentuale`, `idratazione`, `calcolo` +**Alias:** `baker's math`, `bakers math`, `idratazione`, `hydration` + ## Sintesi Come usare la baker's percentage per calcolare e scalare le ricette. diff --git a/docs/knowledge-export/items/bollitura-guide.md b/docs/knowledge-export/items/bollitura-guide.md new file mode 100644 index 0000000..77e8e3b --- /dev/null +++ b/docs/knowledge-export/items/bollitura-guide.md @@ -0,0 +1,36 @@ +--- +id: "bollitura-guide" +title: "Bollitura" +category: "fermentation" +tags: ["bollitura", "bagel", "boil and bake"] +aliases: ["boil and bake", "boil", "bollire i bagel"] +relatedStepTypes: [] +relatedStarterStates: [] +source: "Levain/Resources/knowledge.json" +--- + +# Bollitura + +**ID:** `bollitura-guide` +**Categoria:** `fermentation` + +**Tag:** `bollitura`, `bagel`, `boil and bake` + +**Alias:** `boil and bake`, `boil`, `bollire i bagel` + +## Sintesi + +Perché la bollitura è decisiva nei bagel e come evitare che la fase rovini forma e consistenza. + +## Contenuto + +La bollitura gelatinizza in superficie l'amido e crea la pelle elastica che distingue i bagel da un pane cotto direttamente in forno. L'acqua deve sobbollire, non essere troppo violenta, e il passaggio dura in genere 30–60 secondi per lato a seconda dello stile. Se i bagel collassano o affondano troppo a lungo, spesso il problema è un appretto eccessivo; se restano opachi e poco tesi, la bollitura può essere stata troppo breve o l'impasto troppo freddo e poco maturo. Conviene portare forno e teglie in temperatura prima di iniziare, così il trasferimento resta rapido. + +## Collegamenti app + +- Step collegati: nessuno +- Stati starter collegati: nessuno + +--- + +[Torna all'indice](../README.md) diff --git a/docs/knowledge-export/items/bulk-fermentation-basics.md b/docs/knowledge-export/items/bulk-fermentation-basics.md index c81f02e..cc7dd97 100644 --- a/docs/knowledge-export/items/bulk-fermentation-basics.md +++ b/docs/knowledge-export/items/bulk-fermentation-basics.md @@ -3,7 +3,7 @@ id: "bulk-fermentation-basics" title: "Bulk fermentation" category: "fermentation" tags: ["bulk", "fermentazione", "temperatura"] -aliases: [] +aliases: ["bulk", "prima lievitazione", "first rise"] relatedStepTypes: ["bulk", "fold"] relatedStarterStates: [] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `bulk`, `fermentazione`, `temperatura` +**Alias:** `bulk`, `prima lievitazione`, `first rise` + ## Sintesi Come leggere e gestire la bulk fermentation per un impasto ben sviluppato. diff --git a/docs/knowledge-export/items/cold-retard-guide.md b/docs/knowledge-export/items/cold-retard-guide.md index b2c5267..3b624ce 100644 --- a/docs/knowledge-export/items/cold-retard-guide.md +++ b/docs/knowledge-export/items/cold-retard-guide.md @@ -3,7 +3,7 @@ id: "cold-retard-guide" title: "Cold retard" category: "fermentation" tags: ["frigo", "retarder", "sapore"] -aliases: [] +aliases: ["cold retard", "lievitazione finale in frigo", "proof in frigo"] relatedStepTypes: ["coldRetard", "proof"] relatedStarterStates: [] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `frigo`, `retarder`, `sapore` +**Alias:** `cold retard`, `lievitazione finale in frigo`, `proof in frigo` + ## Sintesi Come e perché usare il frigo durante la lievitazione finale. diff --git a/docs/knowledge-export/items/common-problems.md b/docs/knowledge-export/items/common-problems.md index 09ef5b8..6ce3059 100644 --- a/docs/knowledge-export/items/common-problems.md +++ b/docs/knowledge-export/items/common-problems.md @@ -3,7 +3,7 @@ id: "common-problems" title: "Problemi comuni e soluzioni" category: "troubleshooting" tags: ["troubleshooting", "crosta", "mollica", "pane piatto"] -aliases: [] +aliases: ["troubleshooting", "underproofing", "overproofing"] relatedStepTypes: ["bake"] relatedStarterStates: ["overdue"] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `troubleshooting`, `crosta`, `mollica`, `pane piatto` +**Alias:** `troubleshooting`, `underproofing`, `overproofing` + ## Sintesi Diagnosi e soluzioni per i problemi più frequenti nella panificazione con lievito madre. diff --git a/docs/knowledge-export/items/levain-guide.md b/docs/knowledge-export/items/levain-guide.md new file mode 100644 index 0000000..9202aee --- /dev/null +++ b/docs/knowledge-export/items/levain-guide.md @@ -0,0 +1,36 @@ +--- +id: "levain-guide" +title: "Levain" +category: "starter" +tags: ["levain", "prefermento", "starter prep"] +aliases: ["starter prep", "prefermento", "build del levain", "lievito di riporto"] +relatedStepTypes: [] +relatedStarterStates: [] +source: "Levain/Resources/knowledge.json" +--- + +# Levain + +**ID:** `levain-guide` +**Categoria:** `starter` + +**Tag:** `levain`, `prefermento`, `starter prep` + +**Alias:** `starter prep`, `prefermento`, `build del levain`, `lievito di riporto` + +## Sintesi + +Quando costruire un levain, come leggerlo e in cosa si distingue dallo starter nel barattolo. + +## Contenuto + +Il levain è una porzione di starter rinfrescata in una quantità pensata per una ricetta specifica. Serve a portare l'inoculo al punto giusto senza stressare il barattolo principale e permette di scegliere idratazione, forza e finestra di maturazione in base all'impasto. In genere è pronto quando ha aumentato chiaramente il volume, è aerato e ha un profumo lattico-acidulo pulito. Se collassa presto o resta molto compatto, conviene regolare temperatura, rapporto di rinfresco o tempo di attesa prima di usarlo. + +## Collegamenti app + +- Step collegati: nessuno +- Stati starter collegati: nessuno + +--- + +[Torna all'indice](../README.md) diff --git a/docs/knowledge-export/items/pieghe-guide.md b/docs/knowledge-export/items/pieghe-guide.md new file mode 100644 index 0000000..516b4ca --- /dev/null +++ b/docs/knowledge-export/items/pieghe-guide.md @@ -0,0 +1,36 @@ +--- +id: "pieghe-guide" +title: "Pieghe e stretch & fold" +category: "fermentation" +tags: ["pieghe", "stretch & fold", "glutine"] +aliases: ["pieghe", "stretch & fold", "stretch and fold", "giri di pieghe"] +relatedStepTypes: ["fold", "bulk"] +relatedStarterStates: [] +source: "Levain/Resources/knowledge.json" +--- + +# Pieghe e stretch & fold + +**ID:** `pieghe-guide` +**Categoria:** `fermentation` + +**Tag:** `pieghe`, `stretch & fold`, `glutine` + +**Alias:** `pieghe`, `stretch & fold`, `stretch and fold`, `giri di pieghe` + +## Sintesi + +Quando fare le pieghe durante la bulk e cosa devono cambiare davvero nell'impasto. + +## Contenuto + +Le pieghe servono a rinforzare la maglia glutinica e redistribuire temperatura e gas durante la bulk fermentation. Ogni giro dovrebbe tendere l'impasto senza strapparlo: se oppone troppa resistenza, conviene aspettare ancora un po'; se invece è molto rilassato o si allarga subito, un altro giro può aiutare. Nella pratica 2–4 giri ben distanziati sono spesso sufficienti. Più che contare i minuti, osserva se l'impasto tiene meglio la forma dopo ogni serie. + +## Collegamenti app + +- Step collegati: `fold`, `bulk` +- Stati starter collegati: nessuno + +--- + +[Torna all'indice](../README.md) diff --git a/docs/knowledge-export/items/shaping-guide.md b/docs/knowledge-export/items/shaping-guide.md index a9ae792..77d0cfc 100644 --- a/docs/knowledge-export/items/shaping-guide.md +++ b/docs/knowledge-export/items/shaping-guide.md @@ -3,7 +3,7 @@ id: "shaping-guide" title: "Formatura e preforma" category: "fermentation" tags: ["formatura", "tensione", "bench rest"] -aliases: [] +aliases: ["formatura", "preforma", "bench rest", "shape", "shaping"] relatedStepTypes: ["preshape", "benchRest", "shape"] relatedStarterStates: [] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `formatura`, `tensione`, `bench rest` +**Alias:** `formatura`, `preforma`, `bench rest`, `shape`, `shaping` + ## Sintesi Tecniche di preforma e formatura per costruire tensione superficiale. diff --git a/docs/knowledge-export/items/starter-basics.md b/docs/knowledge-export/items/starter-basics.md index 3bab88b..f9313f8 100644 --- a/docs/knowledge-export/items/starter-basics.md +++ b/docs/knowledge-export/items/starter-basics.md @@ -3,7 +3,7 @@ id: "starter-basics" title: "Basi del lievito madre" category: "starter" tags: ["starter", "rinfresco", "manutenzione"] -aliases: [] +aliases: ["starter", "lievito madre", "sourdough starter"] relatedStepTypes: ["starterRefresh"] relatedStarterStates: ["ok", "dueToday"] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `starter`, `rinfresco`, `manutenzione` +**Alias:** `starter`, `lievito madre`, `sourdough starter` + ## Sintesi Cos'è lo starter, come funziona e i segnali di uno starter sano. diff --git a/docs/knowledge-export/items/starter-maintenance-fridge.md b/docs/knowledge-export/items/starter-maintenance-fridge.md index a95ae24..0843e44 100644 --- a/docs/knowledge-export/items/starter-maintenance-fridge.md +++ b/docs/knowledge-export/items/starter-maintenance-fridge.md @@ -3,7 +3,7 @@ id: "starter-maintenance-fridge" title: "Manutenzione starter in frigo" category: "starter" tags: ["frigo", "conservazione", "rinfresco"] -aliases: [] +aliases: ["starter in frigo", "manutenzione starter", "rinfresco in frigo"] relatedStepTypes: ["starterRefresh"] relatedStarterStates: ["dueToday", "overdue"] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `frigo`, `conservazione`, `rinfresco` +**Alias:** `starter in frigo`, `manutenzione starter`, `rinfresco in frigo` + ## Sintesi Come conservare e rinfrescare lo starter in frigorifero. diff --git a/docs/knowledge-export/items/starter-recovery.md b/docs/knowledge-export/items/starter-recovery.md index dfde7ac..14c9464 100644 --- a/docs/knowledge-export/items/starter-recovery.md +++ b/docs/knowledge-export/items/starter-recovery.md @@ -3,7 +3,7 @@ id: "starter-recovery" title: "Recuperare uno starter pigro" category: "starter" tags: ["recupero", "attività", "troubleshooting"] -aliases: [] +aliases: ["starter pigro", "starter debole", "hooch"] relatedStepTypes: ["starterRefresh"] relatedStarterStates: ["overdue"] source: "Levain/Resources/knowledge.json" @@ -16,6 +16,8 @@ source: "Levain/Resources/knowledge.json" **Tag:** `recupero`, `attività`, `troubleshooting` +**Alias:** `starter pigro`, `starter debole`, `hooch` + ## Sintesi Come riattivare uno starter che cresce lentamente o mostra segni di stanchezza. diff --git a/docs/knowledge-export/knowledge-base-completa.md b/docs/knowledge-export/knowledge-base-completa.md index 5c30474..7f7a0a6 100644 --- a/docs/knowledge-export/knowledge-base-completa.md +++ b/docs/knowledge-export/knowledge-base-completa.md @@ -2,7 +2,7 @@ Export Markdown della knowledge base caricata dall'app da `Levain/Resources/knowledge.json`. -- Articoli esportati: 8 +- Articoli esportati: 13 - Formato: un articolo per sezione, con metadati app preservati - Nota: il testo e i campi sono copiati dal JSON runtime senza correzioni editoriali @@ -17,6 +17,8 @@ Export Markdown della knowledge base caricata dall'app da `Levain/Resources/know **Tag:** `starter`, `rinfresco`, `manutenzione` +**Alias:** `starter`, `lievito madre`, `sourdough starter` + ## Sintesi Cos'è lo starter, come funziona e i segnali di uno starter sano. @@ -41,6 +43,8 @@ Lo starter è un impasto di farina e acqua fermentato in modo continuo, che ospi **Tag:** `frigo`, `conservazione`, `rinfresco` +**Alias:** `starter in frigo`, `manutenzione starter`, `rinfresco in frigo` + ## Sintesi Come conservare e rinfrescare lo starter in frigorifero. @@ -65,6 +69,8 @@ Conservare lo starter in frigo a 4–8 °C rallentera la fermentazione. Fai un r **Tag:** `recupero`, `attività`, `troubleshooting` +**Alias:** `starter pigro`, `starter debole`, `hooch` + ## Sintesi Come riattivare uno starter che cresce lentamente o mostra segni di stanchezza. @@ -80,7 +86,33 @@ Aumenta temporaneamente la temperatura (22–26 °C). Fai rinfreschi più freque --- -## 4. Bulk fermentation +## 4. Levain + + + +**ID:** `levain-guide` +**Categoria:** `starter` + +**Tag:** `levain`, `prefermento`, `starter prep` + +**Alias:** `starter prep`, `prefermento`, `build del levain`, `lievito di riporto` + +## Sintesi + +Quando costruire un levain, come leggerlo e in cosa si distingue dallo starter nel barattolo. + +## Contenuto + +Il levain è una porzione di starter rinfrescata in una quantità pensata per una ricetta specifica. Serve a portare l'inoculo al punto giusto senza stressare il barattolo principale e permette di scegliere idratazione, forza e finestra di maturazione in base all'impasto. In genere è pronto quando ha aumentato chiaramente il volume, è aerato e ha un profumo lattico-acidulo pulito. Se collassa presto o resta molto compatto, conviene regolare temperatura, rapporto di rinfresco o tempo di attesa prima di usarlo. + +## Collegamenti app + +- Step collegati: nessuno +- Stati starter collegati: nessuno + +--- + +## 5. Bulk fermentation @@ -89,6 +121,8 @@ Aumenta temporaneamente la temperatura (22–26 °C). Fai rinfreschi più freque **Tag:** `bulk`, `fermentazione`, `temperatura` +**Alias:** `bulk`, `prima lievitazione`, `first rise` + ## Sintesi Come leggere e gestire la bulk fermentation per un impasto ben sviluppato. @@ -104,7 +138,33 @@ La bulk fermentation è la fase di lievitazione principale dopo l'impasto. L'imp --- -## 5. Baker's math e idratazione +## 6. Appretto + + + +**ID:** `appretto-guide` +**Categoria:** `fermentation` + +**Tag:** `appretto`, `proof`, `lievitazione finale` + +**Alias:** `proof`, `final proof`, `second rise`, `seconda lievitazione`, `lievitazione finale` + +## Sintesi + +Come riconoscere l'appretto giusto prima della cottura o del passaggio in frigo. + +## Contenuto + +L'appretto è la lievitazione finale dopo la formatura. In questa fase l'impasto deve gonfiarsi senza perdere tensione: deve risultare più leggero, leggermente elastico al tatto e capace di recuperare lentamente se premi la superficie con un dito infarinato. Un appretto troppo corto porta a pane fitto e tagli che si aprono in modo irregolare; troppo lungo porta invece a poca spinta in forno e struttura fragile. Se prevedi un cold retard, l'impasto deve entrare in frigo già ben formato ma non al limite della sovralievitazione. + +## Collegamenti app + +- Step collegati: `proof` +- Stati starter collegati: nessuno + +--- + +## 7. Baker's math e idratazione @@ -113,6 +173,8 @@ La bulk fermentation è la fase di lievitazione principale dopo l'impasto. L'imp **Tag:** `percentuale`, `idratazione`, `calcolo` +**Alias:** `baker's math`, `bakers math`, `idratazione`, `hydration` + ## Sintesi Come usare la baker's percentage per calcolare e scalare le ricette. @@ -128,7 +190,7 @@ Nella baker's math la farina totale è sempre 100%. Tutti gli altri ingredienti --- -## 6. Formatura e preforma +## 8. Formatura e preforma @@ -137,6 +199,8 @@ Nella baker's math la farina totale è sempre 100%. Tutti gli altri ingredienti **Tag:** `formatura`, `tensione`, `bench rest` +**Alias:** `formatura`, `preforma`, `bench rest`, `shape`, `shaping` + ## Sintesi Tecniche di preforma e formatura per costruire tensione superficiale. @@ -152,7 +216,7 @@ La preforma crea una tensione iniziale e dà all'impasto una struttura temporane --- -## 7. Cold retard +## 9. Cold retard @@ -161,6 +225,8 @@ La preforma crea una tensione iniziale e dà all'impasto una struttura temporane **Tag:** `frigo`, `retarder`, `sapore` +**Alias:** `cold retard`, `lievitazione finale in frigo`, `proof in frigo` + ## Sintesi Come e perché usare il frigo durante la lievitazione finale. @@ -176,7 +242,85 @@ Il cold retard (lievitazione finale in frigo a 4–6 °C) sviluppa sapore e faci --- -## 8. Problemi comuni e soluzioni +## 10. Autolisi + + + +**ID:** `autolisi-guide` +**Categoria:** `fermentation` + +**Tag:** `autolisi`, `impasto`, `idratazione` + +**Alias:** `autolysis` + +## Sintesi + +Perché lasciare farina e liquidi a riposo prima dell'impasto completo può migliorare struttura ed estensibilità. + +## Contenuto + +L'autolisi è un riposo iniziale di farina e acqua, oppure farina e parte dei liquidi, prima di inserire sale, grassi o inoculo. In questo tempo la farina si idrata meglio e il glutine inizia a organizzarsi da solo, così l'impasto richiede meno lavoro meccanico e diventa più estensibile. Nelle ricette ricche o molto dolci l'autolisi va tenuta breve e controllata, perché latte, uova, zucchero e burro cambiano il comportamento dell'impasto rispetto a un pane magro. + +## Collegamenti app + +- Step collegati: `autolysis`, `mix` +- Stati starter collegati: nessuno + +--- + +## 11. Pieghe e stretch & fold + + + +**ID:** `pieghe-guide` +**Categoria:** `fermentation` + +**Tag:** `pieghe`, `stretch & fold`, `glutine` + +**Alias:** `pieghe`, `stretch & fold`, `stretch and fold`, `giri di pieghe` + +## Sintesi + +Quando fare le pieghe durante la bulk e cosa devono cambiare davvero nell'impasto. + +## Contenuto + +Le pieghe servono a rinforzare la maglia glutinica e redistribuire temperatura e gas durante la bulk fermentation. Ogni giro dovrebbe tendere l'impasto senza strapparlo: se oppone troppa resistenza, conviene aspettare ancora un po'; se invece è molto rilassato o si allarga subito, un altro giro può aiutare. Nella pratica 2–4 giri ben distanziati sono spesso sufficienti. Più che contare i minuti, osserva se l'impasto tiene meglio la forma dopo ogni serie. + +## Collegamenti app + +- Step collegati: `fold`, `bulk` +- Stati starter collegati: nessuno + +--- + +## 12. Bollitura + + + +**ID:** `bollitura-guide` +**Categoria:** `fermentation` + +**Tag:** `bollitura`, `bagel`, `boil and bake` + +**Alias:** `boil and bake`, `boil`, `bollire i bagel` + +## Sintesi + +Perché la bollitura è decisiva nei bagel e come evitare che la fase rovini forma e consistenza. + +## Contenuto + +La bollitura gelatinizza in superficie l'amido e crea la pelle elastica che distingue i bagel da un pane cotto direttamente in forno. L'acqua deve sobbollire, non essere troppo violenta, e il passaggio dura in genere 30–60 secondi per lato a seconda dello stile. Se i bagel collassano o affondano troppo a lungo, spesso il problema è un appretto eccessivo; se restano opachi e poco tesi, la bollitura può essere stata troppo breve o l'impasto troppo freddo e poco maturo. Conviene portare forno e teglie in temperatura prima di iniziare, così il trasferimento resta rapido. + +## Collegamenti app + +- Step collegati: nessuno +- Stati starter collegati: nessuno + +--- + +## 13. Problemi comuni e soluzioni @@ -185,6 +329,8 @@ Il cold retard (lievitazione finale in frigo a 4–6 °C) sviluppa sapore e faci **Tag:** `troubleshooting`, `crosta`, `mollica`, `pane piatto` +**Alias:** `troubleshooting`, `underproofing`, `overproofing` + ## Sintesi Diagnosi e soluzioni per i problemi più frequenti nella panificazione con lievito madre. diff --git a/project.yml b/project.yml index 8df2239..8414abd 100644 --- a/project.yml +++ b/project.yml @@ -1,12 +1,15 @@ name: Levain options: createIntermediateGroups: true + xcodeVersion: "26.4" settings: base: MARKETING_VERSION: 0.1.0 CURRENT_PROJECT_VERSION: 1 SWIFT_VERSION: 6.0 - DEVELOPMENT_TEAM: "" + DEVELOPMENT_TEAM: C974BPN56D + ENABLE_USER_SCRIPT_SANDBOXING: YES + STRING_CATALOG_GENERATE_SYMBOLS: YES ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon targets: Levain: diff --git a/scripts/export_knowledge.py b/scripts/export_knowledge.py new file mode 100755 index 0000000..be35827 --- /dev/null +++ b/scripts/export_knowledge.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +"""Export the runtime knowledge base to Markdown in docs/knowledge-export/. + +Usage: + python3 scripts/export_knowledge.py [--json PATH] [--out DIR] + +Sources: + - Levain/Resources/knowledge.json (runtime articles) + - docs/levain-knowledge.md (editorial source, copied verbatim) + +The output is fully regenerated: README.md, knowledge-base-completa.md, +source-editoriale-completa.md and one file per article in items/. +Text and fields are copied from the JSON without editorial changes. +""" + +from __future__ import annotations + +import argparse +import json +import shutil +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parent.parent +JSON_SOURCE = "Levain/Resources/knowledge.json" +EDITORIAL_SOURCE = "docs/levain-knowledge.md" + +CATEGORY_TITLES = { + "bakerMath": "Baker's math", + "fermentation": "Fermentazione", + "starter": "Starter", + "troubleshooting": "Troubleshooting", +} + + +def inline_codes(values: list[str]) -> str: + return ", ".join(f"`{v}`" for v in values) if values else "nessuno" + + +def yaml_list(values: list[str]) -> str: + return json.dumps(values, ensure_ascii=False, separators=(", ", ": ")) + + +def article_body(item: dict) -> list[str]: + """Body shared by the single-article files and the full export.""" + lines = [ + f"**ID:** `{item['id']}` ", + f"**Categoria:** `{item['category']}`", + "", + f"**Tag:** {inline_codes(item.get('tags') or [])}", + ] + aliases = item.get("aliases") or [] + if aliases: + lines.append("") + lines.append(f"**Alias:** {inline_codes(aliases)}") + lines += [ + "", + "## Sintesi", + "", + item["summary"], + "", + "## Contenuto", + "", + item["content"], + "", + "## Collegamenti app", + "", + f"- Step collegati: {inline_codes(item.get('relatedStepTypes') or [])}", + f"- Stati starter collegati: {inline_codes(item.get('relatedStarterStates') or [])}", + "", + "---", + ] + return lines + + +def item_file(item: dict) -> str: + front = [ + "---", + f"id: {json.dumps(item['id'], ensure_ascii=False)}", + f"title: {json.dumps(item['title'], ensure_ascii=False)}", + f"category: {json.dumps(item['category'], ensure_ascii=False)}", + f"tags: {yaml_list(item.get('tags') or [])}", + f"aliases: {yaml_list(item.get('aliases') or [])}", + f"relatedStepTypes: {yaml_list(item.get('relatedStepTypes') or [])}", + f"relatedStarterStates: {yaml_list(item.get('relatedStarterStates') or [])}", + f"source: {json.dumps(JSON_SOURCE)}", + "---", + "", + f"# {item['title']}", + "", + ] + return "\n".join(front + article_body(item) + ["", "[Torna all'indice](../README.md)", ""]) + + +def full_export(items: list[dict]) -> str: + lines = [ + "# Batch Knowledge Base completa", + "", + f"Export Markdown della knowledge base caricata dall'app da `{JSON_SOURCE}`.", + "", + f"- Articoli esportati: {len(items)}", + "- Formato: un articolo per sezione, con metadati app preservati", + "- Nota: il testo e i campi sono copiati dal JSON runtime senza correzioni editoriali", + "", + "---", + "", + ] + for n, item in enumerate(items, 1): + lines += [f"## {n}. {item['title']}", "", "", ""] + lines += article_body(item) + lines.append("") + return "\n".join(lines) + + +def readme(items: list[dict]) -> str: + lines = [ + "# Batch Knowledge Export", + "", + "Questa cartella contiene una copia Markdown esterna della knowledge base usata dall'app Batch.", + "", + "## File principali", + "", + "- [Knowledge base completa](knowledge-base-completa.md)", + "- [Sorgente editoriale completa](source-editoriale-completa.md)", + "- [Articoli singoli](items/)", + "", + "## Origine", + "", + f"- App runtime: `{JSON_SOURCE}`", + f"- Sorgente editoriale: `{EDITORIAL_SOURCE}`", + "- Rigenerazione: `python3 scripts/export_knowledge.py`", + "", + f"Articoli runtime esportati: **{len(items)}**.", + "", + "## Articoli per categoria", + ] + categories = sorted({i["category"] for i in items}, key=lambda c: CATEGORY_TITLES.get(c, c)) + for cat in categories: + lines += ["", f"### {CATEGORY_TITLES.get(cat, cat)}", ""] + for item in items: + if item["category"] == cat: + lines.append(f"- [{item['title']}](items/{item['id']}.md) — `{item['id']}`") + return "\n".join(lines) + "\n" + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--json", type=Path, default=REPO_ROOT / JSON_SOURCE) + parser.add_argument("--out", type=Path, default=REPO_ROOT / "docs/knowledge-export") + args = parser.parse_args() + + items = json.loads(args.json.read_text(encoding="utf-8")) + out: Path = args.out + items_dir = out / "items" + if items_dir.exists(): + shutil.rmtree(items_dir) + items_dir.mkdir(parents=True) + + for item in items: + (items_dir / f"{item['id']}.md").write_text(item_file(item), encoding="utf-8") + (out / "knowledge-base-completa.md").write_text(full_export(items), encoding="utf-8") + (out / "README.md").write_text(readme(items), encoding="utf-8") + shutil.copyfile(REPO_ROOT / EDITORIAL_SOURCE, out / "source-editoriale-completa.md") + print(f"Esportati {len(items)} articoli in {out}") + + +if __name__ == "__main__": + main()