diff --git a/apps/fumadocs/content/docs/next/run/models.mdx b/apps/fumadocs/content/docs/next/run/models.mdx index c35f4272..a95b0f3d 100644 --- a/apps/fumadocs/content/docs/next/run/models.mdx +++ b/apps/fumadocs/content/docs/next/run/models.mdx @@ -87,6 +87,8 @@ An instance saved with the former `Local model with Ollama` option shows as `Ope `Save` in Settings, or `Save and continue` on the setup screen, tests the model before it stores anything. For categorisation, it asks about one sample merchant. For the assistant, it sends one short chat message. The messages, and `Save anyway`, are the ones in [Connection test results](/docs/run/email#connection-test-results). +On the setup screen's `Categories` step, `Test connection` runs the same test without saving. The test asks about one merchant. + The server picks up a saved model when it restarts. In Settings, press `Apply now`, as [Apply a saved change](/docs/run/email#apply-a-saved-change) describes. On the setup screen, `Finish setup` restarts it. To stop using a model, press `Change`, then `Turn off`, then `Apply now`. [What each model does](#what-each-model-does) says what changes without it. diff --git a/apps/fumadocs/content/docs/next/use/account.mdx b/apps/fumadocs/content/docs/next/use/account.mdx index a568771b..9d857cb6 100644 --- a/apps/fumadocs/content/docs/next/use/account.mdx +++ b/apps/fumadocs/content/docs/next/use/account.mdx @@ -13,6 +13,8 @@ The first time you sign in, Freenary asks two questions: 1. **Your tax residency.** Pick every country you pay tax in. It sets the banks you can connect. Countries other than France carry a `Limited support` badge. 2. **Your bank.** Connect at least one: `Finish` stays disabled until you do. If your instance can't link banks yet, the step shows `Bank linking is unavailable` and you can't finish until the operator sets up a bank provider. +On a wide screen, sample cards beside the form show what Freenary tracks: your balance, what you spent this month and your top categories. + No screen changes your tax residency later, so pick every country before you go on. diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 62fdf7db..6dde9be6 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -1479,5 +1479,6 @@ "ui_toggle_sidebar": "Toggle sidebar", "update_banner_dismiss": "Dismiss the notice for v{version}", "update_banner_new_tab": "(opens in a new tab)", - "update_banner_title": "Freenary v{version} is available" + "update_banner_title": "Freenary v{version} is available", + "wizard_step_done": "{step} (done)" } diff --git a/apps/web/messages/fr.json b/apps/web/messages/fr.json index 86da6194..c266d605 100644 --- a/apps/web/messages/fr.json +++ b/apps/web/messages/fr.json @@ -1488,5 +1488,6 @@ "ui_toggle_sidebar": "Afficher ou masquer la barre latérale", "update_banner_dismiss": "Masquer l’avis pour la v{version}", "update_banner_new_tab": "(s’ouvre dans un nouvel onglet)", - "update_banner_title": "Freenary v{version} est disponible" + "update_banner_title": "Freenary v{version} est disponible", + "wizard_step_done": "{step} (terminé)" } diff --git a/apps/web/public/favicon.png b/apps/web/public/favicon.png index 2a39b733..d23d46f1 100644 Binary files a/apps/web/public/favicon.png and b/apps/web/public/favicon.png differ diff --git a/apps/web/src/features/instance-integration/index.ts b/apps/web/src/features/instance-integration/index.ts index cd7ac12f..5df2bd42 100644 --- a/apps/web/src/features/instance-integration/index.ts +++ b/apps/web/src/features/instance-integration/index.ts @@ -7,6 +7,7 @@ export { variantLabel, } from "./model/labels"; export type { SaveOutcome } from "./model/outcome"; +export { initialChoiceOf } from "./model/variant-choice"; export { useInstanceIntegration } from "./model/use-instance-integration"; export { EnvironmentSummary } from "./ui/environment-summary"; export { ProviderStep } from "./ui/provider-step"; diff --git a/apps/web/src/features/instance-integration/ui/environment-summary.tsx b/apps/web/src/features/instance-integration/ui/environment-summary.tsx index 9ba1aba4..8901882e 100644 --- a/apps/web/src/features/instance-integration/ui/environment-summary.tsx +++ b/apps/web/src/features/instance-integration/ui/environment-summary.tsx @@ -6,7 +6,7 @@ import { RiCheckLine, RiServerLine } from "@remixicon/react"; import { m } from "@/paraglide/messages.js"; import { remixIcon } from "@/shared/lib/remix-icon"; -import { WizardStepHeader } from "@/shared/ui/wizard-step-header"; +import { WizardStepHeader } from "@/shared/ui/wizard"; import { environmentDocsUrl, diff --git a/apps/web/src/features/instance-integration/ui/provider-choice.tsx b/apps/web/src/features/instance-integration/ui/provider-choice.tsx index 35df502e..676806c7 100644 --- a/apps/web/src/features/instance-integration/ui/provider-choice.tsx +++ b/apps/web/src/features/instance-integration/ui/provider-choice.tsx @@ -5,7 +5,7 @@ import { cn } from "@freenary/ui/lib/utils"; import { useId } from "react"; import { m } from "@/paraglide/messages.js"; -import { WizardStepHeader } from "@/shared/ui/wizard-step-header"; +import { WizardStepHeader } from "@/shared/ui/wizard"; import { integrationDescription, diff --git a/apps/web/src/features/instance-integration/ui/provider-credentials.tsx b/apps/web/src/features/instance-integration/ui/provider-credentials.tsx index 0586c89a..aebf1fab 100644 --- a/apps/web/src/features/instance-integration/ui/provider-credentials.tsx +++ b/apps/web/src/features/instance-integration/ui/provider-credentials.tsx @@ -5,7 +5,7 @@ import type { ComponentType } from "react"; import { useState } from "react"; import { m } from "@/paraglide/messages.js"; -import { WizardStepHeader } from "@/shared/ui/wizard-step-header"; +import { WizardStepHeader } from "@/shared/ui/wizard"; import { credentialStepsOf, @@ -51,9 +51,12 @@ const VARIANT_GUIDES: Readonly> = { "subq-snap": { Note: NoGuideNote, Steps: SubqSnapGuide }, }; +type CredentialAction = "save" | "test"; + interface ProviderCredentialsProps { isBusy: boolean; onBack: () => void; + onCheck?: (values: Record) => void; onEdit: () => void; onSave: (values: Record, checkFirst: boolean) => void; outcome: SaveOutcome | undefined; @@ -82,6 +85,7 @@ const problemsOf = ( const SingleScreenCredentials = ({ isBusy, onBack, + onCheck, onEdit, onSave, outcome, @@ -91,6 +95,7 @@ const SingleScreenCredentials = ({ const ArrowLeftIcon = useIcon("arrow-left"); const [values, setValues] = useState(() => filledValuesOf(variant.fields)); const [problems, setProblems] = useState>({}); + const [lastAction, setLastAction] = useState("save"); const provider = variantLabel(variant.id); const guideUrl = variantGuideUrl(variant.id); @@ -102,16 +107,20 @@ const SingleScreenCredentials = ({ const optional = editable.filter((field) => !field.required); const checkFailed = outcome?.outcome === PROBE_FAILED; - const save = (checkFirst: boolean) => { + const submit = (action: CredentialAction, run: () => void) => { const found = problemsOf(editable, values); setProblems(found); if (Object.keys(found).length === 0) { - onSave(values, checkFirst); + setLastAction(action); + run(); } }; + const save = (checkFirst: boolean) => + submit("save", () => onSave(values, checkFirst)); + const renderField = (field: SetupFieldDescriptor) => { const problem = problems[field.key]; @@ -192,7 +201,18 @@ const SingleScreenCredentials = ({ > {m.setup_back()} -
+
+ {onCheck === undefined ? null : ( + + )} {checkFailed ? (
@@ -212,11 +237,14 @@ const SingleScreenCredentials = ({ ); }; -export const ProviderCredentials = (props: ProviderCredentialsProps) => { +export const ProviderCredentials = ({ + onCheck, + ...props +}: ProviderCredentialsProps) => { const steps = credentialStepsOf(props.variant.id, props.variant.fields); return steps === null ? ( - + ) : ( ); diff --git a/apps/web/src/features/instance-integration/ui/provider-step.tsx b/apps/web/src/features/instance-integration/ui/provider-step.tsx index a043ea1b..b937ffe0 100644 --- a/apps/web/src/features/instance-integration/ui/provider-step.tsx +++ b/apps/web/src/features/instance-integration/ui/provider-step.tsx @@ -27,10 +27,13 @@ export interface SetupIntegrationDescriptor { } interface ProviderStepProps { + chosen?: string; descriptor: SetupIntegrationDescriptor; isBusy: boolean; isFirstStep: boolean; onBack: () => void; + onCheck?: (variantId: string, values: Record) => void; + onChoose?: (variantId: string) => void; onEdit: () => void; onSave: ( variantId: string, @@ -43,20 +46,29 @@ interface ProviderStepProps { } export const ProviderStep = ({ + chosen: controlledChoice, descriptor, isBusy, isFirstStep, onBack, + onCheck, + onChoose, onEdit, onSave, onSkip, outcome, wording = "setup", }: ProviderStepProps) => { - const [chosen, setChosen] = useState(() => initialChoiceOf(descriptor)); + const [ownChoice, setOwnChoice] = useState(() => initialChoiceOf(descriptor)); const [isConfiguring, setIsConfiguring] = useState(false); + const chosen = controlledChoice ?? ownChoice; const variant = descriptor.variants.find((entry) => entry.id === chosen); + const choose = (variantId: string) => { + setOwnChoice(variantId); + onChoose?.(variantId); + }; + if (isConfiguring && variant !== undefined) { return ( onCheck(chosen, values) + } onEdit={onEdit} onSave={(values, checkFirst) => onSave(chosen, values, checkFirst)} outcome={outcome} @@ -81,7 +98,7 @@ export const ProviderStep = ({ isBusy={isBusy} isFirstStep={isFirstStep} onBack={onBack} - onChoose={setChosen} + onChoose={choose} onContinue={() => setIsConfiguring(true)} onSkip={offersSkipButton(descriptor, wording === "setup") ? onSkip : null} wording={wording} diff --git a/apps/web/src/pages/onboarding/ui/bank-connection-step.tsx b/apps/web/src/pages/onboarding/ui/bank-connection-step.tsx index a9326477..c1f12df1 100644 --- a/apps/web/src/pages/onboarding/ui/bank-connection-step.tsx +++ b/apps/web/src/pages/onboarding/ui/bank-connection-step.tsx @@ -8,7 +8,7 @@ import { } from "@/features/bank-connection"; import type { BankInstitution, BankLinking } from "@/features/bank-connection"; import { m } from "@/paraglide/messages.js"; -import { WizardStepHeader } from "@/shared/ui/wizard-step-header"; +import { WizardStepHeader } from "@/shared/ui/wizard"; interface BankConnectionStepProps { bankLinking: BankLinking; diff --git a/apps/web/src/pages/onboarding/ui/country-selection-step.tsx b/apps/web/src/pages/onboarding/ui/country-selection-step.tsx index e957413b..3f361e77 100644 --- a/apps/web/src/pages/onboarding/ui/country-selection-step.tsx +++ b/apps/web/src/pages/onboarding/ui/country-selection-step.tsx @@ -19,7 +19,7 @@ import { isFullySupportedCountry, } from "@/shared/lib/countries"; import { remixIcon } from "@/shared/lib/remix-icon"; -import { WizardStepHeader } from "@/shared/ui/wizard-step-header"; +import { WizardStepHeader } from "@/shared/ui/wizard"; interface CountrySelectionStepProps { onContinue: () => void; @@ -102,7 +102,7 @@ export const CountrySelectionStep = ({ -

+

{m.onboarding_contribute_prompt()}{" "} { orpc.bankConnection.listInstitutions.queryOptions({ enabled: wizard.taxCountries.length > 0 && bankLinking === "available", input: { countries: wizard.taxCountries }, + placeholderData: keepPreviousData, }) ); @@ -23,14 +24,16 @@ const OnboardingContent = () => { orpc.bankConnection.listConnections.queryOptions() ); + const connections = connectionsQuery.data?.connections ?? []; + return ( {

{m.onboarding_loading()}