suzmii
f94946ef8e
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
feat(游戏共创): 注册并处理 Fork 深链 genarrative://fork?gameId=…
冻结约定:`genarrative://fork?gameId=<gameId>`,同时接受 `genarrative://fork/<gameId>`。
方案(用官方两个插件,不手搓单实例与注册表):
- `tauri-plugin-single-instance`(开 `deep-link` feature)**第一个注册**:Windows/Linux 上深链是
「带 URL 启动第二个进程」,该插件把第二个实例的 argv 转交给已有实例,并(feature 生效时)
交给 deep-link 插件发事件——否则用户点第二次链接会再开一个窗口。macOS 上它用 Unix socket
做同样的收口(系统本身也只会有一个 .app 实例)。
- `tauri-plugin-deep-link`:`tauri.conf.json > plugins.deep-link.desktop.schemes = ["genarrative"]`。
· macOS:打包器按该配置往 `Info.plist` 注入 `CFBundleURLTypes`(插件 `config.rs` 里那句
`// Used in tauri-bundler` 是代码级证据),运行时由系统把 URL 交给已运行的 .app。
· Windows:运行时 `register_all()` 写 `HKCU\Software\Classes\genarrative`(`URL Protocol` 标记 +
`DefaultIcon` + `shell\open\command`,不需要管理员);安装器侧同样按该配置注册。
· Linux:运行时写用户级 `applications/<exe>-handler.desktop` 并调 xdg-mime(AGC 未以此平台分发,
但仍走同一条运行时路径)。
- 冷启动:插件在插件初始化阶段就解析 argv 并暂存,而应用 `setup` 晚于插件,因此
`initialize_fork_deep_link` **先取 `get_current()`**、再 `on_open_url` 订阅后续链接(漏了前者会
丢冷启动那一次)。
- 收到 URL 后:聚焦主窗口(unminimize + show + set_focus)→ 发 `game-fork-deep-link` 事件
`{ gameId | message }` → 渲染层把请求存进 store 并切回首页;**不自动下载**,用户按
「Fork 到我的项目」才走与手工输入完全相同的提交路径。正停在项目工作区时不强行切走
(避免把用户从进行中的项目里踢出来),请求留在 store 里等用户回到首页。
- 非法链接:解析出可读原因(空链接 / 非 genarrative 方案 / 非 fork 形式 / 缺 gameId / gameId 不合法)
一并聚焦窗口并交给渲染层展示,不做静默失败。
测试:`fork_game_id_from_deep_link` 的合法(两种形式、大小写、多余参数、game_id/id 别名)与
非法(空、错方案、错形式、缺 gameId、`../escape`、URL 编码斜杠、非 URL)各一组;`gameId` 形状
判据与取件路径共用(`is_safe_fork_game_id`);TS 侧覆盖载荷解析、订阅映射、深链预填后**不自动
下载**、非法链接展示原因且不请求。
2026-10-06 01:05:04 +08:00
..
2026-10-05 00:55:29 +08:00
2026-10-03 20:19:45 +08:00
2026-10-04 00:38:06 +08:00
2026-09-24 11:47:32 +08:00
2026-09-18 14:34:10 +08:00
2026-09-21 21:09:34 +08:00
2026-09-21 21:09:34 +08:00
2026-10-02 15:14:34 +08:00
2026-09-28 14:15:02 +08:00
2026-09-28 14:15:02 +08:00
2026-08-20 19:07:25 +08:00
2026-09-19 01:28:27 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-10-02 17:54:10 +08:00
2026-09-24 16:56:49 +08:00
2026-10-02 18:10:17 +08:00
2026-10-03 20:19:45 +08:00
2026-09-30 14:07:25 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-09-14 13:56:56 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-08-20 19:07:25 +08:00
2026-10-02 12:08:26 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-09-17 17:56:53 +08:00
2026-10-03 17:41:30 +08:00
2026-10-05 15:35:55 +08:00
2026-09-19 15:08:31 +08:00
2026-09-19 15:08:31 +08:00
2026-10-03 17:41:30 +08:00
2026-09-22 16:45:29 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-30 13:11:45 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 13:42:40 +08:00
2026-10-03 19:21:18 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 21:09:34 +08:00
2026-09-28 14:15:02 +08:00
2026-10-03 20:19:45 +08:00
2026-09-07 15:17:21 +08:00
2026-08-20 19:07:25 +08:00
2026-09-17 17:56:53 +08:00
2026-10-05 17:30:49 +08:00
2026-10-04 00:24:45 +08:00
2026-10-06 00:55:53 +08:00
2026-10-01 16:30:40 +08:00
2026-10-04 00:24:45 +08:00
2026-10-04 14:04:02 +08:00
2026-10-02 13:07:00 +08:00
2026-10-04 16:59:59 +08:00
2026-09-15 12:14:03 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-09-29 19:35:49 +08:00
2026-09-23 18:38:47 +08:00
2026-10-05 17:08:03 +08:00
2026-09-28 15:07:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-06 01:05:04 +08:00
2026-10-06 00:55:53 +08:00
2026-10-03 17:41:30 +08:00
2026-09-28 14:15:02 +08:00
2026-10-03 17:41:30 +08:00
2026-09-13 14:48:55 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-09-22 15:35:51 +08:00
2026-10-03 17:41:30 +08:00
2026-09-10 18:48:56 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 03:48:40 +08:00
2026-10-03 20:19:45 +08:00
2026-10-04 16:59:59 +08:00
2026-09-15 10:37:47 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-10-04 15:13:31 +08:00
2026-10-03 20:19:45 +08:00
2026-08-20 19:07:25 +08:00
2026-10-03 20:19:45 +08:00
2026-09-14 13:19:13 +08:00
2026-10-03 20:19:45 +08:00
2026-09-23 11:12:39 +08:00
2026-09-21 01:23:35 +08:00
2026-09-12 20:49:03 +08:00
2026-10-03 20:19:45 +08:00
2026-09-19 01:50:09 +08:00
2026-09-14 11:32:17 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-09 16:09:39 +08:00
2026-09-21 22:56:32 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-12 20:49:03 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 11:58:13 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 01:33:06 +08:00
2026-10-04 00:38:06 +08:00
2026-09-19 21:59:44 +08:00
2026-09-11 21:31:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-20 23:32:09 +08:00
2026-10-02 18:10:17 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-09-21 12:34:47 +08:00
2026-10-04 17:14:26 +08:00
2026-09-21 11:58:13 +08:00
2026-09-17 17:47:11 +08:00
2026-09-11 16:42:40 +08:00
2026-07-31 12:00:48 +08:00
2026-10-04 13:11:37 +08:00
2026-10-03 20:19:45 +08:00
2026-09-19 01:50:09 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 01:23:35 +08:00
2026-09-12 20:49:03 +08:00
2026-10-03 17:41:30 +08:00
2026-10-04 14:04:02 +08:00
2026-09-21 01:23:35 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-09-21 06:21:19 +08:00
2026-09-21 01:23:35 +08:00
2026-09-19 01:50:09 +08:00
2026-10-03 17:41:30 +08:00
2026-08-12 10:54:16 +08:00
2026-10-03 17:41:30 +08:00
2026-09-16 03:59:27 +08:00
2026-09-16 17:39:23 +08:00
2026-09-20 17:36:02 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-28 14:15:02 +08:00
2026-09-11 20:29:45 +08:00
2026-09-17 19:01:35 +08:00
2026-10-03 20:19:45 +08:00
2026-09-19 01:28:27 +08:00
2026-09-19 01:28:27 +08:00
2026-09-20 17:36:02 +08:00
2026-10-03 20:19:45 +08:00
2026-10-02 22:24:00 +08:00
2026-09-21 21:09:34 +08:00
2026-08-12 13:14:55 +08:00
2026-10-03 20:19:45 +08:00
2026-09-21 01:23:35 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-10-04 17:14:26 +08:00
2026-10-04 15:56:41 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-10-04 14:48:28 +08:00
2026-10-05 17:08:03 +08:00
2026-10-04 20:50:26 +08:00
2026-09-23 00:09:12 +08:00
2026-09-16 05:42:20 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-09-13 14:07:03 +08:00
2026-07-30 18:01:19 +08:00
2026-07-30 18:01:19 +08:00
2026-10-03 17:41:30 +08:00
2026-09-20 14:49:57 +08:00
2026-10-03 20:19:45 +08:00
2026-09-23 16:51:15 +08:00
2026-09-23 16:51:15 +08:00
2026-10-03 17:41:30 +08:00
2026-09-23 19:05:33 +08:00
2026-09-03 19:36:18 +08:00
2026-10-03 17:41:30 +08:00
2026-08-20 19:07:25 +08:00
2026-08-20 19:07:25 +08:00
2026-09-24 16:04:29 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-08-20 19:07:25 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 17:41:30 +08:00
2026-10-02 13:48:26 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 17:41:30 +08:00
2026-10-03 20:19:45 +08:00
2026-10-03 20:19:45 +08:00
2026-09-20 17:36:02 +08:00
2026-10-03 17:41:30 +08:00
2026-09-28 14:15:02 +08:00
2026-10-05 15:35:55 +08:00
2026-09-23 19:05:33 +08:00
2026-09-19 15:08:31 +08:00
2026-10-03 17:41:30 +08:00
2026-10-04 14:04:02 +08:00
2026-09-24 16:25:21 +08:00
2026-10-03 20:19:45 +08:00
2026-10-05 15:35:55 +08:00