Commit cba1341
authored
feat(web): make settings an inline route and add the capability pages (#100)
## Related Issue
No issue — this continues the settings/desktop UI work that landed in
#97, and the problem is described below.
## Problem
Settings was a modal. `SettingsDialog.vue` had grown to 1,571 lines
fusing four unrelated jobs — the fixed backdrop and focus trap, its own
tab navigation, ten page bodies, and the derived state each page needed
— behind an interface of 22 props and 12 emits. Because the modal chrome
was welded to the content, the pages could only ever render as an
overlay: opening Settings hid the whole app behind a scrim, including
the sidebar the user had just been navigating.
Three smaller problems came with it:
- The settings surface only exposed appearance, account and connection.
Plugins, skills, subagents, hooks and usage had no UI at all, and
plugins and subagent profiles had no REST surface either — they existed
only over the internal core RPC.
- A disabled skill could not be turned off from anywhere.
- The README had no desktop download badge, and the desktop artifacts
are published to a different repository than the one the README lives
in.
## What changed
**Settings became a route.** `SettingsDialog.vue` is deleted and
replaced by focused modules:
- `composables/useSettingsNav.ts` owns the `SettingsTab` union, the
three nav groups, the active tab, and the guarded lazy loads. Counts
come in as `MaybeRefOrGetter` so it reads live list lengths instead of
duplicating state.
- `components/settings/SettingsNav.vue` renders the nav and is hosted by
the real `Sidebar`.
- `components/settings/SettingsPane.vue` hosts the pages inline in the
content area. No backdrop, nothing `position: fixed`.
- Ten page components under `components/settings/pages/`, each taking
only the props it needs and owning its own derived state.
- `components/settings/ListingRow.vue` and `settings.css` carry the
shared row and rules.
`Sidebar` gained `mode: 'sessions' | 'settings'`. Its header and New
Session button stay mounted in both modes; only the body below swaps.
`ConversationPane` yields the content area to `SettingsPane`. Mobile is
untouched — it stays a sheet.
**Five new settings pages**, plus the backend they needed:
- Skills, with an enable/disable switch. Turning one off writes a
`disabledSkills` config list that `SessionSkillRegistry.register`
filters. That is the single funnel every skill source goes through, so a
disabled skill is invisible to the model, the slash menu and the API
alike — built-ins included.
- Plugins, Subagents, Connectors and Hooks.
- Usage stats: token, session, turn and cost totals with a per-model
share bar.
- `ICatalogService` behind `GET /plugins`, `POST
/plugins/{id}:set-enabled` and `GET /agent-profiles`, with protocol
schemas for each. One service rather than two, because both collections
are global rather than session-scoped.
**Row design** follows a flat, borderless idiom: a leading glyph, the
name and its tags inline, and a right-hand action cluster. Only the row
content fades when an entry is off, so the switch that turns it back on
keeps full contrast.
**Model menu** splits into a model list and an effort list, with the
effort levels derived from the model's declared `supportEfforts`.
**README** gains three desktop download badges in the hero row.
Per-platform counts cannot come from shields.io directly: its asset
wildcards silently report `0` (a tag whose `.dmg` had 39,877 downloads
returns `0` for `*.dmg`), exact asset names embed the version so they
break on every release, and `dynamic/json` rejects every filter
expression. A daily workflow sums the counts from the desktop releases
repo and publishes them as shields `endpoint` documents on the orphan
`badges` branch, which `main`'s protection rules do not block.
### Verification
- `pnpm -C apps/pythinker-web exec vitest run` — 322 passed (58 files)
- `pnpm -C apps/pythinker-web exec vue-tsc --noEmit` — clean
- `pnpm run lint` — 0 errors
- `pnpm run build` — clean
- agent-core, protocol and server suites — green
Every new assertion was proven able to fail by breaking the
implementation it covers and confirming the red before restoring.
### Note for reviewers
The active settings tab now persists across close and reopen. The modal
remounted on every open and reset to General; the composable lives in
`App.vue` and does not. This is a deliberate behaviour change, called
out here rather than buried.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset. — two
`minor` changesets, both listing `@pymodel/pythinker-code`: the changed
packages are all ignored by changesets, but the web app and the server
both ship inside the CLI release artifact, so the CLI is the package
that carries them.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added a routed settings experience for agents, plugins, skills,
subagents, connectors, hooks, usage, account, and advanced options.
- Added plugin enable/disable controls, connector restart actions,
catalog listings, and skill management.
- Added support for disabling selected skills.
- Improved model selection with separate thinking-effort navigation.
- Added desktop download badges for macOS and Windows releases.
- **Improvements**
- Improved dock panel positioning while keeping the message composer
fixed.
- Added clearer loading, empty, status, and error states throughout
settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 2d5691c commit cba1341
52 files changed
Lines changed: 3223 additions & 1254 deletions
File tree
- .changeset
- .github/workflows
- apps/pythinker-web
- src
- api
- daemon
- components
- settings
- pages
- composables
- i18n/locales/en
- test
- packages
- agent-core
- src
- config
- rpc
- services
- catalog
- config
- session
- skill
- test/skill
- protocol/src
- rest
- server
- src
- routes
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
613 | 651 | | |
614 | 652 | | |
615 | 653 | | |
| |||
854 | 892 | | |
855 | 893 | | |
856 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
857 | 898 | | |
858 | 899 | | |
859 | 900 | | |
| |||
866 | 907 | | |
867 | 908 | | |
868 | 909 | | |
| 910 | + | |
869 | 911 | | |
870 | 912 | | |
871 | 913 | | |
| |||
918 | 960 | | |
919 | 961 | | |
920 | 962 | | |
| 963 | + | |
| 964 | + | |
921 | 965 | | |
922 | 966 | | |
923 | 967 | | |
| |||
929 | 973 | | |
930 | 974 | | |
931 | 975 | | |
932 | | - | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
933 | 979 | | |
934 | 980 | | |
935 | 981 | | |
| |||
992 | 1038 | | |
993 | 1039 | | |
994 | 1040 | | |
995 | | - | |
| 1041 | + | |
996 | 1042 | | |
997 | 1043 | | |
998 | 1044 | | |
| |||
1014 | 1060 | | |
1015 | 1061 | | |
1016 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1017 | 1095 | | |
1018 | | - | |
| 1096 | + | |
1019 | 1097 | | |
1020 | 1098 | | |
1021 | 1099 | | |
| |||
1188 | 1266 | | |
1189 | 1267 | | |
1190 | 1268 | | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | 1269 | | |
1217 | 1270 | | |
1218 | 1271 | | |
| |||
0 commit comments