fix ui for hunting ground

This commit is contained in:
rizary 2025-07-10 12:55:47 +07:00
parent e5c930c9ff
commit d4dc0ba7cf
Signed by untrusted user who does not match committer: rizary
GPG key ID: 2CE8D69D02F1CEB5
8 changed files with 94 additions and 86 deletions

View file

@ -47,6 +47,13 @@ dev = []
prod = [] prod = []
deep-trace = [] deep-trace = []
[profile.release-with-debug]
inherits = "release"
debug = true
opt-level = 3
lto = true
codegen-units = 1
# Config for 'git cliff' # Config for 'git cliff'
# Run with `GITHUB_TOKEN=$(gh auth token) git cliff --bump -up CHANGELOG.md` # Run with `GITHUB_TOKEN=$(gh auth token) git cliff --bump -up CHANGELOG.md`
# https://git-cliff.org/docs/configuration # https://git-cliff.org/docs/configuration

View file

@ -96,8 +96,8 @@ export component App inherits Window {
retry-connection => { retry-connection => {
root.retry-health-check(); root.retry-health-check();
}
} }
}
// Login Screen // Login Screen
if app-state == "login": VerticalLayout { if app-state == "login": VerticalLayout {
@ -223,36 +223,36 @@ export component App inherits Window {
user-initials: root.user-initials; user-initials: root.user-initials;
logout => { logout => {
root.logout-requested(); root.logout-requested();
}
} }
}
if current-page == "Hunting Ground": HuntingGroundPage { if current-page == "Hunting Ground": HuntingGroundPage {
new-tokens: root.new-tokens; new-tokens: root.new-tokens;
cex-tokens: root.cex-tokens; cex-tokens: root.cex-tokens;
analysis-tokens: root.analysis-tokens; analysis-tokens: root.analysis-tokens;
current-time: root.current-time; current-time: root.current-time;
clear-new-tokens => { clear-new-tokens => {
root.clear-new-tokens(); root.clear-new-tokens();
} }
clear-cex-tokens => { clear-cex-tokens => {
root.clear-cex-tokens(); root.clear-cex-tokens();
} }
clear-analysis-tokens => { clear-analysis-tokens => {
root.clear-analysis-tokens(); root.clear-analysis-tokens();
} }
} }
if current-page == "Trading": TradingPage { if current-page == "Trading": TradingPage {
buy-clicked => { buy-clicked => {
root.buy-clicked(); root.buy-clicked();
}
sell-clicked => {
root.sell-clicked();
}
} }
sell-clicked => {
root.sell-clicked();
}
}
if current-page == "Portfolio": PortfolioPage { if current-page == "Portfolio": PortfolioPage {
} }

View file

@ -89,7 +89,7 @@ export component MainWindow inherits Window {
} }
} }
} }
// App component handles all the UI following FSD layers // App component handles all the UI following FSD layers
App { App {
width: 100%; width: 100%;
@ -110,15 +110,15 @@ export component MainWindow inherits Window {
loading-status: root.loading-status; loading-status: root.loading-status;
// Navigation state // Navigation state
current-page: root.current-page; current-page: root.current-page;
user-initials: root.user-initials; user-initials: root.user-initials;
// Hunting ground properties // Hunting ground properties
new-tokens: root.new-tokens; new-tokens: root.new-tokens;
cex-tokens: root.cex-tokens; cex-tokens: root.cex-tokens;
analysis-tokens: root.analysis-tokens; analysis-tokens: root.analysis-tokens;
current-time: root.current-time; current-time: root.current-time;
// Forward all callbacks to main.rs // Forward all callbacks to main.rs
health-check-completed(healthy) => { health-check-completed(healthy) => {
root.health-check-completed(healthy); root.health-check-completed(healthy);
@ -184,3 +184,4 @@ export component MainWindow inherits Window {
} }
} }
} }

View file

