dsh-url-router 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/README.md +8 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
- 行选择器或属性一旦改动,必须同步改 `test/client.test.js` 里的假 DOM 用例(假 DOM 已包含 `fakeDom`/`openWithDom`)。
|
|
28
28
|
|
|
29
29
|
- **面板内部页是多段的**:`#/panel/plugins/<包>/<组件>`(每段单独 `encodeURIComponent`,所以原生的 `/` 一定是层级分隔)。钩子分**两组**,不要以为一套通吃:**已安装组** `li[data-plugin-package]` → `[data-plugin-detail]` → `li[data-plugin-row="<kind>:<rowId>"]` → `[data-plugin-row-detail="<包>#<rowId>"]`;**官方组** `li[data-plugin-item="<id>"]` → `[data-plugin-item-detail="<id>"]`(实测:官方项页面**没有** `data-plugin-detail`)。驱动一个段位时先找包行、再找官方行。**钩子有两种拼写**(`#` 与 `:`),解析统一走 `splitRowHook()`,别自己 `split`。
|
|
30
|
+
- **任务看板走它自己的契约**(由用户单仓 `dsh-task-board` 发布):`#/panel/task-board/task/<任务id>` 与 `#/panel/task-board/new`。反映读 `data-dsh-taskboard-open-task` / `data-dsh-taskboard-new-task`;驱动派发同名窗口事件;**表单优先于任务详情**。
|
|
31
|
+
- **观察者的 `attributeFilter` 必须列全所有已发布的页面钩子**:只列 `data-plugin-detail` 曾让任务看板的重试通知饿死(历史 bug,别删名单项)。
|
|
32
|
+
- **未落地的链接要有定时重试**(`LINK_RETRY_MS` = 500ms):只靠 DOM 通知不够,启动后界面会安静下来,一次被吞掉的重试就永远不来了。
|
|
33
|
+
- **切换主面板前先 `beginNavigation()`**(`ctx.layout` 的配套动作,可选面,缺失即跳过)。
|
|
30
34
|
- **链接落地即交权**:视图一旦等于链接描述的界面,链接立刻失去权威(只留"还没落地"的窗口期)。否则用户在面板里继续点进去时,地址栏会被拽回链接那一层(真机踩过:点组件行后又被改回包详情)。
|
|
31
35
|
- **面板行同样是链接**:`data-slot="sidebar.panellist"` 所在的那个 `<button>`(官方侧栏渲染的面板行)会挂上 `href="#/panel/<id>"` 的锚点。**行里没有 id**,id 只能从注册表取:`ctx.slots.entries('sidebar.panellist')` 的 `options.id` / `options.order` / `options.label`;label 可能是**函数**(按语言解析),所以优先按可访问名匹配、数量一致时按 order 对齐,匹配不上一律不碰。
|
|
32
36
|
- **`slots` 必须留在 `inject` 里**:cordis 下读未声明的服务会抛错,而插件激活期的抛错会让整个插件 `failed`(真机事故:面板链接那次就是这么挂的——假 ctx 无条件给服务,单测抓不到,只有真机能抓)。其余可选面(如 `ctx.layout`)一律 `try/catch` 读取。
|
package/README.md
CHANGED
|
@@ -29,10 +29,17 @@ dsh plugin --profile web add dsh-url-router
|
|
|
29
29
|
| `#/panel/plugins/<package>` | an installed plugin's page | the panel's own list row control |
|
|
30
30
|
| `#/panel/plugins/<item>` | a built-in plugin's page (`shell`, `agent-loop`, `subagent`, `web-search`) | the panel's own list row control |
|
|
31
31
|
| `#/panel/plugins/<package>/<component>` | one component page inside that plugin's page | the panel's own component row control |
|
|
32
|
+
| `#/panel/task-board/task/<taskId>` | one task's detail on the task board | the task board's own `dsh-taskboard-open-task` window event |
|
|
33
|
+
| `#/panel/task-board/new` | the task board's new-task form | the task board's own `dsh-taskboard-new-task` window event |
|
|
32
34
|
|
|
33
35
|
Route kinds are owned by this plugin; a kind it does not know (`#/settings/…`) is
|
|
34
36
|
**left alone** with a single diagnostic, so another router can own it later.
|
|
35
37
|
|
|
38
|
+
A panel's inner pages are the panel's own vocabulary, so this plugin never invents one:
|
|
39
|
+
the plugin manager publishes `data-plugin-detail` / `data-plugin-item-detail` /
|
|
40
|
+
`data-plugin-row-detail`, and the task board publishes `data-dsh-taskboard-open-task` /
|
|
41
|
+
`data-dsh-taskboard-new-task` while asking for a task on a window event of the same name.
|
|
42
|
+
|
|
36
43
|
## Row links
|
|
37
44
|
|
|
38
45
|
Every conversation row in the sidebar is exposed as a **real link** — a transparent
|
|
@@ -108,5 +115,6 @@ dsh plugin --profile web add dsh-url-router
|
|
|
108
115
|
## 已知限制
|
|
109
116
|
|
|
110
117
|
- 依赖官方 `ctx.layout.selectPanel` / `panelInfo` 与会话、工作区控制器;形态变了就自我禁用(一条诊断),不改官方行为。
|
|
118
|
+
- **任务看板内部页已纳入**:`#/panel/task-board/task/<任务id>`(任务详情弹层)、`#/panel/task-board/new`(新建任务表单)。这两条靠任务看板自己发布的契约(`data-dsh-taskboard-open-task` / `data-dsh-taskboard-new-task` + 同名窗口事件),本插件不猜它的弹层。
|
|
111
119
|
- **设置页分区暂未纳入**(设置包没有"打开某分区"的接缝;它们是 keyed list slot)。
|
|
112
120
|
- 右栏 pane 能打开(`ISidebarRight.openTab(kind)`),但尚未纳入路由。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-url-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "DSH Web GUI plugin: one URL for every surface — the address bar names what is on screen (a conversation or a main panel) and a link opens it. Single owner of the URL fragment; browser half only, no dependencies, no telemetry.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|