mbnuqw / sidebery

Firefox extension for managing tabs and bookmarks in sidebar.
MIT License
3.43k stars 175 forks source link

'Vertical panel labels' CCS code not working on latest beta #1008

Open mawvius opened 1 year ago

mawvius commented 1 year ago

Steps to reproduce

'Vertical panel labels' CCS code ``` #root { --nav-btn-width: 22px; } .NavigationBar .panel-btn { display: flex; flex-direction: column-reverse; padding: 5px 0; height: auto; } .NavigationBar .panel-btn svg, .NavigationBar .panel-btn img, .NavigationBar .panel-btn .update-badge, .NavigationBar .panel-btn .ok-badge, .NavigationBar .panel-btn .err-badge, .NavigationBar .panel-btn .progress-spinner { display: none; } .NavigationBar .panel-btn .progress-spinner { display: none; } .NavigationBar .panel-btn .len { position: relative; font-size: 9px; writing-mode: sideways-lr; text-orientation: mixed; background-color: transparent; padding: 0; top: 0; right: 0; } .NavigationBar .panel-btn .name { position: relative; display: block; padding: 3px 0 0; font-size: 13px; color: var(--container-fg, var(--nav-btn-fg)); writing-mode: sideways-lr; text-orientation: mixed; } ```

Expected behavior

Actual behavior

Debug info

Addon data (with other desired settings) ```json { "addonVersion": "5.0.0b31", "firefoxVersion": "111.0.1", "settings": { "nativeScrollbars": false, "nativeScrollbarsThin": true, "nativeScrollbarsLeft": false, "selWinScreenshots": false, "updateSidebarTitle": true, "markWindow": false, "markWindowPreface": "[Sidebery] ", "ctxMenuNative": false, "ctxMenuRenderInact": true, "ctxMenuRenderIcons": true, "ctxMenuIgnoreContainers": "", "navBarLayout": "vertical", "navBarInline": true, "navBarSide": "right", "hideAddBtn": false, "hideSettingsBtn": false, "navBtnCount": true, "hideEmptyPanels": true, "navActTabsPanelLeftClickAction": "none", "navActBookmarksPanelLeftClickAction": "none", "navTabsPanelMidClickAction": "discard", "navBookmarksPanelMidClickAction": "none", "navSwitchPanelsWheel": true, "groupLayout": "grid", "skipEmptyPanels": false, "dndTabAct": true, "dndTabActDelay": 1750, "dndTabActMod": "none", "dndExp": "pointer", "dndExpDelay": 750, "dndExpMod": "none", "dndOutside": "win", "searchBarMode": "dynamic", "warnOnMultiTabClose": "collapsed", "activateLastTabOnPanelSwitching": true, "activateLastTabOnPanelSwitchingLoadedOnly": true, "tabRmBtn": "hover", "hideInact": false, "activateAfterClosing": "next", "activateAfterClosingStayInPanel": false, "activateAfterClosingGlobal": false, "activateAfterClosingNoFolded": true, "activateAfterClosingNoDiscarded": true, "askNewBookmarkPlace": true, "tabsRmUndoNote": true, "nativeHighlight": false, "tabsUnreadMark": true, "tabsUpdateMark": "all", "tabsUpdateMarkFirst": true, "tabsReloadLimit": 5, "tabsReloadLimitNotif": true, "showNewTabBtns": true, "newTabBarPosition": "bottom", "tabsPanelSwitchActMove": false, "tabsUrlInTooltip": "full", "openSubPanelOnMouseHover": false, "selectActiveTabFirst": true, "moveNewTabPin": "end", "moveNewTabParent": "last_child", "moveNewTabParentActPanel": false, "moveNewTab": "end", "moveNewTabActivePin": "start", "pinnedTabsPosition": "panel", "pinnedTabsList": true, "pinnedAutoGroup": true, "tabsTree": true, "groupOnOpen": true, "tabsTreeLimit": "none", "hideFoldedTabs": false, "hideFoldedParent": "none", "autoFoldTabs": false, "autoFoldTabsExcept": "none", "autoExpandTabs": false, "rmChildTabs": "none", "tabsChildCount": true, "tabsLvlDots": true, "discardFolded": false, "discardFoldedDelay": 0, "discardFoldedDelayUnit": "sec", "tabsTreeBookmarks": true, "treeRmOutdent": "branch", "colorizeTabs": true, "colorizeTabsSrc": "container", "colorizeTabsBranches": false, "colorizeTabsBranchesSrc": "url", "inheritCustomColor": true, "warnOnMultiBookmarkDelete": "collapsed", "autoCloseBookmarks": false, "autoRemoveOther": false, "highlightOpenBookmarks": false, "activateOpenBookmarkTab": false, "showBookmarkLen": true, "bookmarksRmUndoNote": true, "loadBookmarksOnDemand": true, "pinOpenedBookmarksFolder": true, "loadHistoryOnDemand": true, "fontSize": "s", "animations": true, "animationSpeed": "norm", "theme": "proton", "density": "compact", "colorScheme": "ff", "sidebarCSS": false, "groupCSS": false, "snapNotify": true, "snapExcludePrivate": false, "snapInterval": 10, "snapIntervalUnit": "min", "snapLimit": 1, "snapLimitUnit": "day", "hScrollAction": "switch_act_tabs", "navSwitchPanelsDelay": 128, "scrollThroughTabs": "none", "scrollThroughVisibleTabs": true, "scrollThroughTabsSkipDiscarded": true, "scrollThroughTabsExceptOverflow": true, "scrollThroughTabsCyclic": false, "scrollThroughTabsScrollArea": 0, "autoMenuMultiSel": true, "multipleMiddleClose": false, "longClickDelay": 500, "wheelThreshold": false, "wheelThresholdX": 10, "wheelThresholdY": 60, "tabDoubleClick": "exp", "tabsSecondClickActPrev": false, "tabsSecondClickActPrevPanelOnly": false, "shiftSelAct": true, "activateOnMouseUp": true, "tabLongLeftClick": "reload", "tabLongRightClick": "duplicate", "tabCloseMiddleClick": "discard", "tabsPanelLeftClickAction": "none", "tabsPanelDoubleClickAction": "collapse", "tabsPanelRightClickAction": "menu", "tabsPanelMiddleClickAction": "undo", "newTabMiddleClickAction": "new_child", "bookmarksLeftClickAction": "open_in_new", "bookmarksLeftClickActivate": false, "bookmarksLeftClickPos": "default", "bookmarksMidClickAction": "edit", "bookmarksMidClickActivate": false, "bookmarksMidClickPos": "default", "syncName": "firefox-surface", "syncSaveSettings": true, "syncSaveCtxMenu": true, "syncSaveStyles": true, "syncSaveKeybindings": true }, "permissions": { "allUrls": true, "tabHide": true, "clipboardWrite": true, "webRequest": true, "webRequestBlocking": true }, "storage": { "size": "284 kb", "props": { "containers": "1.25 kb", "expandedBookmarkFolders": "19 b", "favDomains": "7.11 kb", "favHashes": "811 b", "favicons": "121 kb", "lastSnapTime": "13 b", "profileID": "14 b", "settings": "3.88 kb", "sidebar": "1.86 kb", "sidebarCSS": "929 b", "snapshots": "122 kb", "tabsDataCache": "24.7 kb", "ver": "10 b" } }, "sidebar": { "panels": { "xPuvmpjbRJCX": { "type": 1, "id": "xPuvmpjbRJCX", "name": "len: 9", "iconSVG": "icon_bookmarks", "iconIMGSrc": "", "iconIMG": "", "color": "toolbar", "lockedPanel": false, "tempMode": false, "skipOnSwitching": false, "rootId": "root________", "viewMode": "tree", "autoConvert": false }, "history": { "type": 4, "id": "history", "name": "len: 7", "color": "toolbar", "iconSVG": "icon_clock", "tempMode": false, "lockedPanel": false, "skipOnSwitching": false, "viewMode": "history" }, "6rRzXycCv1jO": { "type": 2, "id": "6rRzXycCv1jO", "name": "len: 4", "color": "toolbar", "iconSVG": "icon_tabs", "iconIMGSrc": "", "iconIMG": "", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": false, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "bookmarksFolderId": -1, "newTabBtns": [] }, "G6dug-9qAskO": { "type": 2, "id": "G6dug-9qAskO", "name": "len: 6", "color": "green", "iconSVG": "icon_coffee", "iconIMGSrc": "", "iconIMG": "", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": true, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "bookmarksFolderId": -1, "newTabBtns": [] }, "EhYgxll2D2kO": { "type": 2, "id": "EhYgxll2D2kO", "name": "len: 5", "color": "pink", "iconSVG": "cart", "iconIMGSrc": "", "iconIMG": "", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": false, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "bookmarksFolderId": -1, "newTabBtns": [] }, "9FD1YJB-xXlO": { "type": 2, "id": "9FD1YJB-xXlO", "name": "len: 7", "color": "red", "iconSVG": "icon_play", "iconIMGSrc": "", "iconIMG": "", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": false, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "bookmarksFolderId": -1, "newTabBtns": [] } }, "nav": [ "search", "xPuvmpjbRJCX", "history", "settings", "sp-LYyyXZlwcRDX", "6rRzXycCv1jO", "G6dug-9qAskO", "EhYgxll2D2kO", "9FD1YJB-xXlO", "sp-0", "collapse", "add_tp", "sd-Vbn25CGwm5DX", "remute_audio_tabs", "create_snapshot" ] }, "containers": [ { "id": "firefox-container-1", "cookieStoreId": "firefox-container-1", "name": "8", "icon": "...", "color": "blue", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-2", "cookieStoreId": "firefox-container-2", "name": "4", "icon": "...", "color": "orange", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-3", "cookieStoreId": "firefox-container-3", "name": "7", "icon": "...", "color": "green", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-4", "cookieStoreId": "firefox-container-4", "name": "8", "icon": "...", "color": "pink", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" } ], "sidebarCSSLen": "883", "windows": [ { "state": "maximized", "incognito": false, "tabsCount": 138 } ], "bookmarks": { "bookmarksCount": 4114, "foldersCount": 281, "separatorsCount": 2, "maxDepth": 8 } } ```
Logs ``` No logs as it's just CSS ```

Note

Hey, Long-term fan/promoter/worshiper here.

If you can spare a few seconds, would love to try and get the 'Vertical panel labels' snippet working.

I'm on the latest beta 5.0.0b31, the latest Firefox, OS, etc. Tried on a few machines with fresh instals and no other changes but nothing is sticking.

CSS all looks good to me so maybe something in the latest release is not playing nice.

Massive thanks in advance if you can spare a few moments to help out a huge fan of your work.

Warmest regards,

-maws-

mauricekraus commented 1 year ago

Not battle tested, but I sort of fixed it for now.

#root {
  --nav-btn-width: 22px;
  --name-font-size: 12px;
  --count-font-size: 10px;
}

.NavigationBar .nav-item {
  display: flex;
  flex-direction: column-reverse;
  padding: 6px 0;
  height: auto;
}

.NavigationBar .nav-item .panel-btn[data-type="tabs"] {
  height: var(--nav-btn-width);
}

.NavigationBar [data-type="add_tp"] > svg,
.NavigationBar .nav-item > img {
  display: none;
}

.NavigationBar .nav-item .badge {
  top: 1px;
  left: 1px;
}

.NavigationBar .nav-item .badge,
.NavigationBar ..nav-item .progress-spinner {
  display: none;
}

.NavigationBar .nav-item .len {
  position: relative;
  font-size: var(--count-font-size);
  writing-mode: sideways-lr;
  text-orientation: mixed;
  background-color: transparent;
  padding: 0;
  margin: 5px 2px 3px 0;
  top: 0;
  right: 0;
  color: var(--container-fg, var(--nav-btn-fg));
}
.NavigationBar .nav-item .len:before {
  content: ": ";
  font-size: var(--name-font-size);
}

.NavigationBar .nav-item .name-box {
  position: relative;
  display: block;
  padding: 0;
  margin: 0 2px 5px 0;
  font-size: var(--name-font-size);
  color: var(--container-fg, var(--nav-btn-fg));
  writing-mode: sideways-lr;
  text-orientation: mixed;
}
mawvius commented 1 year ago

Not battle tested, but I sort of fixed it for now.

Wow! I can't even begin to express how grateful I am @mauricekraus - you are a wizard amongst us! Deeply appreciated - truly remarkable!

If you could spare a quick second so as to prevent me from wasting what would likely take me several dozen hours to even attempt, do you think CSS is limited to the point where only pre-defined panels can be displayed as text, leaving the remaining as icons?

Just thought I'd ask if you are aware as you seem really kind.

Massive thanks once again!

Cheers!

mauricekraus commented 1 year ago

Your welcome :). I'm not quite sure if I understand your question completely, but I would be glad to help.

So you want to hide all icons for those who have text? Could you give me an example?

mawvius commented 1 year ago

Hey Maurice,

Thank you so much for the kind offer to see if you can help - really going to have an enormous impact if it's possible.

Apologies my words were a bit jumbled - ha!

What I meant was exactly the same as the code you already kindly provided but instead of ALL panels being displayed as text, it allows only a user-defined selection of them.

As an example, say I have panels with icons and text: πŸ“‘- Bookmarks, πŸ•“ - History, ⚠ - Todo, βœ”οΈ - Done Would it be possible for the verticle panel to show something like: πŸ“‘, History, Todo, βœ”οΈ

Hope that makes sense.

Wow, this would be absolutely game-changing for my productivity if this were possible in any way, even if it wasn't perfect.

Can't thank you enough for being so awesome.

Cheers!

mauricekraus commented 1 year ago

Okay, I understand your point.

Unfortunately, I don't think it's possible to achieve this with pure CSS without altering the structure of the generated HTML (for example, using a td-title element similar to [data-type="add_tp"]) because, as far as I know, there is no CSS selector that can select content without having a data selector.

This needs to be solved at the JavaScript level. However, based on this issue (https://github.com/mbnuqw/sidebery/issues/218#issuecomment-626374467), it doesn't seem like there's interest in doing so.

Currently, I'm not a contributor, but I would be happy to submit a pull request if the code owners approve.

@mbnuqw would you be interested in such a feature?

mbnuqw commented 1 year ago

No, I'm not interested in adding this feature. It's possible to use attribute selector (.nav-item[title^="Panel name"]) and .nav-item:nth-child(N) pseuso-class to style individual buttons:

/* Hide the name of the "Panel A" panel (by name) */
.NavigationBar .nav-item[title^="Panel A"] .name-box {
  display: none;
}

/* Hide the icon of the second panel (by position) */
.NavigationBar .nav-item:nth-child(2) .icon {
  display: none;
}