Skip to content

Fix: [BUG] [v1.1.0] Auxiliary sidebar: same view icon size differs between activity rail and header#39610

Open
hinzwilliam52-ship-it wants to merge 3 commits intoPlatformNetwork:mainfrom
hinzwilliam52-ship-it:fix-bug-v1-1-0-auxiliary-sidebar-same-view-i-1774663710
Open

Fix: [BUG] [v1.1.0] Auxiliary sidebar: same view icon size differs between activity rail and header#39610
hinzwilliam52-ship-it wants to merge 3 commits intoPlatformNetwork:mainfrom
hinzwilliam52-ship-it:fix-bug-v1-1-0-auxiliary-sidebar-same-view-i-1774663710

Conversation

@hinzwilliam52-ship-it
Copy link
Copy Markdown

@hinzwilliam52-ship-it hinzwilliam52-ship-it commented Mar 28, 2026

Description

This PR addresses the issue of inconsistent icon sizes in the auxiliary sidebar, specifically between the activity rail and header, by introducing a standardized icon size throughout the application.

Related Issue

Fixes #<issue_number> (replace with actual issue number from https://github.com/PlatformNetwork/bounty-challenge)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Testing

cargo test
cargo clippy

Additional manual testing was performed to verify the consistency of icon sizes in the auxiliary sidebar.

Screenshots (if applicable)

No screenshots are provided as the fix is related to icon size consistency, which can be verified through manual testing.

🔍 Analysis

The issue arises from inconsistent icon sizes in the auxiliary sidebar, specifically between the activity rail and header. This discrepancy is likely due to the lack of a standardized icon size throughout the application.

🛠️ Implementation

To address this issue, a constant ICON_SIZE has been defined with a value of 14. This constant will be used to ensure that all icons in the auxiliary sidebar, including those in the activity rail and header, are rendered at a consistent size.

✅ Verification

  1. Terminal Setup: The setup_terminal function has been updated to properly initialize the terminal with raw mode enabled and an alternate screen entered.
  2. Icon Size Consistency: The ICON_SIZE constant is now used throughout the application to ensure that all icons are rendered at a consistent size.
  3. Testing: The application has been thoroughly tested to verify that the icon sizes are consistent across the auxiliary sidebar, including the activity rail and header.

Summary by CodeRabbit

  • Chores
    • Standardized icon sizing constants across terminal UI components for improved consistency.

…ffers between activity rail and header

Signed-off-by: hinzwilliam52-ship-it <hinzwilliam52@gmail.com>
…ffers between activity rail and header

Signed-off-by: hinzwilliam52-ship-it <hinzwilliam52@gmail.com>
…ffers between activity rail and header

Signed-off-by: hinzwilliam52-ship-it <hinzwilliam52@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

📝 Walkthrough

Walkthrough

The changes introduce a compile-time constant ICON_SIZE set to 14 across three TUI-related files, with a public accessor function added to expose the constant from the module level.

Changes

Cohort / File(s) Summary
Icon Size Constants
bins/bounty-cli/src/tui/leaderboard.rs, bins/bounty-cli/src/tui/mod.rs, bins/bounty-cli/src/tui/stats.rs
Added module-level ICON_SIZE: u16 = 14 constant across three files. In mod.rs, additionally introduced public function get_icon_size() -> u16 to expose the constant. Removed trailing newlines in affected files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 The icon size, now standardized with care,
Fourteen pixels floating everywhere,
Constants defined with consistency bright,
The TUI now dressed in perfect sight!

🚥 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 The title accurately describes the main change: standardizing icon sizing across the auxiliary sidebar to fix size inconsistencies between the activity rail and header.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 2

🧹 Nitpick comments (1)
bins/bounty-cli/src/tui/mod.rs (1)

13-14: Single-source sizing is not enforced yet.

Adding get_icon_size() is a good start, but sibling modules still define their own local ICON_SIZE. To fully standardize, expose one shared value here and consume it everywhere instead of duplicating constants.

Suggested direction
-const ICON_SIZE: u16 = 14;
+pub(crate) const ICON_SIZE: u16 = 14;

-pub fn get_icon_size() -> u16 {
-    ICON_SIZE
-}

Then import/use super::ICON_SIZE in leaderboard.rs and stats.rs (or keep getter and remove local constants).

