fix(app-iced): 守住 400 行 + 接线计数点跟着语言行搬(M285 门禁红)
- settings/mod.rs 401 → 396 行(压自己新加的文档,不删任何语义): components::gate::every_source_file_stays_under_the_line_limit 红过。 - pages/tests/base_wiring.rs:语言行搬进 general/language.rs 后,`BASE.role()` 的 计数点也要跟着搬(general.rs 0 次 → language.rs 1 次),否则 every_card_internal_control_site_still_passes_a_base 红。计数与语义都没变。
This commit is contained in:
1 parent
20607a0584
commit
e15bd741cd
2 files changed
+12
-17
No files matched your search
@@ -169,13 +169,10 @@ use registry::{AI_GROUP, GENERAL_GROUP, GROUPS, GROUP_LABELS, JAVA_GROUP, SELECT
|
||||
|
||||
/// 这一帧某个控件**实际要画**的交互态:`forced`(`--force-state`)优先,否则退回观测到的 `status`。
|
||||
///
|
||||
/// **全仓唯一的 resolve 点(M285)**:语言档 / 主题档 / 日志 `action_button` / 外观 `choice` 四个站点
|
||||
/// 一律调它。谁在自己那个样式闭包里再写一遍 `unwrap_or_else`,就是把这行语义复制成四份——下一次
|
||||
/// 只改三处就等着漂。
|
||||
///
|
||||
/// 语义与 `pages/instances.rs` 的 `forced_state`(`Button::state(…)`,`Some` 覆盖、`None` 不动)相同;
|
||||
/// 差别只在 iced 的裸 `button` 没有 `.state()`:样式闭包的签名固定收 `button::Status`,所以覆盖只能
|
||||
/// 发生在闭包**里面**(换掉它拿到的那一态),而不是控件上。
|
||||
/// **全仓唯一的 resolve 点(M285)**:语言档 / 主题档 / 日志 `action_button` / 外观 `choice` 一律调它
|
||||
/// ——各自再写一遍 `unwrap_or_else` 就是把同一行语义复制四份,下次只改三处就等着漂。语义与
|
||||
/// `pages/instances.rs` 的 `forced_state` 相同(`Some` 覆盖、`None` 不动),只是裸 `iced::button` 没有
|
||||
/// `.state()`,覆盖只能发生在样式闭包**里面**(换掉它拿到的那一态)。
|
||||
pub(super) fn resolve_state(forced: Option<Interaction>, status: button::Status) -> Interaction {
|
||||
forced.unwrap_or_else(|| Interaction::from_status(status))
|
||||
}
|
||||
@@ -183,10 +180,9 @@ pub(super) fn resolve_state(forced: Option<Interaction>, status: button::Status)
|
||||
/// 把一个 `components::buttons::Button` 钉到 `forced` 那一态(`pages/instances.rs` 的 `forced_state`
|
||||
/// 在设置页的这一份)。
|
||||
///
|
||||
/// **这是第二份,不是抽象**(M285):实例页那条线的控件本身就是 `components::buttons::Button`
|
||||
///(有 `state(Interaction)`),而设置页的 `choice` / `chip` / `action_button` 是裸 `iced::button`——
|
||||
/// 覆盖只能落在样式闭包里(见 [`resolve_state`])。三次法则现在到 2;第三次真出现时落点是
|
||||
/// `components/interaction/`,不是这里。
|
||||
/// **这是第二份,不是抽象**(M285):实例页的控件本身就是 `components::buttons::Button`(有
|
||||
/// `state(Interaction)`),设置页的 `choice` / `chip` / `action_button` 是裸 `iced::button`(走
|
||||
/// [`resolve_state`])。三次法则现在到 2;第三次真出现时落点是 `components/interaction/`,不是这里。
|
||||
pub(super) fn forced_button<'a, M>(
|
||||
button: Button<'a, M>,
|
||||
forced: Option<Interaction>,
|
||||
@@ -227,9 +223,8 @@ impl Default for Language {
|
||||
/// `states` 是「画一帧时那份只读状态」:[`States::appearance`] 是 M93 接进来的外观运行期状态
|
||||
/// (`None` = harness / 演示路径,设置页仍画占位行),[`States::groups`] 是各组自己的状态。
|
||||
///
|
||||
/// `forced` 是 `pages::Model::forced`(`--force-state` 的落点,M285):一路递到各组的控件,由
|
||||
/// [`resolve_state`] 决定「这一帧画哪一态」。`None` = 照旧按控件自己的观测态画——**产品路径恒为
|
||||
/// `None`**(除了取证启动),所以默认行为逐字节不变。
|
||||
/// `forced` 是 `pages::Model::forced`(`--force-state`,M285):一路递给各组控件,由 [`resolve_state`]
|
||||
/// 决定「这一帧画哪一态」。`None` = 照旧按观测态画(产品路径恒为 `None`,取证启动除外)⇒ 默认逐字节不变。
|
||||
pub fn view<'a>(
|
||||
ui: &'a Ui,
|
||||
metrics: FrameMetrics,
|
||||
|
||||
Reference in new issue
Block a user