@ -32,49 +32,49 @@ export component Dashboard {
horizontal-alignment: center; horizontal-alignment: center;
vertical-alignment: center; vertical-alignment: center;
} }
} }
// Title // Title
Text { Text {
text: "Dashboard"; text: "Dashboard";
font-size: 48px; font-size: 48px;
font-weight: 700; font-weight: 700;
color: Palette.foreground; color: Palette.foreground;
horizontal-alignment: center; horizontal-alignment: center;
} }
// Coming soon message // Coming soon message
Text { Text {
text: "Coming Soon"; text: "Coming Soon";
font-size: 24px; font-size: 24px;
font-weight: 500; font-weight: 500;
color: Palette.foreground; color: Palette.foreground;
horizontal-alignment: center; horizontal-alignment: center;
} }
// Description // Description
Text { Text {
text: "We're working hard to bring you an amazing dashboard experience.\nCheck back soon for portfolio insights, trading analytics, and more!"; text: "We're working hard to bring you an amazing dashboard experience.\nCheck back soon for portfolio insights, trading analytics, and more!";
font-size: 16px; font-size: 16px;
color: Palette.foreground; color: Palette.foreground;
horizontal-alignment: center; horizontal-alignment: center;
opacity: 0.8; opacity: 0.8;
} }
// Placeholder for future features // Placeholder for future features
Rectangle { Rectangle {
width: 400px; width: 400px;
height: 200px; height: 200px;
background: Palette.alternate-background; background: Palette.alternate-background;
border-radius: 12px; border-radius: 12px;
border-width: 1px; border-width: 1px;
border-color: Palette.border; border-color: Palette.border;
VerticalLayout { VerticalLayout {
alignment: center; alignment: center;
spacing: 10px; spacing: 10px;
Text { Text {
text: "✨ Coming Features:"; text: "✨ Coming Features:";
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
@ -83,14 +83,14 @@ export component Dashboard {
} }
VerticalLayout { VerticalLayout {
spacing: 8px; spacing: 8px;
Text { Text {
text: "• Real-time Portfolio Tracking"; text: "• Real-time Portfolio Tracking";
font-size: 14px; font-size: 14px;
color: Palette.alternate-foreground; color: Palette.alternate-foreground;
horizontal-alignment: center; horizontal-alignment: center;
} }
Text { Text {
text: "• Advanced Trading Analytics"; text: "• Advanced Trading Analytics";

View file

@ -23,23 +23,23 @@ export component HuntingGroundPage {
alignment: start; // Explicitly align to top alignment: start; // Explicitly align to top
padding: 16px; padding: 16px;
spacing: 16px; spacing: 16px;
// Header with refresh button
HorizontalLayout {
alignment: space-between;
Text { // Header with refresh button
text: "🎯 Token Hunting Ground"; HorizontalLayout {
font-size: 28px; alignment: space-between;
font-weight: 700;
Text {
text: "🎯 Token Hunting Ground";
font-size: 28px;
font-weight: 700;
color: Palette.foreground; color: Palette.foreground;
}
} }
}
// Three columns layout using proper Slint responsive layout // Three columns layout using proper Slint responsive layout
HorizontalLayout { HorizontalLayout {
spacing: 16px; spacing: 16px;
padding: 8px; padding: 8px;
min-height: 500px; // Minimum height, but allows growing min-height: 500px; // Minimum height, but allows growing
alignment: stretch; // Stretch children to fill available space alignment: stretch; // Stretch children to fill available space
@ -49,18 +49,18 @@ export component HuntingGroundPage {
tokens: root.new-tokens; tokens: root.new-tokens;
clear-tokens => { clear-tokens => {
root.clear-new-tokens(); root.clear-new-tokens();
} }
} }
// Column 2: CEX Analyst (1/3 responsive width) // Column 2: CEX Analyst (1/3 responsive width)
CexTokensColumn { CexTokensColumn {
horizontal-stretch: 1; // Equal stretch factor for 1/3 width horizontal-stretch: 1; // Equal stretch factor for 1/3 width
tokens: root.cex-tokens; tokens: root.cex-tokens;
clear-tokens => { clear-tokens => {
root.clear-cex-tokens(); root.clear-cex-tokens();
}
} }
}
// Column 3: Analysis Complete (1/3 responsive width) // Column 3: Analysis Complete (1/3 responsive width)
AnalysisCompleteColumn { AnalysisCompleteColumn {
horizontal-stretch: 1; // Equal stretch factor for 1/3 width horizontal-stretch: 1; // Equal stretch factor for 1/3 width

View file

@ -26,7 +26,7 @@ export component LoadingView {
alignment: center; alignment: center;
spacing: 16px; spacing: 16px;
Rectangle { Rectangle {
width: 120px; width: 120px;
height: 120px; height: 120px;
border-radius: 60px; border-radius: 60px;
@ -74,12 +74,12 @@ export component LoadingView {
if is-loading && !has-error: VerticalLayout { if is-loading && !has-error: VerticalLayout {
alignment: center; alignment: center;
spacing: 16px; spacing: 16px;
Text { Text {
text: "Loading Ziya"; text: "Loading Ziya";
font-size: 24px; font-size: 24px;
color: Palette.foreground; color: Palette.foreground;
font-weight: 600; font-weight: 600;
horizontal-alignment: center; horizontal-alignment: center;
} }
@ -88,13 +88,13 @@ export component LoadingView {
width: 200px; width: 200px;
height: 8px; height: 8px;
indeterminate: true; indeterminate: true;
} }
Text { Text {
text: status-text; text: status-text;
font-size: 14px; font-size: 14px;
color: Palette.foreground; color: Palette.foreground;
opacity: 0.7; opacity: 0.7;
horizontal-alignment: center; horizontal-alignment: center;
} }
} }

View file

@ -19,7 +19,7 @@ export component NavigationWidget {
// Right border using a separate rectangle // Right border using a separate rectangle
Rectangle { Rectangle {
width: 1px; width: 1px;
height: 100%; height: 100%;
x: parent.width - 1px; x: parent.width - 1px;
background: Palette.border; background: Palette.border;
} }
@ -126,10 +126,10 @@ export component NavigationWidget {
horizontal-alignment: left; horizontal-alignment: left;
vertical-alignment: center; vertical-alignment: center;
} }
}
} }
} }
}
// User Profile Section - Icon only mode // User Profile Section - Icon only mode
if sidebar-state == "icon-only": Rectangle { if sidebar-state == "icon-only": Rectangle {
height: 48px; height: 48px;
@ -471,15 +471,15 @@ export component NavigationWidget {
spacing: 12px; spacing: 12px;
padding: 12px; padding: 12px;
alignment: start; alignment: start;
Text { Text {
text: "🚪"; text: "🚪";
font-size: 20px; font-size: 20px;
vertical-alignment: center; vertical-alignment: center;
} }
Text { Text {
text: "Logout"; text: "Logout";
color: Palette.alternate-foreground; color: Palette.alternate-foreground;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;

View file

@ -99,7 +99,7 @@ export component TitleBar {
} }
theme-touch-area := TouchArea { theme-touch-area := TouchArea {
clicked => { clicked => {
root.toggle-theme(); root.toggle-theme();
} }
} }