-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dog-ears to show symmetrical cell #453
Conversation
…e will overwrite text)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great! Thank you! I commented with a couple of minor nits and one or two things that might need a change or clarification.
app/components/Builder.tsx
Outdated
@@ -557,8 +557,7 @@ export const Builder = (props: BuilderProps & AuthProps): JSX.Element => { | |||
isPrivate: state.isPrivate, | |||
isPrivateUntil: state.isPrivateUntil?.toMillis(), | |||
alternates: state.alternates, | |||
userTags: state.userTags, | |||
symmetry: state.symmetry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this just an accidental change? I think the effect is to not store the current symmetry setting between sessions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to revert that as well from when I was using F5 as a symmetry reset button
app/components/Grid.tsx
Outdated
@@ -134,7 +139,7 @@ export const GridView = ({ | |||
gridWidth={grid.width} | |||
gridHeight={grid.height} | |||
active={isActive} | |||
entryCell={entryCells.some((p) => cellIndex(grid, p) === idx)} | |||
entryCell={entryCell} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big deal but I have a slight preference for undoing the change that shifted entryCell into its own var - just to keep this PR's surface area as small as possible. I wonder if you had used it in one of your other iterations so needed to pull it out for that
app/components/Grid.tsx
Outdated
@@ -119,6 +120,10 @@ export const GridView = ({ | |||
const col = idx % grid.width; | |||
const row = Math.floor(idx / grid.height); | |||
|
|||
const entryCell = entryCells.some((p) => cellIndex(grid, p) === idx); | |||
const symmetricalCell = (props.symmetry != Symmetry.None) ? flipped(grid, active, props.symmetry as Symmetry) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check for the case that props.symmetry
is null/undefined here? I.e. in the case that this grid is being used for a puzzle rather than the builder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would enable us to get rid of the as
cast, too - which should always be a last resort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoot I addressed the null case but i had rewritten the line after ... well, college football game 😆
For whatever reason, it does work as-is in a puzzle, but you're right that it should be left in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
app/lib/style.ts
Outdated
return { | ||
'--tag-l': darkMode ? '30%' : '85%', | ||
'--bg': bg, | ||
'--primary': p, | ||
'--blue': darkMode ? mix('blue', 'white', 0.5) : 'blue', | ||
'--green': darkMode ? mix('green', 'white', 0.5) : 'green', | ||
'--onprimary': readableColor(p, darkMode), | ||
'--lighter': mix(p, cellBG, 0.6), | ||
'--lighter': lighter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to the entryCell
comment above - I'm OK with this but have an ever so slight pref for undoing the change since it doesn't seem to be a necessary part of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right, I missed those changes when I reviewed but knew I was forgetting something.
Cells which are symmetrical get a little yellow triangle in the corner to help with blocking.