Skip to content

Conversation

@sinanm89
Copy link

@sinanm89 sinanm89 commented Dec 7, 2025

PR Details:

assuming :

  • didnt see a develop branch so forked off of main
  • didnt test unittests/write them yet
  • did test out a docker build with my versions as well.

my stack;

Headplane Version
v0.6.1

Headscale Version
v0.27.1

on ubuntu running natively behind a cloud proxy

qa:

  • been running it for the past week now, very useful for my case when trying things out etc.

Issue Details:

#390

Description
Currently there isnt a way to know what edit error caused the acl.hujson to have issues.

if and when you do make an error on the file it will 'refresh' the contents and give you a 502 failiure error without any explanation as to why (have to inspect the response and view from there).

this content refresh causes one major issue; all of your previous edits are now discarded and youre at the last saved file. aka your edits are gone.

so to make it a bit more user friendly and not to have some good edits vanish (also to make the discard changes button useful as a byproduct) I made these edits where the parsing error will be displayed on the same spot as the acl edit saved toast pops up as a red notification, it doesnt vanish until the user refreshes the page or clears it (meaning they read and acknowledged the error).

Failiure:

When the @ is removed from a user and invalidating the config

Image

Success:

Image


Ive made some assumptions and generified the error handling with classes but tried not to change anything on the structure of the code & existing behaviour. Currently i have it running on my own stack and can create a small demo page to test the feature/bug-fix.

Please feel free to correct me on parts where i took liberties, id like to continue contributing

root added 2 commits December 7, 2025 01:29
This PR addresses two main issues:
1. Fixes Vite HMR behind caddy proxy by forcing wss protocol and separate path.
2. Refactors toast error handling to correctly parse and display Headscale API errors that return DataWithResponseInit objects.
3. Limits toast width for better readability.
@sinanm89 sinanm89 requested a review from tale as a code owner December 7, 2025 13:34
@sinanm89 sinanm89 changed the base branch from next to main December 7, 2025 13:34
@sinanm89 sinanm89 changed the title Fix/hmr and toast errors Fix toast errors Dec 7, 2025
@tale
Copy link
Owner

tale commented Dec 13, 2025

In my opinion, toasts are not good UX and I want to remove them from Headplane. Instead it might make more sense to leverage the "Notice" component that I use in the acls/overview.tsx route to surface errors that persist until the next resubmit/edit.

@sinanm89
Copy link
Author

Good to know, ill check out the Notice component ! I dont have a strong opinion either way, just want to see the errors pop up when i make them and not lose progress tbh.

@tale
Copy link
Owner

tale commented Dec 14, 2025

It should do that, it just diverged with 0.27.1 but I think I've fixed it anyways if you wanna try the main branch.

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.

2 participants