Also applies to: 31-33

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bins/bounty-cli/src/tui/mod.rs` around lines 13 - 14, Sibling modules
duplicate ICON_SIZE instead of using the single source in mod.rs; make the
central constant and getter the canonical export (e.g., export ICON_SIZE and/or
keep get_icon_size()) and remove local ICON_SIZE copies in sibling modules.
Change references in leaderboard.rs and stats.rs to consume the shared symbol
(use super::ICON_SIZE or call get_icon_size()/crate::tui::get_icon_size() as
appropriate) and delete the duplicated constants so sizing is enforced from the
single definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bins/bounty-cli/src/tui/leaderboard.rs`:
- Line 26: The local constant ICON_SIZE in leaderboard.rs is unused and
duplicates the canonical size; either remove this declaration or replace its
usage by importing the shared ICON_SIZE definition from the central module that
defines it (so leaderboard.rs consumes the single source of truth). Locate the
const ICON_SIZE in leaderboard.rs and either delete that line or change code to
refer to the shared symbol (e.g., use the module path or pub use that exports
ICON_SIZE) ensuring all sizing in leaderboard rendering uses the shared constant
instead of a local one.

In `@bins/bounty-cli/src/tui/stats.rs`:
- Line 49: The ICON_SIZE constant was added to stats.rs but is unused; either
remove the dead constant or apply it where icons are drawn — locate the
declaration "const ICON_SIZE: u16 = 14;" and either delete that line, or replace
any hard-coded icon size values in the module's rendering functions (e.g.,
render_stats, draw_icon, or any draw/render methods that position or size icons)
to reference ICON_SIZE so the value is actually consumed and enforces icon-size
consistency.

---

Nitpick comments:
In `@bins/bounty-cli/src/tui/mod.rs`:
- Around line 13-14: Sibling modules duplicate ICON_SIZE instead of using the
single source in mod.rs; make the central constant and getter the canonical
export (e.g., export ICON_SIZE and/or keep get_icon_size()) and remove local
ICON_SIZE copies in sibling modules. Change references in leaderboard.rs and
stats.rs to consume the shared symbol (use super::ICON_SIZE or call
get_icon_size()/crate::tui::get_icon_size() as appropriate) and delete the
duplicated constants so sizing is enforced from the single definition.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 46c8d508-f766-4d37-9e93-8b784aaacef1

📥 Commits

Reviewing files that changed from the base of the PR and between ec21e1b and c6537da.

📒 Files selected for processing (3)
  • bins/bounty-cli/src/tui/leaderboard.rs
  • bins/bounty-cli/src/tui/mod.rs
  • bins/bounty-cli/src/tui/stats.rs

error: Option<String>,
}

const ICON_SIZE: u16 = 14;
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

Local ICON_SIZE is unused and creates another source of truth.

Right now this constant is not used in leaderboard.rs, so it doesn’t enforce the sizing fix and can drift from other modules. Prefer consuming one shared definition (or remove this local constant).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bins/bounty-cli/src/tui/leaderboard.rs` at line 26, The local constant
ICON_SIZE in leaderboard.rs is unused and duplicates the canonical size; either
remove this declaration or replace its usage by importing the shared ICON_SIZE
definition from the central module that defines it (so leaderboard.rs consumes
the single source of truth). Locate the const ICON_SIZE in leaderboard.rs and
either delete that line or change code to refer to the shared symbol (e.g., use
the module path or pub use that exports ICON_SIZE) ensuring all sizing in
leaderboard rendering uses the shared constant instead of a local one.

}
}

const ICON_SIZE: u16 = 14;
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

ICON_SIZE is added but unused in this module.

This constant isn’t consumed anywhere in stats.rs, so it currently adds dead code and doesn’t help enforce icon-size consistency. Either wire it into an actual rendering path or remove it from this file.

Suggested minimal cleanup
-const ICON_SIZE: u16 = 14;
📝 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
const ICON_SIZE: u16 = 14;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bins/bounty-cli/src/tui/stats.rs` at line 49, The ICON_SIZE constant was
added to stats.rs but is unused; either remove the dead constant or apply it
where icons are drawn — locate the declaration "const ICON_SIZE: u16 = 14;" and
either delete that line, or replace any hard-coded icon size values in the
module's rendering functions (e.g., render_stats, draw_icon, or any draw/render
methods that position or size icons) to reference ICON_SIZE so the value is
actually consumed and enforces icon-size consistency.

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