Skip to content

Instantly share code, notes, and snippets.

@doomuch
Last active April 10, 2023 09:33
Show Gist options
  • Save doomuch/fa8a27f313b2a50d8884286adae11bf5 to your computer and use it in GitHub Desktop.
Save doomuch/fa8a27f313b2a50d8884286adae11bf5 to your computer and use it in GitHub Desktop.
Hide Toggles for Tana.inc. To activate, go to arc://boost/new. Choose custom add the content of these two files.

Boost for Arc ✧ Toggle heading in tabs view

(you can use it in other browsers too with plugins)

Explanation: Default spacing really annoys me. However, if you just hide it, you wouldn't be able to access important functions of a node

Solution: Default state is hidden. To open it, you just need to click on the active node tab. important! once you clicked, the state is changed for all tabs. to collapse, click on a tab once more

Old: image New: image

Any questions: ruby.wilde@pm.me

// Function to toggle display state of the target element
function toggleDisplayState(element) {
const currentDisplay = window.getComputedStyle(element).display;
element.style.display = currentDisplay === 'flex' ? 'none' : 'flex';
}
// Event handler function
function handleElementMouseUp(event) {
const elementSelector = '.TabsView-module_tabsViewContainer__8RoHM .navtarget.Button-module_button__WROwO.TabsView-module_currentTab__xBUwI.Button-module_unstyled__Iws4s';
if (event.target.closest(elementSelector)) {
const targetElementSelector = '.nodeContent .PanelHeader-module_panelHeader__MHSEh.PanelHeader-module_deprecatedOuterMargins__ZKnOB';
const targetElement = document.querySelector(targetElementSelector);
if (targetElement) {
toggleDisplayState(targetElement);
} else {
console.error('Target element not found:', targetElementSelector);
}
}
}
// Add event listener to the document for mouseup events
document.addEventListener('mouseup', handleElementMouseUp);
.nodeContent .PanelHeader-module_panelHeader__MHSEh.PanelHeader-module_deprecatedOuterMargins__ZKnOB {
display: none
}
body .expandedNodeContent>.TabsView-module_tabsViewContainer__8RoHM>nav {
margin-top: .5rem;
}
.TabsView-module_tabContent__4GTBK {
margin-top: .5rem;
}
body .panelContent>.TabsView-module_tabsViewContainer__8RoHM>nav {
margin: 0.5rem 0 0.5rem calc(-1 * var(--panelPaddingHorizontal));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment