Skip to content

add goal to room - #39

Merged
hollesse merged 2 commits into
mainfrom
goals
Jun 26, 2024
Merged

hollesse merged 2 commits into
mainfrom
goals

Conversation

@hollesse

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/main/java/sh/mob/timer/web/Room.java
@@ -24,18 +24,41 @@ final class Room {
private final List<TimerRequest> timerRequests = new CopyOnWriteArrayList<>();
private final Sinks.Many<TimerRequest> sink =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we have two sinks, this name is too generic I think


@DeleteMapping("/{roomId:[A-Za-z0-9-_]+}/goal")
@ResponseStatus(HttpStatus.ACCEPTED)
public void putGoal(@PathVariable String roomId, @RequestBody DeleteGoalRequest deleteGoalRequest) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sollte deleteGoal heißen

Comment thread src/main/resources/templates/room.html Outdated
if (newGoal === null && user === null) {
console.log('Resetting state');

goal = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those two state changes are sort of a transaction, no? When we want the one, we want the other too.
Meant are Lines 564 and 565

Comment thread src/main/java/sh/mob/timer/web/Room.java
stats.incrementTimer(timer);
@DeleteMapping("/{roomId:[A-Za-z0-9-_]+}/goal")
@ResponseStatus(HttpStatus.ACCEPTED)
public void deleteGoal(@PathVariable String roomId, @RequestBody DeleteGoalRequest deleteGoalRequest) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a delete goal? Could be a put to empty goal

<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" onclick="deleteGoal()">🗑️ Delete current goal</a></li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this "Clear" and basically clear the textbox, which would trigger a change event sending an empty string as a goal. Keep it simple.

@simonharrer

simonharrer commented Apr 27, 2024 •

Copy link
Copy Markdown
Member

I would not use a modal. Instead, I would use https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable for the display of the goal, and when it is changed, I would trigger events or update it accordingly. Simple UI.

@hollesse
hollesse merged commit ed0e71c into main Jun 26, 2024
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.

3 participants