Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/parser/orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ pub fn print_orders_table(orders_table: Vec<Event>) -> Result<String> {
Cell::new("πŸ’³ Payment Method")
.add_attribute(Attribute::Bold)
.set_alignment(CellAlignment::Center),
Cell::new("πŸ“Š Premium %")
.add_attribute(Attribute::Bold)
.set_alignment(CellAlignment::Center),
Comment on lines +217 to +219
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

# First, check the file structure and find the relevant files
find . -type f -name "*.rs" | head -20

Repository: MostroP2P/mostro-cli

Length of output: 519


🏁 Script executed:

# Search for SmallOrder definition and premium field
rg -n "struct\s+SmallOrder" --type=rust -A 10

Repository: MostroP2P/mostro-cli

Length of output: 46


🏁 Script executed:

# Check the actual code at lines 217-219 and 276 in src/parser/orders.rs
sed -n '210,225p' src/parser/orders.rs
sed -n '270,285p' src/parser/orders.rs

Repository: MostroP2P/mostro-cli

Length of output: 1501


🏁 Script executed:

# Check Cargo.toml to understand dependencies
cat Cargo.toml | grep -A 5 "mostro_core\|dependencies"

Repository: MostroP2P/mostro-cli

Length of output: 344


🏁 Script executed:

# Search for SmallOrder import in orders.rs
rg -n "use.*SmallOrder|import.*SmallOrder|from.*SmallOrder" src/parser/orders.rs

Repository: MostroP2P/mostro-cli

Length of output: 46


🏁 Script executed:

# Check the beginning of orders.rs file for imports
head -50 src/parser/orders.rs

Repository: MostroP2P/mostro-cli

Length of output: 1497


🏁 Script executed:

# Look for all uses of premium in the file
rg -n "premium" src/parser/orders.rs -B 2 -A 2

Repository: MostroP2P/mostro-cli

Length of output: 637


🏁 Script executed:

# Check if mostro_core exists in workspace or other config files
find . -name "Cargo.toml" -o -name "Cargo.lock" | head -5

Repository: MostroP2P/mostro-cli

Length of output: 89


🏁 Script executed:

# More complete Cargo.toml check
cat Cargo.toml

Repository: MostroP2P/mostro-cli

Length of output: 2641


🏁 Script executed:

# Search for all uses of premium in the entire codebase
rg -n "premium" --type=rust -B 2 -A 2

Repository: MostroP2P/mostro-cli

Length of output: 8831


🏁 Script executed:

# Check nip33.rs to see how order_from_tags works and what premium becomes
find . -name "*.rs" -path "*/nip33*" -o -name "nip33.rs"

Repository: MostroP2P/mostro-cli

Length of output: 78


🏁 Script executed:

# Look for any documentation or examples of premium value formatting
rg -n "Premium|premium" --type=rs -C 3 | head -60

Repository: MostroP2P/mostro-cli

Length of output: 90


🏁 Script executed:

# Check if there are any test files or examples showing premium values
find . -name "*test*" -o -name "*example*" | grep -E "\.(rs|toml)$"

Repository: MostroP2P/mostro-cli

Length of output: 92


Add "%" formatting to premium display to match the header.

The header says "πŸ“Š Premium %" but the row displays single_order.premium.to_string() without the percent symbol. Format it as format!("{}%", single_order.premium) to match the header and be consistent with how premium is displayed elsewhere (e.g., in print_premium() and dispute info).

Also applies to line 276 Same issue at line 276.
πŸ€– Prompt for AI Agents
In `@src/parser/orders.rs` around lines 217 - 219, The header Cell::new("πŸ“Š
Premium %") expects the premium value to include a percent sign but the row
currently uses single_order.premium.to_string(); update the display logic for
the premium column (the code that renders single_order.premium in the rows β€”
also the similar occurrence later in the file) to format the value with a
trailing percent, e.g. use format!("{}%", single_order.premium) so it matches
the header and other places like print_premium() and dispute info.

Cell::new("πŸ“… Created")
.add_attribute(Attribute::Bold)
.set_alignment(CellAlignment::Center),
Expand Down Expand Up @@ -270,6 +273,7 @@ pub fn print_orders_table(orders_table: Vec<Event>) -> Result<String> {
},
Cell::new(single_order.payment_method.to_string())
.set_alignment(CellAlignment::Center),
Cell::new(single_order.premium.to_string()).set_alignment(CellAlignment::Center),
Cell::new(
date.map(|d| d.format("%Y-%m-%d %H:%M").to_string())
.unwrap_or_else(|| "Invalid date".to_string()),
Expand Down