Skip to content

Conversation

@arkanoider
Copy link
Collaborator

@arkanoider arkanoider commented Jan 17, 2026

Add Premium Column to Orders Table

Summary
Adds the premium percentage column to the listorders command output table for better visibility of order pricing.

Changes

  • Added "📊 Premium %" column to orders table in src/parser/orders.rs
  • Column displays premium values between "Payment Method" and "Created" columns
  • Maintains consistent formatting and alignment with existing table structure

Benefits

  • Users can now see premium percentages directly in the orders list without taking additional actions
  • Improves order comparison and decision-making when browsing available orders
  • Enhances UX by surfacing important pricing information upfront

Testing

  • ✅ Code compiles successfully
  • ✅ No linter errors introduced
  • ✅ Table formatting preserved

Summary by CodeRabbit

New Features

  • Added a "Premium %" column to the orders table displaying premium percentage values for each order.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Walkthrough

Adds a "📊 Premium %" column to the orders table in the print_orders_table function, displaying the premium value for each order with center alignment.

Changes

Cohort / File(s) Summary
Orders table enhancement
src/parser/orders.rs
Added "📊 Premium %" column to table header and populated rows with single_order.premium value, center-aligned

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A column appears, with percentage so fine,
📊 Premium shown in a line,
Data's displayed with center delight,
The table now sparkles, aligned just right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a premium percentage column to the orders table. It is concise, specific, and directly reflects the primary modification in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arkanoider arkanoider changed the title Add premium percentage to listo rders table Add premium percentage to list orders table Jan 17, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/parser/orders.rs`:
- Around line 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.

Comment on lines +217 to +219
Cell::new("📊 Premium %")
.add_attribute(Attribute::Bold)
.set_alignment(CellAlignment::Center),
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.

@arkanoider arkanoider merged commit 2eab773 into main Jan 17, 2026
6 checks passed
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