Skip to content

Improve board position management#14

Open
dynaman216 wants to merge 4 commits intojrmi:masterfrom
dynaman216:master
Open

Improve board position management#14
dynaman216 wants to merge 4 commits intojrmi:masterfrom
dynaman216:master

Conversation

@dynaman216
Copy link

No description provided.

@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for react-sync-board ready!

Name Link
🔨 Latest commit efbd4f5
🔍 Latest deploy log https://app.netlify.com/projects/react-sync-board/deploys/69ade8643ce9800008f9fdc3
😎 Deploy Preview https://deploy-preview-14--react-sync-board.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jrmi jrmi self-requested a review March 7, 2026 13:09
@jrmi jrmi changed the title Paul Changes 001 Improve board position management Mar 7, 2026
Copy link
Owner

@jrmi jrmi left a comment

Choose a reason for hiding this comment

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

Hey @dynaman216 I made a first review of your job. First I want to thank you for your contribution. I can see you look more comfortable with React now 😉

I left a few comments and questions, I'd love to hear your thoughts about that.

Let me know if you need more details.

...translateFn({
translateX: prev.translateX,
translateY: prev.translateY,
translateX: 0,
Copy link
Owner

Choose a reason for hiding this comment

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

What do you think to center the view at the center of the item extent instead of the center of the board? The center of the board could be empty and I think it doesn't really make sense to center in an empty location. Actually look at the PanZoom component, there is this centerBoard function, may be that's exactly what you want to achieve but not only on startup but when we click on a button (which makes a lot of sense).

Copy link
Author

Choose a reason for hiding this comment

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

Even centering at the center of item extent could be empty. It items are off to the top left and top right (off the board) then centering there would be empty. To recreate that start up the demo, drag half the items off the top left and the other half off the bottom right so they are not visible and center. Nothing will show up even though the view is in the "center" of the objects.

Copy link
Owner

Choose a reason for hiding this comment

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

Even centering at the center of item extent could be empty.
There is probably no perfect solution but at least it should work in most of the real cases. Creating a game with items at opposite of the space without anything in the middle looks slightly unusual don't you think?

At least for now none of the game in ABG are like that and the current centering is working great for all of them.

Actually for legacy reasons part of the games were created when the center was actually the top left corner so for this games chances are great that we don't see anything.

What do you think?

target
build
coverage
test
Copy link
Owner

Choose a reason for hiding this comment

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

I have the feeling these lines are duplicated, is there any reason?

Copy link
Author

Choose a reason for hiding this comment

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

Hit the resolved by accident. Toolset did this again. I'll remove them.

Copy link
Owner

Choose a reason for hiding this comment

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

Have you pushed your changes because I can still see the changes.

}

// Limit move to board limit
const distToCenter = distance(screenCenter, [boardCenter.x, boardCenter.y]);
Copy link
Owner

Choose a reason for hiding this comment

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

I think with should still keep the board limitations when we don't limit pan otherwise you can see board limit which is not great, what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

I may be making some really large maps so not limiting at all is helpful for that. I was going to suggest having a background color instead of a base image (which is what I think is currently being done).
I am planning on adding a group of 9 buttons instead of just the center button. Each one would set the view to the top left, top middle, top right, left middle, middle, middle right, left bottom, bottom middle, and bottom right. Based on the positions of all the items added so far. laid out like so.

1 2 3
4 5 6
7 8 9

Copy link
Owner

Choose a reason for hiding this comment

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

I was going to suggest having a background color instead of a base image (which is what I think is currently being done).

Allowing a repetitive background (svg/image/css) was a request from some users and I think it's a good feature so I'm not sure remove that is a good idea.

Regarding what you want, do you know it's possible to save positions with alt+[number key] and restore them with [number key].

We could imagine that the new feature pre-set the positions as you described, what do you think?

Copy link
Owner

@jrmi jrmi Mar 12, 2026

Choose a reason for hiding this comment

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

I may be making some really large maps so not limiting at all is helpful for that.

I'm curious to see your game because I imported some of the biggest existing games (using vassal modules) and they all fit in the current board size. I used to play gloomhaven with a lot of space per user and we were really far from reaching the limit. Are you items at the right size? How are they compared to pre-made items?

Also have you noticed that there is a "box" system where you can store your game items when they are not used? May be this will mitigate your need for space? what do you think?

Changes to fix items listed on 3/7/2026
@dynaman216
Copy link
Author

New version 002 pushed today for your review. The changes made as commented on. Once those items are resolved I will start adding more functionality.

Copy link
Owner

Choose a reason for hiding this comment

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

Could you also revert the changes of this file?

@jrmi
Copy link
Owner

jrmi commented Mar 12, 2026

New version 002 pushed today for your review. The changes made as commented on. Once those items are resolved I will start adding more functionality.

Hey I tried to answer to the still open comments. I'd love to hear your thoughts.

@dynaman216
Copy link
Author

dynaman216 commented Mar 12, 2026 via email

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.

2 participants