diff --git a/components/actionhistory.html b/components/actionhistory.html index cbc2f0c..d9711b8 100644 --- a/components/actionhistory.html +++ b/components/actionhistory.html @@ -1,5 +1,5 @@ {{define "actionhistory"}} -
+
Backlog: {{range .}}
@@ -14,27 +14,4 @@
{{end}}
- {{end}} diff --git a/components/room.html b/components/room.html index fce5a74..76b263b 100644 --- a/components/room.html +++ b/components/room.html @@ -65,7 +65,7 @@
{{if .Room.IsRunning}} - {{if and (eq .State.Role "guesser") (eq .State.Team .Room.TeamTurn)}} + {{if and (eq .State.Role "guesser") (eq .State.Team .Room.TeamTurn) (.Room.MimeDone)}} {{else if and (eq .State.Role "mime") (not .Room.MimeDone)}} {{template "mimeclue"}} diff --git a/handlers/handlers.go b/handlers/handlers.go index 315327e..1a56959 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -9,6 +9,8 @@ import ( "log/slog" "net/http" "os" + "slices" + "strings" ) var ( @@ -55,6 +57,12 @@ func HandleHome(w http.ResponseWriter, r *http.Request) { } else { fi.Room.GuesserView() } + // reverse actions if first action + if len(fi.Room.ActionHistory) > 1 { + if strings.EqualFold(fi.Room.ActionHistory[0].Action, models.ActionTypeGameStarted) { + slices.Reverse(fi.Room.ActionHistory) + } + } } if fi != nil && fi.Room == nil { rooms, err := repo.RoomList(r.Context()) diff --git a/todos.md b/todos.md index 3c18384..fe0d0f0 100644 --- a/todos.md +++ b/todos.md @@ -104,7 +104,8 @@ - llm resp token amount limit; ============= -- autoscroll backlog to the last action; -- mimes to see marks on the words; -- clearer ways to see opened words; +- autoscroll backlog to the last action; (reversed order) + +- mimes to see marks on the words; + +- clearer ways to see opened words; (line through) + +- guesser sees end turn button before clue was given by mime; + - sql no rows when joining by link?