Rebuild sidebar as a clean icon-first navigation - #75
Conversation
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3529a4a9ff
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for(const data of NAVIGATION){const primary=data.primary?sourceButtons.get(data.primary):null;const children=data.children.map(tab=>sourceButtons.get(tab)).filter(Boolean);if(!primary&&!children.length)continue; | ||
| const section=document.createElement('section');section.className='bert-nav-section';section.dataset.section=data.key;const submenu=document.createElement('div');submenu.id=`bert-nav-${data.key}`;submenu.className='bert-nav-submenu'; | ||
| children.forEach(button=>{button.className='bert-nav-button';button.innerHTML=destinationMarkup(button.dataset.tab);button.title=localizedLabel(DESTINATIONS[button.dataset.tab]?.label||button.dataset.tab);submenu.appendChild(button)}); | ||
| if(primary){primary.className='bert-nav-button';primary.innerHTML=destinationMarkup(primary.dataset.tab);primary.title=localizedLabel(data.label);const row=document.createElement('div');row.className='bert-nav-row';row.appendChild(primary); |
There was a problem hiding this comment.
Preserve the active class while rebuilding buttons
On an initial visit without a saved tab, assigning className replaces the template's active class on the Overview button. The Overview content remains visible, but no navigation destination receives active styling; moreover, entering and then clearing a navigation search finds no active button and collapses the current section. Preserve whether each button was active when applying the new navigation class.
Useful? React with 馃憤聽/ 馃憥.
| const observer=new MutationObserver(muts=>{for(const m of muts){m.addedNodes.forEach(n=>{if(n.nodeType===1)annotateTables(n);translateInterface(n)})}annotateTables()}); | ||
| observer.observe(document.body,{childList:true,subtree:true}); | ||
| window.addEventListener('resize',()=>{if(window.innerWidth>980)setMenu(false)}); | ||
| window.addEventListener('resize',()=>{if(window.innerWidth>980)setMenu(false);else app.classList.remove('jt-collapsed')}); |
There was a problem hiding this comment.
Restore the collapsed rail after returning to desktop
When a user with the desktop sidebar collapsed narrows the viewport below 980px, this handler removes jt-collapsed but leaves the saved preference set to 1; widening the same window again only closes the mobile menu and never reapplies the class. The desktop therefore unexpectedly stays expanded until a reload, despite the persisted compact-mode preference. Reapply the saved state when crossing back above the desktop breakpoint.
Useful? React with 馃憤聽/ 馃憥.
Summary
ui-shell.jsand serves it with revalidation so browser caches cannot keep an old sidebar after upgradesValidation
Main sections
Control Panel 路 Jobs 路 Job Review 路 Settings 路 Administration