Skip to content

feat(persona): role templates for the guided persona builder (#4253, PR2)#4416

Open
M3gA-Mind wants to merge 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:feat/GH-4253-persona-templates
Open

feat(persona): role templates for the guided persona builder (#4253, PR2)#4416
M3gA-Mind wants to merge 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:feat/GH-4253-persona-templates

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Depends on #4412

Stacked on #4412 (persona builder). Until #4412 merges, this PR's diff will also show PR1's commits. Reviewers: review ONLY the persona-templates commit(s) (feat(persona): role templates for the guided persona builder, 3cf1b17). Once #4412 merges I will rebase this branch onto main so the diff becomes persona-templates-only.

Summary

  • Adds six role starting-points to the guided persona builder from feat(persona): guided persona builder over SOUL.md (#4253, PR1) #4412: doctor, researcher, executive, teacher, student, family.
  • Applying a template seeds the Personality and Communication style sections of SOUL.md using the existing splice logic, and leaves the user-owned About you section and any hand-written content untouched — a non-destructive starting point the user reviews and saves.
  • Seed persona prose is kept as English constants (it is editable file content written into SOUL.md, like the bundled default, not UI chrome); only the picker's labels/descriptions are localized.
  • No Rust/core changes — reuses the workspace_file_* RPC and the PR1 parser.

Problem

Feedback on #4253: the SOUL.md concept is strong but users "do not know how to write a good persona." PR1 gave non-technical users structured fields; this PR gives them role-based starting points so they are not staring at empty fields.

Solution

  • persona/personaTemplates.ts: PERSONA_TEMPLATES (the six roles) + applyTemplate(soul, template) which splices Personality and Voice via applyPersonaField (idempotent; preserves everything else).
  • persona/PersonaTemplatePicker.tsx: a "Start from a template" card grid rendered at the top of the guided builder. Clicking a card fills the draft; nothing persists until the user hits Save.
  • i18n: 14 new settings.persona.templates.* chrome keys in en and all 13 locale files (parity 14/14).

Submission Checklist

  • Tests added or updated — personaTemplates.test.ts (role coverage, splice writes Personality/Voice, preserves About-you + unmanaged sections, idempotency) and a PersonaPanel.test.tsx integration test (apply template → Save writes the seeded persona over RPC).
  • Diff coverage ≥ 80% — new module and picker are exercised by the tests above. Please confirm in CI.
  • Coverage matrix updated — N/A: enhances the existing Persona panel; no new feature ID.
  • All affected feature IDs listed under Related — N/A: no matrix feature-behaviour change.
  • No new external network dependencies introduced.
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: additive Settings UI.
  • Linked issue closed via Closes #NNNN/A: intentionally references (does not close) Guided persona builder and memory dashboard for non-technical users #4253; phased delivery keeps the epic open.

Impact

  • Desktop UI only (Settings → Personality, guided mode). No core, schema, or migration changes. Templates produce plain SOUL.md markdown through the same persistence path as PR1.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

Validation Run

  • pnpm --filter openhuman-app format:check — Prettier --check passes locally after the restack on feat(persona): guided persona builder over SOUL.md (#4253, PR1) #4412's formatted base.
  • pnpm typechecktsc --noEmit passes (exit 0).
  • Focused tests — personaTemplates.test.ts + PersonaPanel.test.tsx run green locally; pnpm i18n:check also passes (0 missing/extra across all locales). CI Frontend Checks re-validating the restack.
  • Rust fmt/check (if changed): N/A — no Rust changed
  • Tauri fmt/check (if changed): N/A — no Tauri changed

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: The guided persona builder gains a "Start from a template" row with six role presets.
  • User-visible effect: Non-technical users can seed Personality and Communication style from a role, then edit and save.

Parity Contract

  • Legacy behavior preserved: PR1 guided/advanced editing, Save, Reset, and the About-you section are all intact; templates never overwrite About-you or unmanaged sections.
  • Guard/fallback/dispatch parity checks: Same workspace_file_* RPC; templates emit plain SOUL.md markdown.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): None
  • Canonical PR: This PR
  • Resolution: N/A

Add a structured, non-technical persona editor that maps friendly fields
(Personality, Communication style, About you) to named SOUL.md sections and
splices them in place, keeping SOUL.md the runtime source of truth. Guided is
the default; the raw markdown editor stays behind an Advanced toggle. Reuses
the existing workspace_file_read/write/reset RPC — no core changes.

Part of the phased tinyhumansai#4253 work (PR1 of N).
@M3gA-Mind M3gA-Mind requested a review from a team July 2, 2026 12:09
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7d25e8f-627f-42cf-986a-738f9135f001

📥 Commits

Reviewing files that changed from the base of the PR and between f979bfa and 3cf1b17.

📒 Files selected for processing (22)
  • app/src/components/settings/panels/PersonaPanel.test.tsx
  • app/src/components/settings/panels/PersonaPanel.tsx
  • app/src/components/settings/panels/persona/PersonaGuidedFields.tsx
  • app/src/components/settings/panels/persona/PersonaTemplatePicker.tsx
  • app/src/components/settings/panels/persona/personaSections.test.ts
  • app/src/components/settings/panels/persona/personaSections.ts
  • app/src/components/settings/panels/persona/personaTemplates.test.ts
  • app/src/components/settings/panels/persona/personaTemplates.ts
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/zh-CN.ts
👮 Files not reviewed due to content moderation or server errors (22)
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/pl.ts
  • app/src/components/settings/panels/persona/PersonaTemplatePicker.tsx
  • app/src/components/settings/panels/persona/PersonaGuidedFields.tsx
  • app/src/components/settings/panels/PersonaPanel.tsx
  • app/src/components/settings/panels/PersonaPanel.test.tsx
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/fr.ts
  • app/src/components/settings/panels/persona/personaTemplates.test.ts
  • app/src/components/settings/panels/persona/personaTemplates.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/es.ts
  • app/src/components/settings/panels/persona/personaSections.test.ts
  • app/src/components/settings/panels/persona/personaSections.ts
  • app/src/lib/i18n/zh-CN.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pt.ts

📝 Walkthrough

[!WARNING]

Walkthrough skipped

File diffs could not be summarized.


Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cf1b179ef

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

type="button"
disabled={disabled}
data-testid={`persona-template-${template.id}`}
onClick={() => onChange(applyTemplate(value, template))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the persona capability catalog

This adds a new user-facing Persona template action, but the repo instructions require updating src/openhuman/about_app/ for user-facing features, and catalog_data.rs still describes Persona Pack only as display name/SOUL editing/mascot settings. Any about/help/capability surface backed by that catalog will omit the template workflow, so please extend the Persona Pack catalog entry/tests alongside this UI addition.

Useful? React with 👍 / 👎.

M3gA-Mind added 2 commits July 2, 2026 19:31
Prettier-only formatting of the persona builder components/tests and the
guided-persona i18n key additions across all locale files.
…ansai#4253)

Add six role starting-points (doctor, researcher, executive, teacher,
student, family) to the guided persona builder. Applying a template seeds the
Personality and Communication-style sections of SOUL.md via the existing
splice logic and leaves the user-owned About You section and any hand-written
content untouched — a non-destructive starting point the user edits and saves.

Seed prose is kept as English constants (editable file content, like the
bundled default SOUL.md); only the picker labels/descriptions are localized.

Part of the phased tinyhumansai#4253 work (PR2 of N); stacked on the persona builder.
@M3gA-Mind

Copy link
Copy Markdown
Collaborator Author

Fixed Frontend Checks. The lane failed at format:check (Prettier, 18 files).

Since this PR is stacked on #4412, I rebased it onto #4412's updated (prettier-fixed) head so it shares the same formatted base — resolving one import-ordering conflict in PersonaGuidedFields.tsx (kept both the useSettingsNavigation and new PersonaTemplatePicker imports; the @trivago/prettier-plugin-sort-imports plugin orders them). Then ran prettier --write on this PR's own additions (the template picker component, personaTemplates.ts, and the template-picker i18n key additions across all locales).

Verified locally, all green: prettier --check ., tsc --noEmit, eslint (0 errors), pnpm i18n:check (0 missing / 0 extra across all locales), and the persona/template specs pass (personaTemplates.test.ts, PersonaPanel.test.tsx, personaSections.test.ts). Formatting + rebase only — no behavior change.

Note: force-pushed to restack on the formatted base; will settle once #4412 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant