Draft
Conversation
ornicar
reviewed
Feb 5, 2026
conf/routes
Outdated
|
|
||
| # Bookmark | ||
| POST /bookmark/$gameId<\w{8}> controllers.Game.bookmark(gameId: GameId) | ||
| POST /bookmark/$gameId<\w{8}>/:ply controllers.Game.bookmark(gameId: GameId, ply: chess.Ply) |
Collaborator
There was a problem hiding this comment.
this unnecessarily breaks compatibility. The ply should be optional.
ornicar
reviewed
Feb 5, 2026
| (for | ||
| f <- fen | ||
| u <- uci | ||
| yield add(gameId, userId, nowInstant, ply, f, u)).getOrElse(Future {}) |
Collaborator
There was a problem hiding this comment.
now refuses to add bookmarks without ply & fen & uci
ornicar
reviewed
Feb 5, 2026
| import chess.format.SimpleFen | ||
| import chess.format.Uci | ||
|
|
||
| case class Bookmark(game: Game, user: User) |
Collaborator
There was a problem hiding this comment.
The data model is usually the place to start.
You want to add an optional ply, and you need to store fen/lastMove for display.
case class Bookmark(game: Game, user: User, Option[BookmarkPosition] = None)
case class BookmarkPosition(ply: Ply, fen: SimpleFen, lastMove: Uci)
ornicar
reviewed
Feb 14, 2026
ui/round/src/ctrl.ts
Outdated
| @@ -951,6 +951,9 @@ export default class RoundController implements MoveRootCtrl { | |||
|
|
|||
| bindBookmarkButton(() => ({ | |||
| ply: this.ply, | |||
| fen: this.chessground.getFen(), | |||
ornicar
reviewed
Feb 14, 2026
ui/lib/src/game/bookmark.ts
Outdated
| htmlText: ` | ||
| <div class="continue-with"> | ||
| <a class="button" rel="nofollow">${i18n.site.bookmarkThisGame}</a> | ||
| <a class="button" rel="nofollow">${i18n.site.bookmarkThisPosition}</a> |
Collaborator
There was a problem hiding this comment.
<a> is for links. These are `.
ornicar
reviewed
Feb 14, 2026
ui/lib/src/game/bookmark.ts
Outdated
| `, | ||
| actions: [ | ||
| { | ||
| selector: 'a:first-child', |
Collaborator
There was a problem hiding this comment.
weak selector. Use classes instead
ornicar
reviewed
Feb 14, 2026
app/controllers/Game.scala
Outdated
| lila.log("FEN").info(fen.toString()) | ||
| lila.log("UCI").info(uci.toString()) | ||
| def bookmark(gameId: GameId) = AuthOrScopedBody(_.Web.Mobile) { _ ?=> me ?=> | ||
| val position = BookmarkPosition(get("ply"), get("fen"), get("col"), get("uci")) |
Collaborator
There was a problem hiding this comment.
color please. We haven't used the col abbrv anywhere yet, let's not start
therefore the whole Bookmark class is superfluous. Back to you
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.