From 9ffe9dfa81406673c580c2cd04782fd0b4fccdf8 Mon Sep 17 00:00:00 2001 From: Shinku <17696928+Shinku-Chen@users.noreply.github.com> Date: Thu, 27 Aug 2026 18:22:36 +0800 Subject: [PATCH] docs(development): keep battery icon clear of the top-right cloud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The battery indicator shows in the top-right by default, but the corner already has a cloud decoration (add_cloud, around x≈188, y≈8). Place the battery in the clear sky space beside or below the cloud, or at the very top-right edge, so it does not overlap or cover the cloud. Documented in agent-guide and coding-conventions in both languages. --- docs/development/agent-guide.md | 2 +- docs/development/agent-guide.zh_CN.md | 2 +- docs/development/coding-conventions.md | 2 +- docs/development/coding-conventions.zh_CN.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/development/agent-guide.md b/docs/development/agent-guide.md index 82f4eae..e05ba0e 100644 --- a/docs/development/agent-guide.md +++ b/docs/development/agent-guide.md @@ -48,7 +48,7 @@ Only reusable hardware capabilities belong in the BSP. Document blocking behavio - Stop tasks and timers that may access a page before deleting its screen. - Preserve menu `UP`/`DOWN`, `OK` click to enter, and page `OK` long-press to return unless the change explicitly redefines them. - When the user asks to remove unnecessary components or go straight into a feature, you may drop the main menu and its elements and launch the target feature screen directly. Keep the `ui_pixel` theme (the sky background, grass, title plate, mascot, and ink-outlined panels) intact — do not delete the theme as part of the cleanup, or the screen will render blank. Reuse `ui_pixel_screen_create()` / `ui_pixel_panel_create()` so the feature keeps the shared visual identity. -- By default show the battery level in the top-right corner of a user interface (read via `bsp_battery_soc()`), unless the developer specifies a different placement or explicitly does not want it. Degrade gracefully when the reading is `-1` (unavailable) instead of drawing a number. +- By default show the battery level in the top-right corner of a user interface (read via `bsp_battery_soc()`), unless the developer specifies a different placement or explicitly does not want it. Degrade gracefully when the reading is `-1` (unavailable) instead of drawing a number. Place it so it does not overlap the cloud decoration (`add_cloud`, around `x≈188, y≈8`) in the top-right; use the clear sky space rather than covering the cloud. - Budget internal RAM for images, fonts, networking, audio, LVGL, and task stacks; this board has no PSRAM. - Isolate testable state machines, protocols, timing, and layout calculations from ESP-IDF/LVGL and cover them with host tests. diff --git a/docs/development/agent-guide.zh_CN.md b/docs/development/agent-guide.zh_CN.md index 5410deb..7af9237 100644 --- a/docs/development/agent-guide.zh_CN.md +++ b/docs/development/agent-guide.zh_CN.md @@ -69,7 +69,7 @@ Natural-language requirement - 页面退出时先停止可能访问 UI 的任务或定时器,再删除 screen 并清空对象指针。 - 全局交互默认是菜单中 `UP`/`DOWN` 导航、`OK` 单击进入、页面中 `OK` 长按返回;改动时要明确说明。 - 当用户要求删除不必要组件或直接进入某功能时,可以去掉主界面及其元素、直接载入目标功能界面;但必须**保留 `ui_pixel` 主题体系**(天空底色、草地、标题牌、吉祥物、墨色描边面板),不要把它当成"不必要组件"删掉,否则界面会渲染成空白。复用 `ui_pixel_screen_create()` / `ui_pixel_panel_create()`,让功能页保持统一的视觉身份。 -- 默认情况下,在用户界面的**右上角显示电量信息**(读取 `bsp_battery_soc()`),除非开发者明确指定其它位置或明确不需要。读值为 `-1`(不可用)时优雅降级,而不是画一个数字。 +- 默认情况下,在用户界面的**右上角显示电量信息**(读取 `bsp_battery_soc()`),除非开发者明确指定其它位置或明确不需要。读值为 `-1`(不可用)时优雅降级,而不是画一个数字。位置要避开右上角已有的**白云装饰**(`add_cloud`,约 `x≈188, y≈8`),用空闲的蓝天区,不要盖住白云。 - 新图片、字体、网络栈、音频缓存、LVGL buffer 或任务栈都要评估内部 RAM;总空闲堆足够不代表存在足够大的连续内存块。 - 可测试的状态机、协议、计时和布局计算应与 ESP-IDF/LVGL 分离,优先加入主机逻辑测试。 diff --git a/docs/development/coding-conventions.md b/docs/development/coding-conventions.md index 0f9b42a..8f9c27d 100644 --- a/docs/development/coding-conventions.md +++ b/docs/development/coding-conventions.md @@ -8,7 +8,7 @@ - Keep UI text and default documentation in English. Explanatory source comments may use Chinese while retaining established English technical terms. - Put reusable hardware behavior in `components/bsp`; keep menus, animations, product interaction, and validation pages in `main`. - The `ui_pixel` theme (sky background, grass, title plate, mascot, ink-outlined panels) is part of the user interface, not a removable component. When trimming components or routing straight to a feature screen, keep the theme and build the screen through `ui_pixel_screen_create()` / `ui_pixel_panel_create()`. -- Show the battery level in the top-right corner of a user interface by default, unless the developer specifies a different placement or explicitly does not want it. Read it from `bsp_battery_soc()` (and `bsp_battery_mv()` where useful); render it as a small battery indicator or percentage in the reserved top-right area of the screen, and degrade gracefully when it reads `-1` (unavailable). +- Show the battery level in the top-right corner of a user interface by default, unless the developer specifies a different placement or explicitly does not want it. Read it from `bsp_battery_soc()` (and `bsp_battery_mv()` where useful); render it as a small battery indicator or percentage in the top-right area of the screen, and degrade gracefully when it reads `-1` (unavailable). Place it where it does not overlap the existing cloud decoration (`add_cloud`, around `x≈188, y≈8`): use the clear sky space beside or below the cloud, or the very top-right edge, rather than covering the cloud. - Document non-trivial functions, state, ownership, blocking behavior, task context, initialization order, failure values, register choices, timing, synchronization, and hardware-specific constants. Explain why, not merely what. - Add or update tests with code changes. If automation is not practical, record the test gap and exact manual validation path. - If adding a cache, define expiration and cleanup unless durable retention is explicitly justified. diff --git a/docs/development/coding-conventions.zh_CN.md b/docs/development/coding-conventions.zh_CN.md index ae9d634..aa70db5 100644 --- a/docs/development/coding-conventions.zh_CN.md +++ b/docs/development/coding-conventions.zh_CN.md @@ -7,7 +7,7 @@ - **语言/风格**:C 用四空格缩进 + K&R 大括号,跟随相邻文件;函数/局部变量 `snake_case`,公开硬件常量 `BSP_*`,文件内状态 `s_` 前缀;BSP API 用 `bsp_` 前缀,demo 入口 `demo__`;内部符号优先 `static`。UI 文案用英文,解释性注释可用中文;保留记录硬件寄存器值与内存约束的注释。 - **复用既有组件**:可复用硬件逻辑放 `components/bsp`;菜单/动画/业务交互/验证页面放 `main`。不要另造轮子,遵循既有 BSP API。 - **主题不是可删组件**:`ui_pixel` 主题体系(天空底色、草地、标题牌、吉祥物、墨色描边面板)属于用户界面的一部分,不是可删除的"不必要组件"。精简组件或直接载入功能界面时,保留该主题,并通过 `ui_pixel_screen_create()` / `ui_pixel_panel_create()` 建屏。 -- **默认右上角电量**:用户界面在没有默认要求的情况下,默认在**右上角显示电量信息**;除非开发者明确指定其它位置或明确不需要。电量读取 `bsp_battery_soc()`(需要时用 `bsp_battery_mv()`),以小型电池图标或百分比呈现在屏幕右上预留区域;读值为 `-1`(不可用)时优雅降级,不要画一个数字。 +- **默认右上角电量**:用户界面在没有默认要求的情况下,默认在**右上角显示电量信息**;除非开发者明确指定其它位置或明确不需要。电量读取 `bsp_battery_soc()`(需要时用 `bsp_battery_mv()`),以小型电池图标或百分比呈现在屏幕右上区域;读值为 `-1`(不可用)时优雅降级,不要画一个数字。**位置不能和右上角已有的白云装饰冲突**(`add_cloud`,约 `x≈188, y≈8`):放在白云旁边或下方的空闲蓝天区,或屏幕最右上边角,不要盖住白云。 - **注释要求(尽可能详细)**:项目源码需要尽可能详细地编写函数说明、变量说明,增加完善的代码注释。 - **函数说明**:每个非平凡函数都要有注释,说明:用途/职责、参数含义、返回值、失败值、副作用、阻塞行为、线程/任务上下文、内存所有权、调用前提与初始化顺序。涉及硬件的函数额外注明寄存器操作、时序约束与已知陷阱。 - **变量说明**:模块级/文件级变量、宏、结构体字段都要有语义注释,说明其用途、取值范围、生命周期/所有权、跨任务共享时的同步要求。硬件常量注释注明来源(数据手册/实测/推导)。