Skip to content

Conversation

@pythcoiner
Copy link
Collaborator

this is a variant of #1412, it make only signer/key list scrollable instead the whole modal
fixes #1402

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Nov 4, 2024

When first opening the modal, there's a lot empty space below the keys. Is it possible to remove that?

image

@pythcoiner
Copy link
Collaborator Author

pythcoiner commented Nov 4, 2024

hum, the issue is if we define a scrollable w/o height or with Length::Shrink, it will not be scrollable 🥲

One solution is to put a fixed height for the scrollable:

diff --git a/gui/src/installer/view/editor/mod.rs b/gui/src/installer/view/editor/mod.rs
index 3b7bdf9..b3fe63a 100644
--- a/gui/src/installer/view/editor/mod.rs
+++ b/gui/src/installer/view/editor/mod.rs
@@ -327,7 +327,7 @@ pub fn edit_key_modal<'a>(
         )
             .padding(15)
     ;
-    let scroll = scrollable(key_column).height(Length::Fill);
+    let scroll = scrollable(key_column).height(300);
     Column::new()
         .padding(25)
         .push_maybe(error.map(|e| card::error("Failed to import xpub", e.to_string())))

(we can modify this fixed height dynamically, but we need to get the window height, and iirc, should add a subscription to catch the signal...)

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Nov 4, 2024

Perhaps you could you set the height to Length::Fill only if there's at least one non-hot key?

@pythcoiner
Copy link
Collaborator Author

Perhaps you could you set the height to Length::Fill only if there's at least one non-hot key?

done!

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Nov 4, 2024

Unfortunately there's still a problem when an xpub has been entered manually:

image

Maybe this can also be taken into account in the keys length. Or perhaps we can do something simpler for now, such as the fixed height approach you suggested above.

@pythcoiner
Copy link
Collaborator Author

i reduced the number of key to > 1 for trigger the scrollable

@pythcoiner
Copy link
Collaborator Author

or i can put the Key name card in the scrollable and trigger the scroll if more than 3 items into, but i think w/ many keys, user will not see Key name card appear, as it will be in the hidden part of the scrollable....

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Nov 4, 2024

i reduced the number of key to > 1 for trigger the scrollable

The problem still occurs with this condition. It doesn't seem to occur with > 0, but then this gives a lot of empty space when the window is large. Perhaps the fixed height approach would be better? Or otherwise #1412 for now.

or i can put the Key name card in the scrollable and trigger the scroll if more than 3 items into, but i think w/ many keys, user will not see Key name card appear, as it will be in the hidden part of the scrollable....

I agree it's nicer to have the scrollable part only including the keys.

@pythcoiner
Copy link
Collaborator Author

pythcoiner commented Nov 4, 2024

@jp1ac4 wdyt about the last change? (i think it can be better if we auto scroll down when manual inserting an xpub & window minimised - a lot of conditions 😄 - , but it's maybe a bit tricky)

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Nov 4, 2024

Hmm, there's still this problem with having a lot of empty space when the window is large. Even though having only the keys scrollable is preferable, I would go with #1412 for now until we find a better way to manage the height.

@nondiremanuel
Copy link
Collaborator

I agree with going with the simpler solution for now. I will move it to the following milestone in case we want to investigate more on this.

@nondiremanuel nondiremanuel added the GUI gui related label Nov 4, 2024
@pythcoiner pythcoiner marked this pull request as draft November 18, 2024 05:32
@nondiremanuel nondiremanuel added the Nice to have If it's not completed in time for the current version, it can be postponed label Dec 4, 2024
@pythcoiner pythcoiner closed this Jan 17, 2025
@pythcoiner pythcoiner deleted the issue_1402 branch January 17, 2025 02:44
@pythcoiner pythcoiner restored the issue_1402 branch January 17, 2025 13:13
@nondiremanuel nondiremanuel reopened this Jan 17, 2025
@nondiremanuel nondiremanuel removed the Nice to have If it's not completed in time for the current version, it can be postponed label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI gui related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer - "Apply" button sometimes not filled when setting up a key

3 participants