Repository: tarkah/tickrs (language: rust)

Issue:
UI consistency
Hi @tarkah,

First let me say this is a really cool project and I hope to contribute some effort into it.

At first glance I noticed a few things that seem a bit off:
  - The words in the Toggle box are all capitalized, but things like current price, high, and low are lowercased. The same goes for the words in the Options pane as well. I think there should be some consistency where these words are all capitalized. 
  - The c, h, and l letters do their job. One consistency change would be to spell them out to Current Price, High, Low.
  - In the Toggle box, the 'c' keybind should show the current chart type rather than the next chart type. This would be parity with other trading software.
  - When entering a ticker in lowercase, the ticker shows up in the Tabs section as all lowercased. I think they should be all uppercased.

Most of these are not issues, mostly just personal preferences from what I've seen in other charting software. If these sound like changes you'd like to see, let me know and I'd be happy to submit a PR.


Discussion / hints:
@mandeep Thanks for opening this up. I'd absolutely love the contributions, so feel free! I think these are great suggestions.

If you want to take a stab, here's a few spots to get you started:

- Toggle box is rendered here: https://github.com/tarkah/tickrs/blob/d7c6b54bef11cc03cdcd649466461274eddd9fe3/src/widget/stock.rs#L721
- This is where the add stock symbol is submitted to created a new widget: https://github.com/tarkah/tickrs/blob/d7c6b54bef11cc03cdcd649466461274eddd9fe3/src/widget/add_stock.rs#L43

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index de1088b..b85c3f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,14 @@ and `Removed`.
 - Fixed keybind to correctly capture <kbd>SHIFT</kbd>+<kbd>TAB</kbd> in the
   chart configuration pane
 
