Skip to main content

max / audiofiles

Have the settings read answer with a response, not a screen `showing` was the one shape the conversion wrote that the census then counted as work left to do, because it returns a Screen. goingson's equivalent returns a Response and is not counted, which is the right answer rather than a park entry: every one of its five callers was writing `.into()` on the way out, and the one that adds a toast can add it to the response directly.
Author: Max Johnson <me@maxj.phd> · 2026-09-04 20:49 UTC
Signed with PGP, not checked
Commit: 58945154203d36ab8ab7cbe4df6781efeadd3b28
Parent: 5bec7cf
5 files changed, +12 insertions, -12 deletions
@@ -136,7 +136,7 @@
136 136
137 137 /// The settings window again, which is what every act here answers with.
138 138 fn settled(state: &Panels<'_>) -> Result<Response, RouteError> {
139 - Ok(super::settings::showing(state)?.into())
139 + super::settings::showing(state)
140 140 }
141 141
142 142 declare! {
@@ -89,7 +89,7 @@
89 89
90 90 /// The settings window again, which is what both acts answer with.
91 91 fn settled(state: &Panels<'_>) -> Result<Response, RouteError> {
92 - Ok(super::settings::showing(state)?.into())
92 + super::settings::showing(state)
93 93 }
94 94
95 95 /// The licence, as the section draws it.
@@ -68,7 +68,7 @@
68 68
69 69 use quasi_declare::declare;
70 70 use quasi_router::layout::{Contrast, ThemeVariant};
71 - use quasi_router::{Action, Node, Request, Response, RouteError, Router, Screen};
71 + use quasi_router::{Action, Node, Request, Response, RouteError, Router};
72 72 // Aliased: this module's `super::ThemeChoice` is the host's own resolved theme,
73 73 // and the router's is how a description names one. Both are in scope here
74 74 // because this function is exactly the seam between them.
@@ -133,7 +133,7 @@
133 133
134 134 /// `GET /settings`
135 135 fn index(state: &Panels<'_>, _request: Request) -> Result<Response, RouteError> {
136 - Ok(showing(state)?.into())
136 + showing(state)
137 137 }
138 138
139 139 /// `POST /settings/config/{key}`
@@ -148,18 +148,18 @@
148 148
149 149 if let Some((key, stored)) = column_write(state, name, value) {
150 150 set(state, key, &stored)?;
151 - return Ok(showing(state)?.into());
151 + return showing(state);
152 152 }
153 153
154 154 let key = ConfigKey::from_key(name).ok_or_else(|| RouteError::not_found("no such setting"))?;
155 155 set(state, key, value)?;
156 - Ok(showing(state)?.into())
156 + showing(state)
157 157 }
158 158
159 159 /// `POST /settings/columns/reset`
160 160 fn reset_columns(state: &Panels<'_>, _request: Request) -> Result<Response, RouteError> {
161 161 set(state, ConfigKey::ColumnConfig, "")?;
162 - Ok(Response::from(showing(state)?).toast(
162 + Ok(showing(state)?.toast(
163 163 quasi_router::layout::Tone::Success,
164 164 "Columns restored to defaults.",
165 165 ))
@@ -255,14 +255,14 @@
255 255 /// settings window again: four of its sections are served from their own
256 256 /// modules and are spliced in here, so the halves of one screen live where
257 257 /// their routes do.
258 - pub(super) fn showing(state: &Panels<'_>) -> Result<Screen, RouteError> {
259 - Ok(screen(
258 + pub(super) fn showing(state: &Panels<'_>) -> Result<Response, RouteError> {
259 + Ok(Response::from(screen(
260 260 &read(state)?,
261 261 super::storage::section(state),
262 262 super::trash::section(&super::trash::read(state)),
263 263 super::licence::section(&super::licence::read(state)),
264 264 super::advanced::section(state.advanced.mirror().as_ref()),
265 - ))
265 + )))
266 266 }
267 267
268 268 declare! {
@@ -289,7 +289,7 @@
289 289
290 290 /// The settings window again, which is what every act here answers with.
291 291 fn settled(state: &Panels<'_>) -> Result<Response, RouteError> {
292 - Ok(super::settings::showing(state)?.into())
292 + super::settings::showing(state)
293 293 }
294 294
295 295 /// The row an address names.
@@ -85,7 +85,7 @@
85 85
86 86 /// The settings window again, which is what both acts answer with.
87 87 fn settled(state: &Panels<'_>) -> Result<Response, RouteError> {
88 - Ok(super::settings::showing(state)?.into())
88 + super::settings::showing(state)
89 89 }
90 90
91 91 /// What the section draws, read off the app once.