-
Notifications
You must be signed in to change notification settings - Fork 3
Fix/alignment in swap tables #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@greptile review the PR according to the CONTRIBUTION.md |
Greptile OverviewGreptile SummaryThis PR successfully refactors the swap table display logic to use the Key Changes:
Architectural Benefits:
Functional Correctness:
This refactoring addresses issue #45 by fixing table alignment issues and provides a cleaner, more maintainable codebase. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant swap.rs
participant Builder Functions
participant Display Structs
participant tables.rs
participant comfy-table
User->>swap.rs: Execute swap command (take/cancel/withdraw)
swap.rs->>swap.rs: Collect LocalSwapData/LocalCancellableSwap/LocalWithdrawableSwap
swap.rs->>Builder Functions: build_*_displays(local_data)
Builder Functions->>Builder Functions: Format strings (format_settlement_asset, truncate_with_ellipsis, etc.)
Builder Functions->>Display Structs: Create ActiveSwapDisplay/CancellableSwapDisplay/WithdrawableSwapDisplay
Display Structs-->>Builder Functions: Return Vec<DisplayStruct>
Builder Functions-->>swap.rs: Return displays
swap.rs->>tables.rs: display_*_table(displays)
tables.rs->>tables.rs: TableData::get_header()
tables.rs->>tables.rs: TableData::to_row() for each item
tables.rs->>comfy-table: render_table()
comfy-table->>User: Formatted table output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
4c033b0 to
6ef701f
Compare
|
@greptile review the PR according to the CONTRIBUTION.md |
KyrylR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b4009e9
Rework swap table display logic to use the comfy-table crate and move display logic to separate crate
FIx: #45