-
Notifications
You must be signed in to change notification settings - Fork 11
feat(restore): recover orders and disputes from Mostro via Settings #114
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
Open
amuntri
wants to merge
6
commits into
MostroP2P:main
Choose a base branch
from
amuntri:feat/restore-session
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+711
−6
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
94516d9
feat(restore): recover orders and disputes from Mostro via Settings
amuntri 1d16b74
fix(restore): address review — sender check, role inference, UI resync
amuntri 81b38ce
fix(ui): size the operation-result popup from the real terminal width
amuntri c26e5cd
fix(restore): actually send SessionRestored from the restore task
amuntri b1ee226
fix(restore): data-integrity hardening from review
amuntri 470079e
feat(restore): log the request and the outcome
amuntri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Make the restore UI usable on short and narrow terminals.
The added restore-session text can wrap or clip in small terminal sizes, leaving lower help entries, the close hint, or parts of the confirmation prompt unreachable or unreadable. Add scrolling, paging, or a compact wrapped layout, and add
TestBackendcoverage at 40×12 and 40×24 to preserve the restore entry, prompt, controls, and close hint.📍 Affects 2 files
src/ui/help_popup.rs#L286-L289(this comment)src/ui/draw.rs#L350-L358🤖 Prompt for AI Agents
Source: Coding guidelines
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.
Respectfully deferring this one as out of scope. The constraint is pre-existing:
render_settings_instructions_popupalready sizes to (nearly) full viewport height with wrapping precisely for short terminals (see the comment at the popup-height calculation), and it has never had scrolling — the admin list already renders 9 entries plus intro and close hint. This PR adds one row to the user list; scroll/paging for the settings popups would be a layout change affecting every entry, not just this one, and deserves its own PR againstmain. Same applies torender_admin_key_confirm_with_message, which is the shared renderer for ~10 confirmation popups.If the maintainers agree, I can open a follow-up issue for scrollable settings/help popups with TestBackend coverage at 40×12 / 40×24.
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.
@amuntri, thanks for the scope clarification.The short-terminal limitation is pre-existing and affects shared popup renderers. A focused follow-up against
mainis appropriate. The finding remains valid under the TUI layout guideline, but it does not need to block this session-restoration PR.Would you like me to open and assign a GitHub follow-up issue to you? The issue can cover scrollable or compact settings/help popups, shared confirmation popups, and
TestBackendcoverage at 40×12 and 40×24.🐇
🧠 Learnings used
You are interacting with an AI system.
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.
Yes, please open the follow-up issue and assign it to me — scrollable/compact settings and help popups plus the shared confirmation renderer, with TestBackend coverage at 40×12 and 40×24. Note the operation-result popup half of the original finding is already fixed in this PR (
81b38ce).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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 4138
@amuntri, I created and assigned follow-up issue#116: Make shared TUI popups usable on narrow and short terminals.The issue covers the Settings/help popups, shared confirmation renderer, and
TestBackendcoverage at 40×12 and 40×24. It excludes theOperationResultpopup work fixed in81b38ce.🧬 Code Graph Analysis Results
src/ui/help_popup.rsrender_help_popuprenders context-sensitive help popups. It selects compact full-height layout for Disputes In Progress and My Trades, applies wrapping, and renders shortcut lines plus close hints.render_settings_instructions_popuprenders the complete role-specific Settings help popup using a centered, nearly full-height layout with wrapped text.settings_instruction_block_styledefines shared bold primary-color title styling and gray body styling for compact instruction rows.help_disputes_in_progress_introandhelp_my_trades_introprovide compact-popup introductory navigation text.help_shortcut_linesplitsKey: descriptionstrings into styled shortcut and description spans for compact help popups.push_settings_instruction_lineappends a styled, wrapped Settings instruction row to a popup line collection.settings_instruction_linesbuilds role-specific Settings popup content. It returns the popup title and all Admin or User menu entries, including descriptions of persistence, confirmation, and failure behavior.help_contentsupplies tab-specific help titles and shortcut text. Disputes In Progress content depends on the selected dispute’s finalized state and current filter; My Trades includes navigation, operation, dispute, attachment, retry, and help shortcuts.🧠 Learnings used
You are interacting with an AI system.