sphinx-design icon indicating copy to clipboard operation
sphinx-design copied to clipboard

[ENH] Sticky sync tabs and URL param

Open mikemckiernan opened this issue 3 years ago • 9 comments

Addresses https://github.com/executablebooks/sphinx-design/issues/103.

Add a Sphinx configuration option that is named sphinx_design_sync_tabs_storage_key so that I can set a project-specific local storage key rather than risk clobbering the value for sphinx-design-last-tab across different projects.

Add support for a URL search param ?tab=blah so that I can copy and paste a URL and the receiver sees the tab content that I see. The URL search param is set in browser local storage when you click a tab.

If you visit a URL with search param ?tab=blah, set the local storage value to blah. If blah matches a synchronization key for a tab, show the tab.

mikemckiernan avatar Oct 26 '22 14:10 mikemckiernan

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

welcome[bot] avatar Oct 26 '22 14:10 welcome[bot]

@chrisjsewell , please let me know if there's something I need to do before a review. Also, I'm completely open to suggestion on changes.

mikemckiernan avatar Oct 29 '22 13:10 mikemckiernan

Hey @mikemckiernan, sorry I wasn't able to look at this just yet, maybe @choldgraf could have a quick look?

chrisjsewell avatar Nov 04 '22 17:11 chrisjsewell

Yep, it'd be great if @choldgraf could peek and provide feedback. I appreciate everyone's time and help. Great project too!

mikemckiernan avatar Nov 07 '22 18:11 mikemckiernan

@choldgraf , thanks for the feedback. PLMK if there's anything else you'd like changed or that I can clarify.

mikemckiernan avatar Nov 15 '22 14:11 mikemckiernan

@choldgraf , @chrisjsewell , can I get another look at this PR? I'd like to get my org to bring in this change from upstream. Thanks and let me know if there's anything else to revise.

mikemckiernan avatar Jan 05 '23 17:01 mikemckiernan

@choldgraf this is still awaiting your feedback

chrisjsewell avatar Jan 10 '23 09:01 chrisjsewell

@choldgraf , @chrisjsewell , any chance of another look? I'm running out of runway. Thanks very much.

We need #119 or #120 first though.

mikemckiernan avatar Feb 13 '23 17:02 mikemckiernan

In our project we used to use sphinx-tabs which already has this feature. Maybe sphinx-design could adopt that method? https://github.com/executablebooks/sphinx-tabs/blob/master/sphinx_tabs/static/tabs.js. It has the advantage of not cluttering the URL.

torbsorb avatar Jan 03 '24 08:01 torbsorb