Compare commits

..
2 Commits
Author SHA1 Message Date
Ansho Rei c6944041ea fix: release the screensaver when leaving the last server while playing
Leaving the browsed server for the login screen stopped the player but
never updated the screensaver inhibit, and stop_player drops the events
that would have. The playback reset from switch_server is now a helper
that also syncs the inhibit, used for both paths, so logging in again
starts without the old queue's pause, position or restore state.

Bumps the version to 0.10.2.
2026-11-06 23:44:50 +01:00
Ansho Rei f03374b585 feat: replace the login screen's Exit button with an X in the corner
The full-width button under Connect took a row in a card that is close
to filling an 800 px high screen. The X is a focus stop between the
saved servers and the address field, so Up from the address field still
reaches it from a controller.

Bumps the version to 0.10.1.
2026-11-06 23:35:37 +01:00
6 changed files with 86 additions and 51 deletions
+12
View File
@@ -2,6 +2,18 @@
One section per version, newest first.
## v0.10.2 (2026-11-06)
### Bug fixes
- Leaving the last logged-in server while music plays, by logging out, forgetting it or a turned-down saved login, lets the screensaver run again on the login screen. Logging in after that starts with no leftover pause, position or restore state from the old queue.
## v0.10.1 (2026-11-06)
### Features
- Exit on the login screen is an X in the top right corner of the card instead of a button under Connect, which makes the card shorter. Up from the address field reaches it on a controller. When adding a server it cancels, as the button did.
## v0.10.0 (2026-11-06)
### Features
Generated
+1 -1
View File
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "remus"
version = "0.10.0"
version = "0.10.2"
dependencies = [
"anyhow",
"directories",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "remus"
version = "0.10.0"
version = "0.10.2"
edition = "2024"
license = "MIT"
@@ -20,6 +20,8 @@
</supports>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.10.2" date="2026-11-06"/>
<release version="0.10.1" date="2026-11-06"/>
<release version="0.10.0" date="2026-11-06"/>
<release version="0.9.1" date="2026-11-06"/>
<release version="0.9.0" date="2026-11-05"/>
+44 -33
View File
@@ -584,15 +584,15 @@ impl App {
self.set_area(area);
}
/// 0 to 2 are the fields and 3 and 4 the buttons. Below 0 are the saved
/// servers in the card beside the form, from the top one at -n to the
/// bottom one at -1, so Up from the address field reaches the list.
/// Top to bottom: the saved servers in the card beside the form, from
/// -n-1 to -2; the X in the form's corner at -1; the fields 0 to 2; and
/// Connect at 3. So Up from the address field reaches the X, then the list.
fn set_login_focus(&mut self, i: i32) {
let known = self.logins.servers.len() as i32;
self.login_focus = i.clamp(-known, 4);
self.login_focus = i.clamp(-known - 1, 3);
self.ui.set_login_focus(self.login_focus);
self.ui.set_login_known_selected(if self.login_focus < 0 {
known + self.login_focus
self.ui.set_login_known_selected(if self.login_focus < -1 {
known + 1 + self.login_focus
} else {
-1
});
@@ -606,16 +606,16 @@ impl App {
Action::Down | Action::SectionNext => self.set_login_focus(self.login_focus + 1),
// Across to the saved servers and back. A text field keeps Left
// and Right on a keyboard for its cursor.
Action::Left if self.login_focus >= 0 && !self.logins.servers.is_empty() => {
self.set_login_focus(-(self.logins.servers.len() as i32))
Action::Left if self.login_focus >= -1 && !self.logins.servers.is_empty() => {
self.set_login_focus(-(self.logins.servers.len() as i32) - 1)
}
Action::Right if self.login_focus < 0 => self.set_login_focus(0),
Action::Activate if self.login_focus < 0 => {
self.pick_known((self.logins.servers.len() as i32 + self.login_focus) as usize)
Action::Right if self.login_focus < -1 => self.set_login_focus(0),
Action::Activate if self.login_focus < -1 => {
self.pick_known((self.logins.servers.len() as i32 + 1 + self.login_focus) as usize)
}
Action::Activate if self.login_focus == -1 && self.client.is_some() => self.cancel_login(),
Action::Activate if self.login_focus == -1 => self.action(Action::Quit),
Action::Activate if self.login_focus < 2 => self.set_login_focus(self.login_focus + 1),
Action::Activate if self.login_focus == 4 && self.client.is_some() => self.cancel_login(),
Action::Activate if self.login_focus == 4 => self.action(Action::Quit),
Action::Activate => self.login_submit(),
Action::Back => self.cancel_login(),
// The face button that queues elsewhere; a keyboard types into
@@ -704,19 +704,7 @@ impl App {
fn switch_server(&mut self, client: Client) {
if self.client.is_some() {
self.save_queue();
self.stop_player();
self.clear_queue();
self.queue_sel = 0;
self.position = 0.0;
self.duration = 0.0;
self.paused = false;
self.held = false;
self.scrobbled = false;
self.now_playing_due = false;
self.restoring = None;
self.art_shown = None;
self.flip_timer.stop();
self.ui.set_np_flip_out(false);
self.reset_playback();
}
log::info!("browsing {} on {}", client.user(), client.base());
self.enter_browse(client);
@@ -725,6 +713,30 @@ impl App {
self.sync_inhibit();
}
/// Stops the player and empties the queue with everything kept about it,
/// so the next server starts clean. The player's own events would
/// otherwise update the screen and the screensaver inhibit, but
/// stop_player drops them, so both are done here.
fn reset_playback(&mut self) {
self.stop_player();
self.clear_queue();
self.queue_sel = 0;
self.position = 0.0;
self.duration = 0.0;
self.paused = false;
self.held = false;
self.scrobbled = false;
self.now_playing_due = false;
self.restoring = None;
self.art_shown = None;
self.art_waiting = false;
self.flip_timer.stop();
self.ui.set_np_flip_out(false);
self.render_player();
self.sync_queue(true);
self.sync_inhibit();
}
fn clear_queue(&mut self) {
self.queue.clear();
self.order.clear();
@@ -910,11 +922,9 @@ impl App {
if keep_queue {
self.save_queue();
}
self.stop_player();
self.clear_queue();
self.reset_playback();
self.client = None;
self.checking_login = false;
self.render_player();
}
/// The server turned down the saved login of the browsed server: log it
@@ -2051,10 +2061,10 @@ impl App {
Screen::Login => {
let adding = self.client.is_some();
let label = match self.login_focus {
..0 => "Use this server",
..-1 => "Use this server",
-1 if adding => "Cancel",
-1 => "Exit",
0 | 1 => "Next",
4 if adding => "Cancel",
4 => "Exit",
_ => "Connect",
};
h(Control::Activate, label);
@@ -2062,7 +2072,8 @@ impl App {
let shown = self.ui.get_login_password_shown();
h(Control::Queue, if shown { "Hide password" } else { "Show password" });
}
if adding {
// Already the activate hint while the X has focus.
if adding && self.login_focus != -1 {
h(Control::Back, "Cancel");
}
}
+26 -16
View File
@@ -1101,21 +1101,6 @@ component LoginView inherits Rectangle {
clicked => { root.submit(); }
}
}
// Secondary to Connect: outlined, no fill, and only lit when focused.
Rectangle {
height: 46px * Theme.s;
border-radius: 12px * Theme.s;
border-width: 2px * Theme.s;
border-color: root.focus-index == 4 ? Theme.focus : Theme.line;
Text {
text: root.can-cancel ? "Cancel" : "Exit";
font-size: 17px * Theme.s;
color: root.focus-index == 4 ? Theme.text : Theme.muted;
}
TouchArea {
clicked => { root.exit(); }
}
}
if root.error != "": Text {
text: root.error;
font-size: 15px * Theme.s;
@@ -1129,6 +1114,31 @@ component LoginView inherits Rectangle {
wrap: word-wrap;
}
}
// Exit, or Cancel when adding a server from inside the app. A
// corner button rather than a row, to keep the card short.
Rectangle {
x: parent.width - self.width - 14px * Theme.s;
y: 14px * Theme.s;
width: 44px * Theme.s;
height: 44px * Theme.s;
border-radius: self.width / 2;
background: root.focus-index == -1 || x-area.has-hover ? Theme.raised : transparent;
border-width: 2px * Theme.s;
border-color: root.focus-index == -1 ? Theme.focus : transparent;
Path {
width: 18px * Theme.s;
height: 18px * Theme.s;
viewbox-width: 24;
viewbox-height: 24;
commands: "M 4 4 L 20 20 M 20 4 L 4 20";
stroke: root.focus-index == -1 || x-area.has-hover ? Theme.text : Theme.muted;
stroke-width: 2px * Theme.s;
}
x-area := TouchArea {
clicked => { root.exit(); }
}
}
}
}
}
@@ -1419,7 +1429,7 @@ export component AppWindow inherits Window {
search.focus-input();
}
public function focus-login(i: int) {
// Below 0 is a saved server, above 2 a button: keys go to the scope.
// Below 0 is the X or a saved server, 3 is Connect: keys go to the scope.
if (i >= 3 || i < 0) {
fs.focus();
} else {