Skip to content
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

Edit In Place component #166

Merged
merged 25 commits into from
May 30, 2024
Merged

Edit In Place component #166

merged 25 commits into from
May 30, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented May 14, 2024

A component that allows a user to edit text in place with buttons that reveal while editing.

@dbkr dbkr added the enhancement New feature or request label May 14, 2024
Copy link

cloudflare-workers-and-pages bot commented May 14, 2024

Deploying compound-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 897cabb
Status: ✅  Deploy successful!
Preview URL: https://7c880485.compound-web.pages.dev
Branch Preview URL: https://dbkr-editinplace.compound-web.pages.dev

View logs

Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

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

Honestly, I don't see anything wrong with keeping showSaved internal to the component. Controlled components are preferable to uncontrolled components when the parent might reasonably want to have access the child's state, but I don't think that applies to the "saved" text here - it just isn't useful to know about.

Comment on lines 123 to 125
setTimeout(() => {
setShowSaved(false);
}, 2000);
Copy link
Member

Choose a reason for hiding this comment

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

I believe this will log a warning if the component is unmounted while the timer is still running

@dbkr dbkr changed the title WIP edit in place component Edit In Place component May 22, 2024
dbkr added 2 commits May 22, 2024 15:03
and move the url to the right place
@dbkr dbkr marked this pull request as ready for review May 22, 2024 14:47
@dbkr dbkr requested a review from a team as a code owner May 22, 2024 14:47
@dbkr dbkr requested review from robintown and removed request for a team May 22, 2024 14:47
dbkr added 4 commits May 24, 2024 12:09
Because the error might be a failure to commit the change rather
than the input being invalid.
Copy link
Member

@florianduros florianduros left a comment

Choose a reason for hiding this comment

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

It will be great to have a playwright snapshot with the save and cancel buttons

@dbkr dbkr requested a review from florianduros May 30, 2024 12:11
@dbkr
Copy link
Member Author

dbkr commented May 30, 2024

Done, added as its own playwright test as it relies on the component having focus. I'm surprised we've got this far without having real playwright test tbh.

@dbkr dbkr merged commit ddcdca4 into main May 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants