Add a persistent left sidebar to the signed-in layout
App.vue now renders a left AppSidebar beside the routed view for any
requiresAuth page, staying mounted as you move between the dashboard and
projects. The sidebar has a Dashboard link (icon), a divider, the project list
(each an icon link, current page highlighted via RouterLink active-class), and a
compact new-project form that jumps to the created project.
- New /dashboard route + DashboardView ("under construction"); / and unknown
paths redirect there. HomeView removed -- its project list and form moved into
the sidebar.
- <RouterView :key="route.path"> so navigating project -> project via the
sidebar remounts and reloads instead of reusing the instance.
- Signed-out routes (login/register/verify-email) render without the sidebar.
Icons are inline SVG -- no new dependency.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+130
-38
@@ -72,7 +72,14 @@ a.badge {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.app__body {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.app__main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
max-width: 32rem;
|
||||
margin: 2.5rem auto;
|
||||
padding: 0 1.25rem;
|
||||
@@ -84,6 +91,112 @@ a.badge {
|
||||
margin: 1.5rem auto;
|
||||
}
|
||||
|
||||
/* --- left sidebar (signed-in app pages) ------------------------------ */
|
||||
|
||||
.sidebar {
|
||||
flex: 0 0 15rem;
|
||||
align-self: stretch;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
max-height: 100vh;
|
||||
overflow-y: auto;
|
||||
padding: 1rem 0.75rem 1.5rem;
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.sidebar__nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1rem;
|
||||
}
|
||||
|
||||
.sidebar__link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
padding: 0.45rem 0.6rem;
|
||||
border-radius: 7px;
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.sidebar__link:hover {
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
.sidebar__link--active,
|
||||
.sidebar__link--active:hover {
|
||||
background: var(--accent);
|
||||
color: var(--accent-text);
|
||||
}
|
||||
|
||||
.sidebar__icon {
|
||||
flex: none;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.sidebar__link-text {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sidebar__divider {
|
||||
border: none;
|
||||
border-top: 1px solid var(--border);
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
.sidebar__heading {
|
||||
margin: 0 0 0.35rem;
|
||||
padding: 0 0.6rem;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.sidebar__projects {
|
||||
max-height: 45vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.sidebar__note {
|
||||
padding: 0 0.6rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.sidebar__form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
margin-top: 1rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.sidebar__form input {
|
||||
font: inherit;
|
||||
font-size: 0.9rem;
|
||||
padding: 0.4rem 0.55rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sidebar__form button[type='submit'] {
|
||||
padding: 0.45rem 0.7rem;
|
||||
font-size: 0.9rem;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
@@ -110,6 +223,23 @@ h1 {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.under-construction {
|
||||
margin-top: 1.5rem;
|
||||
padding: 2.5rem 1rem;
|
||||
text-align: center;
|
||||
border: 1px dashed var(--border);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.under-construction__icon {
|
||||
font-size: 2rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.under-construction p {
|
||||
margin: 0.5rem 0 0;
|
||||
}
|
||||
|
||||
.badge {
|
||||
padding: 0.1rem 0.45rem;
|
||||
border-radius: 999px;
|
||||
@@ -126,43 +256,6 @@ h1 {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.projects {
|
||||
list-style: none;
|
||||
margin: 1.5rem 0 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.projects__item {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.projects__link {
|
||||
display: block;
|
||||
padding: 0.75rem 0.9rem;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.projects__link:hover {
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
.projects__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.projects__title {
|
||||
font-weight: 600;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* --- project detail: cards ------------------------------------------ */
|
||||
|
||||
.cards {
|
||||
@@ -546,7 +639,6 @@ h1 {
|
||||
margin: 1.25rem 0;
|
||||
}
|
||||
|
||||
.form--new-project,
|
||||
.form--new-card {
|
||||
margin-top: 1.5rem;
|
||||
padding-top: 1.25rem;
|
||||
|
||||
Reference in New Issue
Block a user