Fix register view on WASM, remove edit buttons when viewing non-editable project

This commit is contained in:
2026-08-24 18:42:18 +02:00
parent 8928446444
commit 8dc67adad3
2 changed files with 44 additions and 41 deletions
@@ -181,7 +181,6 @@ fun LoginView(server: String?, error: String?, onSwitchSignup: () -> Unit, onLog
Text("Log in", style = MaterialTheme.typography.headlineMedium)
ServerSelect(serverUrl) { serverUrl = it }
// OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
OutlinedTextField(password, { password = it }, Modifier.fillMaxWidth(), label = { Text("Password") }, visualTransformation = PasswordVisualTransformation(), singleLine = true)
@@ -213,7 +212,7 @@ fun SignupView(server: String?, error: String?, onSwitchLogin: () -> Unit, onSig
Column(Modifier.padding(5.dp).widthIn(min = 250.dp).width(IntrinsicSize.Min), horizontalAlignment = Alignment.CenterHorizontally) {
Text("Sign up", style = MaterialTheme.typography.headlineMedium)
OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
ServerSelect(serverUrl) { serverUrl = it }
OutlinedTextField(inviteCode, { inviteCode = it }, Modifier.fillMaxWidth(), label = { Text("Invite code") }, singleLine = true)
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
@@ -77,6 +77,7 @@ fun ProjectView(id: Uuid, forceBack: () -> Unit) {
Box(Modifier.fillMaxSize().padding(15.dp)) {
ProjectPlotArea(vm)
if(editable) {
if(addOpen) {
CompositionLocalProvider(LocalIndication provides NoFeedbackIndication()) {
Box(Modifier.clickable { addOpen = false }.fillMaxSize())
@@ -123,6 +124,7 @@ fun ProjectView(id: Uuid, forceBack: () -> Unit) {
}
}
}
}
if(editing) ProjectEditDialog(name ?: "Unnamed Project", public, { editing = false }) { name, public ->
vm.update(name, public)
@@ -621,6 +623,7 @@ fun ProjectPlotArea(vm: ProjectVM){
}
else Icon(Lucide.RulerDimensionLine, "Use as baseline")
}
if(editable) {
IconButton({ deletingVersion = lbl }, Modifier.align(Alignment.CenterVertically)) {
Icon(Lucide.Trash, "Delete version")
}
@@ -630,6 +633,7 @@ fun ProjectPlotArea(vm: ProjectVM){
}
}
}
}
Spacer(Modifier.width(15.dp))
LazyColumn(Modifier.weight(0.5f)) {
item { Text("Inputs", style = MaterialTheme.typography.headlineSmall) }