Merge pull request #12 from Corax-CoLAB/palette-ux-improvements-6301678238400810386

🎨 Palette: UX and Accessibility Improvements
pull/12809/head
Corax CoLAB 3 months ago committed by GitHub
commit b4cbea6201
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -195,7 +195,7 @@
</head>
<body>
<button class="theme-toggle" onclick="toggleTheme()" aria-label="Toggle dark mode">
<span class="icon">🌙</span>
<span class="icon" aria-hidden="true">🌙</span>
</button>
<div class="main-container">
@ -206,14 +206,14 @@
<div class="code-container">
<code id="install-cmd">freqtrade install-ui</code>
<button class="copy-btn" onclick="copyCommand()" aria-label="Copy command">Copy</button>
<button class="copy-btn" onclick="copyCommand()" aria-label="Copy command" aria-live="polite">Copy</button>
</div>
<p>Once installed, refresh this page to access the dashboard.</p>
<div class="actions">
<button class="refresh-btn" onclick="refreshPage()">
<span class="icon">🔄</span> Check Again
<button class="refresh-btn" onclick="refreshPage()" aria-busy="false">
<span class="icon" aria-hidden="true">🔄</span> Check Again
</button>
</div>
@ -249,9 +249,10 @@
const btn = document.querySelector('.refresh-btn');
const icon = btn.querySelector('.icon');
btn.disabled = true;
btn.setAttribute('aria-busy', 'true');
icon.style.display = 'inline-block';
icon.style.animation = 'spin 1s linear infinite';
btn.innerHTML = '<span class="icon" style="display:inline-block; animation: spin 1s linear infinite">🔄</span> Checking...';
btn.innerHTML = '<span class="icon" style="display:inline-block; animation: spin 1s linear infinite" aria-hidden="true">🔄</span> Checking...';
setTimeout(() => {
window.location.reload();

@ -638,11 +638,11 @@ class Telegram(RPCHandler):
if float(msg["profit_ratio"]) >= 0.05:
return "\N{ROCKET}"
elif float(msg["profit_ratio"]) >= 0.0:
return "\N{MONEY BAG}"
return "🟢"
elif msg["exit_reason"] == "stop_loss":
return "\N{OCTAGONAL SIGN}"
else:
return "\N{DOWN-POINTING RED TRIANGLE}"
return "🔴"
def _prepare_order_details(self, filled_orders: list, quote_currency: str, is_open: bool):
"""
@ -764,6 +764,7 @@ class Telegram(RPCHandler):
+ f" {profit_emoji} `{format_pct(r['profit_ratio'])}` `({r['profit_abs_r']})`",
f"*Amount:* `{r['amount']} ({r['stake_amount_r']})`"
+ (f" / `{r['max_stake_amount_r']}`" if position_adjust else ""),
" ",
f"*Open:* `{round_value(r['open_rate'], 8)}`",
f"*Current:* `{round_value(r['current_rate'], 8)}`"
if r["is_open"]
@ -771,6 +772,7 @@ class Telegram(RPCHandler):
]
if r["is_open"]:
lines.append(" ")
lines.append(f"*Age:* `{r['open_date_hum']}`")
if r["enter_tag"]:

@ -1,3 +1,4 @@
import math
from collections.abc import Sequence
from typing import Any, TypeAlias
@ -19,10 +20,15 @@ def print_rich_table(
justify="right",
table_kwargs: dict[str, Any] | None = None,
) -> None:
if table_kwargs is None:
table_kwargs = {}
if "row_styles" not in table_kwargs:
table_kwargs["row_styles"] = ["", "dim"]
table = Table(
*[c if isinstance(c, Column) else Column(c, justify=justify) for c in headers],
title=summary,
**(table_kwargs or {}),
**table_kwargs,
)
for row in tabular_data:
@ -43,7 +49,11 @@ def print_rich_table(
def _format_value(value: Any, *, floatfmt: str) -> str:
if value is None:
return "-"
if isinstance(value, float):
if math.isnan(value):
return "-"
return f"{value:{floatfmt}}"
return str(value)
@ -57,7 +67,12 @@ def print_df_rich_table(
index_name: str | None = None,
table_kwargs: dict[str, Any] | None = None,
) -> None:
table = Table(title=summary, **(table_kwargs or {}))
if table_kwargs is None:
table_kwargs = {}
if "row_styles" not in table_kwargs:
table_kwargs["row_styles"] = ["", "dim"]
table = Table(title=summary, **table_kwargs)
if show_index:
index_name = str(index_name) if index_name else tabular_data.index.name

@ -2787,11 +2787,11 @@ def test_send_msg_exit_notification_no_fiat(
[
({"profit_ratio": 0.201, "exit_reason": "roi"}, "\N{ROCKET}"),
({"profit_ratio": 0.051, "exit_reason": "roi"}, "\N{ROCKET}"),
({"profit_ratio": 0.0256, "exit_reason": "roi"}, "\N{MONEY BAG}"),
({"profit_ratio": 0.01, "exit_reason": "roi"}, "\N{MONEY BAG}"),
({"profit_ratio": 0.0, "exit_reason": "roi"}, "\N{MONEY BAG}"),
({"profit_ratio": 0.0256, "exit_reason": "roi"}, "🟢"),
({"profit_ratio": 0.01, "exit_reason": "roi"}, "🟢"),
({"profit_ratio": 0.0, "exit_reason": "roi"}, "🟢"),
({"profit_ratio": -0.05, "exit_reason": "stop_loss"}, "\N{OCTAGONAL SIGN}"),
({"profit_ratio": -0.02, "exit_reason": "sell_signal"}, "\N{DOWN-POINTING RED TRIANGLE}"),
({"profit_ratio": -0.02, "exit_reason": "sell_signal"}, "🔴"),
],
)
def test__exit_emoji(default_conf, mocker, msg, expected):

Loading…
Cancel
Save