Skip to content

fix: publish button doesn't show up after component edit #2227

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Faraz32123
Copy link
Contributor

Ticket: TNL-12019
When we edit & save the component, publish button doesn't show up until we refresh the page manualy or open this unit by opening previous unit and coming back to this unit again.
In this PR, we are dispatching a storage event whenever we edit the component, it'll refresh the page & show the publish button as expected.

Before:
before

After:
after

@Faraz32123 Faraz32123 self-assigned this Jun 26, 2025
@Faraz32123 Faraz32123 force-pushed the fix/publish_button_doesnt_appear_after_editing_the_component branch 3 times, most recently from 713339c to b185946 Compare June 27, 2025 08:10
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.15%. Comparing base (aeefcc6) to head (7534621).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2227      +/-   ##
==========================================
- Coverage   94.15%   94.15%   -0.01%     
==========================================
  Files        1164     1164              
  Lines       24599    24609      +10     
  Branches     5381     5365      -16     
==========================================
+ Hits        23162    23171       +9     
- Misses       1360     1370      +10     
+ Partials       77       68       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Faraz32123 Faraz32123 force-pushed the fix/publish_button_doesnt_appear_after_editing_the_component branch 9 times, most recently from 74fcbb0 to 35d4673 Compare June 27, 2025 12:15
When we edit & save the component, publish button doesn't show up until we refresh the page manualy or open this unit by opening previous unit and coming back to this unit again.
In this commit, we are dispatching a storage event whenever we edit the component, it'll refresh the page & show the publish button as expected.
@Faraz32123 Faraz32123 force-pushed the fix/publish_button_doesnt_appear_after_editing_the_component branch from 35d4673 to 7534621 Compare June 27, 2025 12:40
@Faraz32123 Faraz32123 requested review from a team, jristau1984 and rayzhou-bit June 27, 2025 12:52
@Faraz32123 Faraz32123 marked this pull request as ready for review June 27, 2025 12:53
@rayzhou-bit
Copy link
Contributor

Should localStorage be used instead of react state? Also I think we'd want to use sessionStorage in this case.

@Faraz32123
Copy link
Contributor Author

Should localStorage be used instead of react state?

I tried to use react state first! But that wasn't possible due to separate store for editor from rest of the components.

Also I think we'd want to use sessionStorage in this case.

Yup, sessionStorage will also do the trick of refreshing and will show the publish button but only in same tab, if the unit is already opened in another tab as well , sessionStorage will not refresh the other tab I have checked this, user will have to manually refresh that tab as well. It's a rare case I know but I think we should stick with localStorage.

Let me know what you think!

Copy link
Contributor

@rayzhou-bit rayzhou-bit left a comment

Choose a reason for hiding this comment

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

I didn't consider the multiple tabs. All of that makes sense to me!

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