Repository navigation
feat: 提交列表日期列支持相对/绝对时间切换(#26) - #27
Merged
KannaKuron merged 1 commit intoNov 5, 2026
Merged
Conversation
- row Config 新增 dateFormat(relative|absolute,默认 relative,声明 volatile) - 设置卡「面板放置」区末尾新增「日期格式」选择行,复用 AI 提交的 select 写路径 - 历史列表日期列按配置渲染:相对(4h/22h)或绝对(同年 11-05 10:42,跨年 2026/11/05 10:42); 绝对模式下 tooltip 补相对时间,列宽 54px → 116px - 21 门词典补齐 3 个键;新增 tests/date-format.test.mjs(formatter 纯函数 / volatile 声明 / 接线 / 键集) - 验证:npm test 141/141 pass(新增 9 条)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26
按 issue 里确认的方向实现(
dateFormat,默认relative,不改变现有行为):改动
src/host/config.js新增shape.dateFormat = schema.string().default('relative').volatile()(按该文件的备忘:client 要写的字段必须volatile(),否则 Host 拒写)。RailSettingsCard的「面板放置」折叠区末尾新增「日期格式」选择行(复用 AI 提交那套selectRow/commitSelectField写路径,写失败会回滚并提示)。放在这个区是因为它和「面板内预览差异」一样属于显示偏好;要独立分区我可以再拆。commitDateText()按配置渲染relative(默认,行为不变):4h/22h;absolute:同年11-05 10:42,跨年2026/11/05 10:42;title变为「完整时间 · 相对时间」,两种读法互补;列宽 54px → 116px(YYYY/MM/DD HH:mm是最宽形态)。tests/date-format.test.mjs(9 条)——formatter 纯函数(同年 / 跨年 / 非法值 / 未知模式 / 默认 now)、dateFormat的 volatile 声明、CommitRow与 App 的接线、绝对模式列宽、21 门词典键集;并把它加进npm test脚本。验证
npm test:141/141 pass(新增 9 条,原有 132 条不动)node --check src/client.js src/host/config.js通过node scripts/ssr-check.mjs在本机跳过(没有 web profile);真机layout-probe我没跑——需要的话我可以起隔离实例补一轮。说明
MM-DD HH:mm、年份只放 tooltip,我按你的意见改。