Skip to content

Client#4

Draft
csboo wants to merge 80 commits intomainfrom
client
Draft

Client#4
csboo wants to merge 80 commits intomainfrom
client

Conversation

@csboo
Copy link
Owner

@csboo csboo commented Dec 5, 2025

fixes #21

  • comminicate set_admin_password endpoint
  • table width based on puzzle_value
  • scale everything dynamically
  • adjust theme and colors
  • handle adminuser better
  • properly flexing input boxes
  • logout, superlogout popup alerts
  • table order based on team points
  • always sort server data
  • puzzle_id dropdown select
  • handle way more errors and dont unwrap (likely done already)
  • make event title actually optional
  • messages and error messages should be handled differently
  • modularise and clean up code
  • fix fullscreen hover thing

@csboo
Copy link
Owner Author

csboo commented Dec 5, 2025

this is quite a WIP branch, but it works at this point, and i dont want to lose my local changes (for the 3rd time), hence the upload :D

testers are welcome!

Base automatically changed from backend to main January 13, 2026 18:24
@jarjk jarjk mentioned this pull request Jan 18, 2026
@jarjk jarjk force-pushed the client branch 2 times, most recently from b6c200c to 84bb86e Compare March 3, 2026 11:55
@jarjk
Copy link
Collaborator

jarjk commented Mar 16, 2026

as DioxusLabs/dioxus#5089 has been fixed, it's time to see how it works!

hasn't been released yet though, but here's the diff/patch to apply so you can try this out.

don't forget to run cargo update once you've applied the patch

diff --git a/Cargo.toml b/Cargo.toml
index 4c24204..a28e84b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -43,3 +43,6 @@ server_state_save = ["server", "dep:ciborium"]
 
 [build-dependencies]
 humantime = "2.3.0"
+
+[patch.crates-io]
+dioxus = { git = "https://github.com/dioxuslabs/dioxus" }
diff --git a/src/app/actions.rs b/src/app/actions.rs
index 7e7936c..909db1f 100644
--- a/src/app/actions.rs
+++ b/src/app/actions.rs
@@ -46,19 +46,16 @@ pub async fn handle_join(mut auth: Signal<AuthState>, toast_api: Toasts) {
         return;
     };
 
-    let _ok_none = crate::backend::endpoints::join(u.clone()).await;
-    match crate::backend::endpoints::auth_state().await {
-        Ok(uname) => {
-            popup_normal(toast_api, format!("Üdv, {}", uname));
+    match crate::backend::endpoints::join(u.clone()).await {
+        Ok(_) => {
+            popup_normal(toast_api, format!("Üdv, {u}"));
             auth.write().joined = true; // TODO auth.reset(_somefield)
             auth.write().password = String::new();
             auth.write().show_password_prompt = false;
         }
-        Err(e) => {
-            popup_error(
-                toast_api,
-                format!("Hiba: {}", e.message.unwrap_or("ismeretlen hiba".into())),
-            );
+        Err(http_err) => {
+            error!("couldn't join: {http_err}");
+            popup_error(toast_api, format!("Hiba: {http_err}"));
         }
     }
 }
@@ -220,11 +217,8 @@ pub fn handle_logout(
                     popup_normal(toast_api, format!("Viszlát, {}", auth.read().username));
                     auth.set(AuthState::default());
                 }
-                Err(e) => {
-                    popup_error(
-                        toast_api,
-                        format!("Hiba: {}", e.message.unwrap_or("ismeretlen hiba".into())),
-                    );
+                Err(http_err) => {
+                    popup_error(toast_api, format!("Hiba: {http_err}"));
                 }
             }
         });
diff --git a/src/backend/endpoints.rs b/src/backend/endpoints.rs
index e599de9..a0382f2 100644
--- a/src/backend/endpoints.rs
+++ b/src/backend/endpoints.rs
@@ -51,8 +51,6 @@ pub async fn auth_state() -> Result<String, HttpError> {
 /// We'll return a `SetCookie` header if the login is successful.
 ///
 /// This will set a cookie in the user's browser that can be used for subsequent authenticated requests.
-///
-/// WARN: **always** returns `Some(Ok(SetHeader { data: None }))`, see <https://github.com/DioxusLabs/dioxus/issues/5089>
 #[post("/api/join", cookies: TypedHeader<Cookie>)]
 pub async fn join(username: String) -> Result<SetHeader<SetCookie>, HttpError> {
     check_admin_pwd()?;
@@ -89,8 +87,6 @@ pub async fn join(username: String) -> Result<SetHeader<SetCookie>, HttpError> {
 /// otherwise preserve team progress for future relogins
 ///
 /// returns empty, expired `sid` `SetCookie` header => browser deletes the valid one => user's now deauthed
-///
-/// WARN: **always** returns `Some(Ok(SetHeader { data: None }))`, see <https://github.com/DioxusLabs/dioxus/issues/5089>
 #[post("/api/logout", cookies: TypedHeader<Cookie>)]
 pub async fn logout(wipe_progress: Option<bool>) -> Result<SetHeader<SetCookie>, HttpError> {
     check_admin_pwd()?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client

2 participants