-
Notifications
You must be signed in to change notification settings - Fork 17
⌨️ J-Editor / FEATURE: Typewriter Sounds! 🎵 #700
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/journaly/journaly/DwEA2AcxaYwNysroRRWgVs52dRL8 |
Co-authored-by: LindasLinguas <92399187+LindasLinguas@users.noreply.github.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
This is looking in quite good shape. I thought with all the fiddling with keyboard hacks we'd have some more spaghetti in here but it's pretty lean and clean all things considered.
const windowSize = useGetWindowSize() | ||
|
||
// This is to accounnt for the nav which appears at the top on mobile and has a height of 72px | ||
const toolbarStickyOffset = |
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.
since we un-fixed the nav, is this still necessary? Can we make rootMargin
a constant -20px 0 0 0
?
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.
Good catch! Removed this and related code ✅
const onVisualViewportChange = () => { | ||
setViewportsDiff(visualViewport.offsetTop) | ||
} |
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 kinda think we should debounce this for performance purposes, maybe with an interval of half or a quarter of a second, for performance purposes. But I don't know how much of an impact that's going to have on the feeling while scrolling. There's already some inevitable latency in there so maybe not too bad?
If you have a chance maybe test it with and without the debounce and see if it makes a big difference. But not a blocker.
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.
Going to do this as a quick followup so that I can also refactor other places where we debounce too 👍🏼
Co-authored-by: Ryan Jenkins <2343714+Lanny@users.noreply.github.com>
Description
Issue:
Welcome to a delightful, fun feature that simply adds a sweet and delightful edge to the Journaly writing experience: typewriter sounds! Because why not!? Basically, if a user turns this feature on then they'll simply hear the delightful clickity-clacks of a typewriter with each key press ⌨️ ❤️
Also takes care of some important work that will become useful in other upcoming PRs:
<SwitchToggle />
Component which will be very handy for quickly toggling on and off featuresSubtasks
playSounds
state not updating correctly in some placesHandle refocusing & holding position on formatting(Moved to separate ticket)useAutosavedState
)Deployment Checklist
Migrations
No miggies.
Screenshots
1. Toolbar with Typewriter Sounds OFF
2. Toolbar with Typewriter Sounds ON