Skip to content

Filter pre-existing binding variables from status panel#16

Merged
twokidsCarl merged 1 commit intomainfrom
fix/binding-baseline-vars
Apr 8, 2026
Merged

Filter pre-existing binding variables from status panel#16
twokidsCarl merged 1 commit intomainfrom
fix/binding-baseline-vars

Conversation

@twokidsCarl
Copy link
Copy Markdown
Owner

@twokidsCarl twokidsCarl commented Apr 8, 2026

Summary

  • Record baseline local variables (title, content, index, etc.) at TUI init
  • Status panel only shows variables created during the session, not pre-existing ones from caller binding or gem internals

Test plan

  • 98 TUI tests pass
  • Manual: fresh claw session shows empty Binding section (no title/content/etc.)

🤖 Generated with Claude Code

Summary by CodeRabbit

发布说明

  • 新功能

    • 增强变量追踪功能,现在仅显示用户定义的变量,自动排除系统基线变量。
  • 改进

    • 优化调试界面布局展示宽度。
  • 其他

    • 版本更新至构建号 20260407-015。

Record baseline local variables at TUI init and exclude them from
the Binding section in the status panel. Only user-defined variables
(created during the session) are shown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

概览

此变更为 Claw::TUI::Model 类添加了 baseline_vars 属性以追踪初始变量,同时更新状态面板的布局宽度并修改变量渲染逻辑以排除基线变量的显示。版本号 BUILD 常量也相应更新。

变更

组合/文件 摘要
模型基线变量跟踪
lib/claw/tui/model.rb
添加了 baseline_vars 导出读取器属性,在初始化时从 caller_binding.local_variables 计算并存储,采用与 baseline_methods 一致的错误处理模式。
状态面板显示优化
lib/claw/tui/status_panel.rb
调整布局宽度计算(从 width - 4 改为 width - 2),修改"绑定"部分的变量渲染逻辑以排除基线变量,仅显示用户定义的变量。
版本更新
lib/claw/version.rb
更新 BUILD 常量值从 20260407-01420260407-015

估算代码审查工作量

🎯 2 (Simple) | ⏱️ ~12 分钟

可能相关的 PR

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确总结了拉取请求的主要变更:在TUI初始化时记录基线局部变量,并在状态面板中过滤掉这些预先存在的变量。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/binding-baseline-vars

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/claw/version.rb`:
- Line 5: The BUILD constant in lib/claw/version.rb is dated 20260407-015 but
the PR is from 2026-04-08; update the BUILD value to reflect the PR date using
the YYYYMMDD-NNN format and restart the daily sequence at 001 (i.e., change
BUILD to "20260408-001"); ensure you edit the BUILD constant in the Version file
(BUILD in lib/claw/version.rb) accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c9295469-b9e9-4c5b-84f7-c90a87d06983

📥 Commits

Reviewing files that changed from the base of the PR and between 977bdb1 and b706c13.

📒 Files selected for processing (3)
  • lib/claw/tui/model.rb
  • lib/claw/tui/status_panel.rb
  • lib/claw/version.rb

Comment thread lib/claw/version.rb
module Claw
VERSION = "0.2.2"
BUILD = "20260407-014"
BUILD = "20260407-015"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

BUILD 常量日期不匹配

BUILD 常量显示的日期为 20260407(4月7日),但此 PR 是在 2026-04-08 创建的。根据编码规范,BUILD 应该反映代码更改时的日期,并且每天的序列号从 001 开始重新计数。

🔧 建议的修复
-  BUILD = "20260407-015"
+  BUILD = "20260408-001"

基于编码规范:"Increment the BUILD constant in lib/claw/version.rb every time you change code, using format YYYYMMDD-NNN where NNN is a sequential number starting at 001 each day"

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
BUILD = "20260407-015"
BUILD = "20260408-001"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/claw/version.rb` at line 5, The BUILD constant in lib/claw/version.rb is
dated 20260407-015 but the PR is from 2026-04-08; update the BUILD value to
reflect the PR date using the YYYYMMDD-NNN format and restart the daily sequence
at 001 (i.e., change BUILD to "20260408-001"); ensure you edit the BUILD
constant in the Version file (BUILD in lib/claw/version.rb) accordingly.

@twokidsCarl twokidsCarl merged commit 2ca4471 into main Apr 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant