Skip to content

refactor(setup): 以 footerLines 作为唯一 canonical footer 状态 #129

Closed

Description

@tt-a1i

问题

MyPiSetupConfig.ui 同时保存:

  • canonical footerLines;
  • 总是由它派生的 footerItems。

两者同时存在于内存配置、默认值、parse/apply 返回值和持久化 JSON 中,因此每次修改都必须维持同步。生产 UI 实际读取的是 footerLines。

建议范围

  • 运行时配置只保留 footerLines。
  • 新写入的 setup config 不再持久化派生的 footerItems。
  • 读取旧配置时继续接受 legacy footerItems,并在输入边界转换为 footerLines。
  • 若 setup tool 仍需接受平铺选择,将其保持为输入 adapter,而非第二份状态。
  • 更新测试,直接断言 canonical layout 和真实 footer rendering。

兼容后果

需要明确旧版本 OpenPI 读取“只含 footerLines 的新配置”时的降级行为。如果支持向旧版本降级是正式承诺,应提供过渡期或 schema version;否则记录为可接受的 downgrade limitation。

验收标准

  • 内存中的 MyPiSetupConfig.ui 不再同时持有两份 footer 状态。
  • 新配置文件只写 canonical footerLines。
  • 旧的 footerItems-only 配置仍能迁移并保持等价视觉结果。
  • setup tool、状态输出与 footer UI 行为不变。
  • 有旧配置迁移、重复读取和写回幂等测试。
  • bun run check、bun run test 通过。

Activity

  1. added
    enhancement
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions