Skip to content

Add option to hide legend by default via command-line flag or environment variable#15

Merged
sile merged 1 commit intomainfrom
hide-legend-flag
Apr 29, 2025
Merged

Add option to hide legend by default via command-line flag or environment variable#15
sile merged 1 commit intomainfrom
hide-legend-flag

Conversation

@sile
Copy link
Copy Markdown
Owner

@sile sile commented Apr 29, 2025

No description provided.

@sile sile requested a review from Copilot April 29, 2025 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new command-line flag and environment variable to hide the legend by default.

  • Removed automatic default instantiation of LegendWidget in favor of explicit configuration
  • Introduced a new boolean flag "hide-legend" in main.rs and updated App initialization accordingly

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/widget_legend.rs Removed the Default derive from LegendWidget to allow explicit configuration of the hide state
src/main.rs Added flag parsing for "hide-legend" and passed the value to App::new
src/app.rs Modified App::new to accept the hide_legend flag and initialize LegendWidget accordingly
Comments suppressed due to low confidence (2)

src/widget_legend.rs:8

  • [nitpick] Consider renaming 'hide' to 'is_hidden' for clearer semantics regarding its boolean nature.
pub hide: bool,

src/main.rs:15

  • Ensure that the new flag and environment variable behavior is covered by tests, especially to verify the override logic with the environment variable.
let hide_legend = noargs::flag("hide-legend")

@sile sile merged commit f544b4e into main Apr 29, 2025
9 checks passed
@sile sile deleted the hide-legend-flag branch April 29, 2025 09:37
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.

2 participants