Skip to content

ui: add shadow to chessground dragged pieces#19778

Draft
Simek wants to merge 3 commits intolichess-org:masterfrom
Simek:ui-chessground-add-shadow-to-dragged-piece
Draft

ui: add shadow to chessground dragged pieces#19778
Simek wants to merge 3 commits intolichess-org:masterfrom
Simek:ui-chessground-add-shadow-to-dragged-piece

Conversation

@Simek
Copy link
Contributor

@Simek Simek commented Mar 10, 2026

Why

An experiment to add a bit more visual feedback to pieces while dragging them.

Note

Since this is an experiment, some tweaks to the shadow values are welcome, we can also decide not to go that way and close the PR.

How

Add drop-shadow filter to piece which is in dragging state, mix filters with user board ones if needed.

Preview

Kapture.2026-03-10.at.14.27.14.mp4

@ornicar
Copy link
Collaborator

ornicar commented Mar 10, 2026

I'm concerned with performance here. It's just a drop shadow and modern browsers on good hardware laugh at it, for sure.

But what about crappy browsers on cheap hardware? We want to be fast there too. If it reduce the FPS when dragging pieces, it would really worsen the playing experience. How do we know it won't happen?

@Simek
Copy link
Contributor Author

Simek commented Mar 11, 2026

We can do performance analysis, take a snapshots before and after the change, and more-less asses the impact of the changes - if it's noticeable or not on the end results. However, this would not guarantee the performance on low-end devices. We might want to think about creating a consistent way - set of tests, benchmark or something else - that will provide a measurable results, and be reusable, so we can run it over time, and on PRs like this one, to detect performance regressions, will explore what we can do on that avenue.

On the other hand, we already are using CSS filter over SVG elements with user performance driven shade alteration, so we basically add one filter to the list for the dragging state, which is also conditional one, but I cannot say with 100% confidence that the impact of this change won't be noticeable, so will try to do some performance assessment anyway.

@Simek Simek marked this pull request as draft March 11, 2026 07:47
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