docs: clarify shell observation and window-local tab contracts

This commit is contained in:
2026-11-12 20:58:37 +08:00
parent 2d5138c7ad
commit b15d0872d7
4 changed files with 18 additions and 7 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
//! 发布页面标签的数据结构。保留稳定页面身份、标题、选中状态和开发工具类别;页面的托管所有权由模型层管理。
//!
//! Immutable page registry projections. Host navigation is rendered in sidebar.
//! IDs are session-local data and never own managed VM objects.
//! IDs are local to each window presentation and never own managed VM objects.
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
/// 托管页面注册表的不可变投影,原生工具只使用稳定 ID 与显示元数据。
// ui_bridge::project_tabs 从当前窗口页面注册表生成;sidebar 画标签,scene 用 developer_tool 标记选择宿主管理页。
pub struct Tab {
// 会话内稳定 ID,供原生侧发起切页/关闭操作;不能直接当作 VM 对象地址。
// 当前窗口展示内稳定的 ID,不保证跨窗口唯一;输入还需携带窗口、session 和 layout_version。
// project_tabs 按 Page 弱身份复用 ID;移出窗口后映射删除,再加入时可获得新 ID,不能当作 VM 地址。
pub id: u64,
// 本次发布的标题文本副本,原生界面显示时无需读取 VM。
pub title: String,