Skip to content

feat(framework): project-scoped custom presets, shared via the repo (#1025)#1044

Merged
suleimansh merged 2 commits into
mainfrom
feat/1025-project-presets
Jul 22, 2026
Merged

feat(framework): project-scoped custom presets, shared via the repo (#1025)#1044
suleimansh merged 2 commits into
mainfrom
feat/1025-project-presets

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #1025.

What

Custom presets were user-global only (#626): saved to your home config, private, following you everywhere. This adds the project tier the issue asks for, so a preset can be committed into the repo and shared with your team.

When you create a preset with a project open, a "Save to" choice appears:

  • Just me (default) - the existing user-home store, private, on every project.
  • This project - committed into .the-framework/custom-presets.json, so anyone who clones the repo gets it.

Shared presets show under a "Project presets" group in the Presets menu and the / editor menu, and delete from there. No project open = no scope choice (nothing to share into).

How

  • project-presets.ts - readProjectPresets/writeProjectPresets over a committed JSON file, reusing the CustomPreset shape + sanitizeCustomPresets (now exported). Write self-heals .the-framework/.gitignore with a !custom-presets.json negation, since that dir ignores everything but LOGS.md by default.
  • Two telefuncs onProjectPresets/saveProjectPresets, folded into preferences.telefunc.ts (so they auto-register and the Per-project preferences never reach the daemon: the two telefunctions are not registered #866 register test auto-covers them). They resolve the project's own checkout via resolveProjectPath and are gated on contextPreferences() like the other preference RPCs, so a public relay host reads nothing and writes nothing.
  • Client tier in lib/preferences.ts: a per-project presets cache, useProjectPresets(), and saveProjectPresetList(), mirroring the existing project-preferences tier.
  • UI: scope selector in PresetCreatePanel, a "Project presets" group in PresetsMenu (shared SavedPresetRow extracted to avoid duplicating the user group), project-preset: items in the / menu.

Notes for review

  • Committed, not auto-committed. The gitignore negation makes git track the file; it lands in the repo on the next framework commit or a manual git add, like any source file. I did not add a dedicated commit step. Say the word if you want the write to commit itself.
  • Location follows the issue literally (.the-framework/). Open to the-framework.yml instead if you'd rather it sit with the other committed run config.

Tests

  • Framework: 1122 pass / 0 fail (new project-presets.test.ts: missing/malformed reads, round-trip, sanitize, gitignore negation idempotence). Register auto-check confirms both telefuncs registered.
  • Dashboard: 325 pass / 0 fail (new coverage in PresetsMenu.test.tsx + PresetCreatePanel.test.tsx).
  • Both typechecks clean; dashboard build + daemon serve tests green.

…1025)

Custom presets were user-global only (#626): saved to the home config,
private, following you across every project. This adds a project tier so a
preset can be committed into the repo's .the-framework/custom-presets.json
and shared with everyone who clones it.

- New project-presets store (readProjectPresets/writeProjectPresets): a
  committed JSON file reusing the CustomPreset shape and sanitizer, plus a
  self-healing .the-framework/.gitignore negation so git tracks it.
- Two telefuncs (onProjectPresets/saveProjectPresets) resolving the project's
  own checkout, gated like the other preference RPCs so a public relay host
  reads nothing and writes nothing.
- Dashboard: a "Save to" scope choice on the create panel (Just me / This
  project), a "Project presets" group in the Presets menu and the / editor
  menu, each deletable.

Closes #1025
@suleimansh suleimansh self-assigned this Jul 22, 2026
@suleimansh suleimansh added enhancement New feature or request the-framework ♻️ priority: low Nice to have / latent labels Jul 22, 2026
@suleimansh
suleimansh marked this pull request as ready for review July 22, 2026 19:18
…sets

# Conflicts:
#	packages/framework-dashboard/components/Composer.tsx
@suleimansh
suleimansh merged commit d3cd883 into main Jul 22, 2026
2 checks passed
@suleimansh
suleimansh deleted the feat/1025-project-presets branch July 22, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: low Nice to have / latent the-framework ♻️

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Preset, persisted for user or project (or both)

1 participant