Skip to content

Conversation

@ross39
Copy link
Contributor

@ross39 ross39 commented Jan 24, 2024

Displays the url for the image which can be easily copy and pasted. URL updates as the position is updated. I think its probably better than displaying the image itself as that might mess up the UI. Close #14521
Screenshot 2024-01-24 at 21 57 31

Copy link
Member

@fitztrev fitztrev left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR.

I actually interpreted the linked issue to mean when they share the link on a service that shows an OpenGraph preview, to show the thumbnail. That's why I mentioned the og:image meta tag. But now that I re-read it, I suppose it's not clear and it could be interpreted the way you did too :)

}

makeImageUrl(fen: string, orientation: Color = 'white'): string {
const url = `https://lichess1.org/export/fen.gif?fen=${fen}&color=${orientation}`;
Copy link
Member

Choose a reason for hiding this comment

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

Can you change the URL so that lichess1.org is not hardcoded in? If you go to a game and the Share tab, the links there will work with what is set in the config.

image

}

makeImageUrl(fen: string, orientation: Color = 'white'): string {
const url = `https://lichess1.org/export/fen.gif?fen=${fen}&color=${orientation}`;
Copy link
Member

Choose a reason for hiding this comment

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

Can you url encode the FEN string? either with underscores like the URL above it has or urlencoding.

}),
]),
h('p', [
h('strong.name', 'IMAGE'),
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to align the labels

Copy link
Member

@kraktus kraktus Jan 25, 2024

Choose a reason for hiding this comment

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

Instead of showing the raw URL would be nicer to have the same design as under game analysis, shown here #14551 (comment)

@kraktus kraktus changed the title Image preview fen#14521 Board editor: export position as image Jan 25, 2024
@ross39
Copy link
Contributor Author

ross39 commented Jan 25, 2024

Thanks for the feedback. I will make sure to implement these changes

@ross39
Copy link
Contributor Author

ross39 commented Jan 25, 2024

I made the button clickable as suggested but perhaps there could be a better place for it? Maybe in the menu with starting position, clear board etc and have it with an icon
Screenshot 2024-01-25 at 23 28 18

Essentially just reuse this design
Screenshot 2024-01-25 at 23 31 56

@fitztrev
Copy link
Member

Looks good. Yeah how about "Image" as the label and then re-use button on the right

* master:
  New Crowdin updates (lichess-org#14547)
  don't add json null field
  Game json: division - don't send null
  multiboard eval tick: remove unncesseray inlined style/CSS attribute
  Added visual indicator for showing advantage in mini-board broadcast
  monitor firebase data msgs separately
  fix push notification recipient
  add game division to game json export
  add source field to game json export
  only export reports created by the player
  fix typos
  scalachess 15.7.6
  Acpl chart: live update and spinner for studies
@ornicar ornicar merged commit 7f306a0 into lichess-org:master Jan 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.

Get image preview from FEN

4 participants