Skip to content

fix(windows): widen floating stats window instead of truncating values - #147

Merged
debugtheworldbot merged 1 commit into
mainfrom
fix/windows-floating-stats-auto-width
Oct 3, 2026
Merged

debugtheworldbot merged 1 commit into
mainfrom
fix/windows-floating-stats-auto-width

Conversation

@debugtheworldbot

Copy link
Copy Markdown
Owner

Summary

  • Windows 悬浮窗宽度固定(双行 32px @12pt),数值达到 6 位字符(如 123.4k)时被省略为 12…。改为宽度随内容自适应,不再截断。
  • 数值 ≥ 999,950 时直接显示为 1.0M,避免出现 1000.0k。

Closes #145

Changes

  • FloatingStatsWindow.xaml:SizeToContent="Width",移除 TextTrimming;单行布局两列改为 Auto + SharedSizeGroup,保持等宽、分隔线居中。
  • FloatingStatsWindow.xaml.cs:原固定宽度改为 MinWidth(小数值时外观不变);新增 OnSizeChanged,窗口位于屏幕右半边时加宽保持右边缘不动,并重新 clamp/保存位置;位置计算改用 ActualWidth。
  • StatsManager.FormatNumber:M 单位阈值调整为 999,950。

Test plan

  • Windows 上编译通过(作者本地无 dotnet,未编译)
  • 双行模式 12pt:12.3k 不变宽,123.4k 加宽且不截断,右边缘不动
  • 单行模式同上,左右两列等宽
  • 调整字号、切换布局、拖动并重启后位置正常、不出屏
  • 999,950 起显示 1.0M

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 2, 2026 15:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T15:16:56.601416Z 588ca05 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Windows compilation and runtime validation are still needed for resizing, layout switching, and multi-monitor positioning.

Review effort: Balanced
Findings: None

What changed in this PR

Makes the Windows floating statistics window widen to show full values, addressing #145.

Changes:

  • Sizes the window to content and keeps single-row columns equal.
  • Preserves the right edge during resizing and clamps the window to the screen.
  • Displays 1.0M from 999,950 instead of 1000.0k.
File Description
KeyStats.Windows/​KeyStats/​Views/​FloatingStatsWindow.xaml.cs Handles adaptive sizing and position preservation.
KeyStats.Windows/​KeyStats/​Views/​FloatingStatsWindow.xaml Removes truncation and enables content-sized width.
KeyStats.Windows/​KeyStats/​Services/​StatsManager.cs Adjusts the million-unit formatting threshold.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@debugtheworldbot
debugtheworldbot merged commit 801dec2 into main Oct 3, 2026
2 checks passed
@debugtheworldbot
debugtheworldbot deleted the fix/windows-floating-stats-auto-width branch October 3, 2026 03:36
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.

[Suggestion] 悬浮窗文字过长时使悬浮窗变长而不是省略数字

2 participants