Repository navigation
feat: 布局 prop 加 paddingHorizontal / paddingVertical - #10
Conversation
TrendingAI 订阅页的省 x% 角标要横 6 竖 2,四边同值的 padding 表达不了。轴向值覆盖该轴、 缺的轴用 padding(React Native 式级联),三者合成同一个 Modifier.padding,槽位不变。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Sorry @HarlonWang, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 1 day and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
CodeSeer 审查
结论:批准
摘要
本次改动在 Compose 侧将 padding、paddingHorizontal 和 paddingVertical 合成为同一条 Modifier.padding,并在 Kotlin schema、CLI schema 和生成的 TypeScript 类型中同步暴露新 prop。轴向值优先、未指定轴回退到统一 padding 的逻辑与文档描述一致。给出的改动中未发现会影响现有行为的明确问题。
整个 PR 至 8d306c9 · gpt-5.6-terra
审查者指南(小型 PR 中折叠显示)审查者指南新增 paddingHorizontal 和 paddingVertical 布局 prop,贯通 schema、CLI DSL、生成类型与 Compose modifier 实现;轴向值优先覆盖对应方向,缺失方向回退到 padding,并通过节点解析测试及文档同步支持该级联语义。 padding 级联解析流程图flowchart LR
P[padding] --> H{paddingHorizontal exists?}
P --> V{paddingVertical exists?}
H -->|yes| HVAL[horizontal value]
H -->|no| HFALLBACK[use padding]
V -->|yes| VVAL[vertical value]
V -->|no| VFALLBACK[use padding]
HVAL --> M["Modifier.padding(start, top, end, bottom)"]
HFALLBACK --> M
VVAL --> M
VFALLBACK --> M
文件级变更
提示和命令与 Sourcery 交互
自定义使用体验访问你的控制面板以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's Guide新增 paddingHorizontal 和 paddingVertical 布局 prop,贯通 schema、CLI DSL、生成类型与 Compose modifier 实现;轴向值优先覆盖对应方向,缺失方向回退到 padding,并通过节点解析测试及文档同步支持该级联语义。 Flow diagram for cascading padding resolutionflowchart LR
P[padding] --> H{paddingHorizontal exists?}
P --> V{paddingVertical exists?}
H -->|yes| HVAL[horizontal value]
H -->|no| HFALLBACK[use padding]
V -->|yes| VVAL[vertical value]
V -->|no| VFALLBACK[use padding]
HVAL --> M["Modifier.padding(start, top, end, bottom)"]
HFALLBACK --> M
VVAL --> M
VFALLBACK --> M
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
背景
TrendingAI 订阅页的「省 x%」角标是横 6 / 竖 2,四边同值的
padding表达不了(docs/roadmap.md 第 6 项的实战反馈)。改动
paddingHorizontal/paddingVertical:轴向值覆盖该轴,缺的轴用padding(React Native 式级联),三者合成同一个Modifier.padding(start, top, end, bottom),仍在 §2 顺序表第 5 槽位paddingTop等留待需求出现,届时进同一槽位、同一级联;不引入数组形态的padding(components.md §2 已记)验证
pnpm build && pnpm test(41 / 4 / 23)、pnpm schema:check、pnpm typecheck;:compose:testAndroidHostTest(NodeTreeTest 加paddingHorizontal转换断言)、:compose:apiCheck🤖 Generated with Claude Code
Sourcery 总结
支持按轴指定布局内边距,同时保留与现有
padding属性的兼容性。新功能:
增强:
文档:
测试:
Original summary in English
Summary by Sourcery
Support axis-specific layout padding while preserving compatibility with the existing padding property.
New Features:
Enhancements:
Documentation:
Tests: