Use anchor tags for dashboard sidebar items
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled

This commit is contained in:
jelveh
2026-04-25 11:25:03 -07:00
parent 7f1c13183b
commit 67f14db74a
2 changed files with 7 additions and 3 deletions
+6 -3
View File
@@ -99,10 +99,12 @@ async function UIDashboard (options) {
continue;
}
const isActive = i === 0 ? ' active' : '';
h += `<div class="dashboard-sidebar-item${isActive}" data-section="${tab.id}" data-tooltip="${html_encode(tab.label)}">`;
const tabHash = tab.id === 'home' ? '' : `#${tab.id}`;
const tabHref = tabHash || window.location.pathname;
h += `<a class="dashboard-sidebar-item allow-native-ctxmenu${isActive}" href="${tabHref}" data-section="${tab.id}" data-tooltip="${html_encode(tab.label)}">`;
h += tab.icon;
h += tab.label;
h += '</div>';
h += '</a>';
}
h += '</div>';
@@ -391,7 +393,8 @@ async function UIDashboard (options) {
window.addEventListener('popstate', handleRouteChange);
// Sidebar item click handler
$el_window.on('click', '.dashboard-sidebar-item', function () {
$el_window.on('click', '.dashboard-sidebar-item', function (e) {
e.preventDefault();
const $this = $(this);
const section = $this.attr('data-section');
+1
View File
@@ -352,6 +352,7 @@ body {
cursor: pointer;
font-size: 14px;
color: var(--dashboard-text);
text-decoration: none;
transition: background-color 0.15s;
flex-shrink: 0;
}