+### Changed
+
+- UI changes so that wording is consistent throughout ([#112])
+  - Stock symbols show as uppercase in tabs section
+  - Letters for stock information are now capitalized
+  - Words in Options pane are now capitalized
+  - Toggle box shows the current chart type rather than the next chart type
+
 ## [0.14.0] - 2021-02-26
 
 ### Added
@@ -155,4 +163,5 @@ and `Removed`.
 [#84]: https://github.com/tarkah/tickrs/pull/84
 [#85]: https://github.com/tarkah/tickrs/pull/85
 [#86]: https://github.com/tarkah/tickrs/pull/86
-[#93]: https://github.com/tarkah/tickrs/pull/93
\ No newline at end of file
+[#93]: https://github.com/tarkah/tickrs/pull/93
+[#112]: https://github.com/tarkah/tickrs/pull/112
diff --git a/src/widget/add_stock.rs b/src/widget/add_stock.rs
index 803855c..65d3ae0 100644
--- a/src/widget/add_stock.rs
+++ b/src/widget/add_stock.rs
@@ -40,7 +40,7 @@ impl AddStockState {
     }
 
     pub fn enter(&mut self, chart_type: ChartType) -> super::StockState {
-        super::StockState::new(self.search_string.clone(), chart_type)
+        super::StockState::new(self.search_string.clone().to_ascii_uppercase(), chart_type)
     }
 }
 
diff --git a/src/widget/options.rs b/src/widget/options.rs
index 7e0afa1..ae1f964 100644
--- a/src/widget/options.rs
+++ b/src/widget/options.rs
@@ -453,7 +453,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                         18 - (format!("{}", option.volume.unwrap_or_default()).len() + 7);
                     let gap_open_int =
                         18 - (format!("{}", option.open_interest.unwrap_or_default()).len() + 9);
-                    let gap_impl_vol = 18
+                    let gap_impl_vol = 17
                         - (format!(
                             "{:.0}%",
                             option.implied_volatility.unwrap_or_default() * 100.0
@@ -464,7 +464,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                     let column_0 = vec![
                         Spans::from(Span::styled(
                             format!(
-                                "strike:{}{:.2} {}",
+                                "Strike:{}{:.2} {}",
                                 " ".repeat(gap_strike),
                                 option.strike,
                                 currency
@@ -473,13 +473,13 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                         )),
                         Spans::default(),
                         Spans::from(Span::styled(
-                            format!("price:{}{:.2}", " ".repeat(gap_last), option.last_price,),
+                            format!("Price:{}{:.2}", " ".repeat(gap_last), option.last_price,),
                             style(),
                         )),
                         Spans::default(),
                         Spans::from(Span::styled(
                             format!(
-                                "bid:{}{:.2}",
+                                "Bid:{}{:.2}",
                                 " ".repeat(gap_ask),
                                 option.bid.unwrap_or_default(),
                             ),
@@ -488,7 +488,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                         Spans::default(),
                         Spans::from(Span::styled(
                             format!(
-                                "ask:{}{:.2}",
+                                "Ask:{}{:.2}",
                                 " ".repeat(gap_bid),
                                 option.ask.unwrap_or_default(),
                             ),
@@ -499,7 +499,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                     let column_1 = vec![
                         Spans::from(Span::styled(
                             format!(
-                                "volume:{}{}",
+                                "Volume:{}{}",
                                 " ".repeat(gap_volume),
                                 option.volume.unwrap_or_default(),
                             ),
@@ -508,7 +508,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                         Spans::default(),
                         Spans::from(Span::styled(
                             format!(
-                                "interest:{}{}",
+                                "Open Int:{}{}",
                                 " ".repeat(gap_open_int),
                                 option.open_interest.unwrap_or_default()
                             ),
@@ -517,7 +517,7 @@ impl CachableWidget<OptionsState> for OptionsWidget {
                         Spans::default(),
                         Spans::from(Span::styled(
                             format!(
-                                "volatility:{}{:.0}%",
+                                "Implied Vol:{}{:.0}%",
                                 " ".repeat(gap_impl_vol),
                                 option.implied_volatility.unwrap_or_default() * 100.0
                             ),
diff --git a/src/widget/stock.rs b/src/widget/stock.rs
index b059554..b160928 100644
--- a/src/widget/stock.rs
+++ b/src/widget/stock.rs
@@ -654,7 +654,7 @@ impl CachableWidget<StockState> for StockWidget {
 
             let company_info = vec![
                 Spans::from(vec![
-                    Span::styled("c: ", style()),
+                    Span::styled("C: ", style()),
                     Span::styled(
                         if loaded {
                             format!("{:.2} {}", state.current_price(), currency)
@@ -681,7 +681,7 @@ impl CachableWidget<StockState> for StockWidget {
                     ),
                 ]),
                 Spans::from(vec![
-                    Span::styled("h: ", style()),
+                    Span::styled("H: ", style()),
                     Span::styled(
                         if loaded {
                             format!("{:.2}", high)
@@ -692,7 +692,7 @@ impl CachableWidget<StockState> for StockWidget {
                     ),
                 ]),
                 Spans::from(vec![
-                    Span::styled("l: ", style()),
+                    Span::styled("L: ", style()),
                     Span::styled(
                         if loaded {
                             format!("{:.2}", low)
@@ -704,7 +704,7 @@ impl CachableWidget<StockState> for StockWidget {
                 ]),
                 Spans::default(),
                 Spans::from(vec![
-                    Span::styled("v: ", style()),
+                    Span::styled("Volume: ", style()),
                     Span::styled(
                         if loaded { vol } else { "".to_string() },
                         style().fg(THEME.text_secondary()),
@@ -739,7 +739,7 @@ impl CachableWidget<StockState> for StockWidget {
 
                 if loaded {
                     left_info.push(Spans::from(Span::styled(
-                        format!("{: <8} 'c'", chart_type.toggle().as_str()),
+                        format!("{: <8} 'c'", chart_type.as_str()),
                         style(),
                     )));
 
diff --git a/src/widget/stock_summary.rs b/src/widget/stock_summary.rs
index 9398f39..3262834 100644
--- a/src/widget/stock_summary.rs
+++ b/src/widget/stock_summary.rs
@@ -88,7 +88,7 @@ impl CachableWidget<StockState> for StockSummaryWidget {
 
             let prices = vec![
                 Spans::from(vec![
-                    Span::styled("c: ", style().fg(THEME.text_normal())),
+                    Span::styled("C: ", style().fg(THEME.text_normal())),
                     Span::styled(
                         if loaded {
                             format!("{:.2} {}", state.current_price(), currency)
@@ -101,7 +101,7 @@ impl CachableWidget<StockState> for StockSummaryWidget {
                     ),
                 ]),
                 Spans::from(vec![
-                    Span::styled("h: ", style().fg(THEME.text_normal())),
+                    Span::styled("H: ", style().fg(THEME.text_normal())),
                     Span::styled(
                         if loaded {
                             format!("{:.2}", high)
@@ -112,7 +112,7 @@ impl CachableWidget<StockState> for StockSummaryWidget {
                     ),
                 ]),
                 Spans::from(vec![
-                    Span::styled("l: ", style().fg(THEME.text_normal())),
+                    Span::styled("L: ", style().fg(THEME.text_normal())),
                     Span::styled(
                         if loaded {
                             format!("{:.2}", low)
@@ -124,7 +124,7 @@ impl CachableWidget<StockState> for StockSummaryWidget {
                 ]),
                 Spans::default(),
                 Spans::from(vec![
-                    Span::styled("v: ", style().fg(THEME.text_normal())),
+                    Span::styled("Volume: ", style().fg(THEME.text_normal())),
                     Span::styled(
                         if loaded { vol } else { "".to_string() },
                         style().fg(THEME.text_secondary()),


Test patch: