Simplify the project view header: drop the back link and description

- Remove the '<- All projects' link at the top -- the sidebar's
  Dashboard link already covers that.
- Remove the description textarea and all of its state/save logic
  (descriptionDraft, saveDescription, patchProject's description
  field); the backend field and API are untouched.
- Drop .project__chrome's 42rem max-width, which existed only to keep
  the now-gone description prose readable. The header (title + Manage
  menu) now spans the full wide-layout width, so Manage sits at the
  true top right instead of a narrower centred column.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 20:14:03 +01:00
co-authored by Claude Sonnet 5
parent 374d607ce1
commit 21e148aa4d
3 changed files with 50 additions and 100 deletions
+5 -5
View File
@@ -80,11 +80,11 @@ under the list adds a card straight to the inbox.
## Project detail
`/projects/:id` shows one project. It renders on a **full-width** layout (the
route sets `meta.wide`, which widens `.app__main` in `App.vue`). The title and
description are inline-editable (saved on blur via `PATCH /api/projects/:id`; the
description shows an "Add a description" placeholder when empty). A **Manage**
menu (top right) has a **Delete project** action that opens a confirmation modal;
confirming calls `DELETE /api/projects/:id` and returns to the dashboard.
route sets `meta.wide`, which widens `.app__main` in `App.vue`), so the header
spans the full width and the **Manage** menu sits top right. The title is
inline-editable (saved on blur via `PATCH /api/projects/:id`). Manage has a
**Delete project** action that opens a confirmation modal; confirming calls
`DELETE /api/projects/:id` and returns to the dashboard.
Below the header are two tabs (local `activeTab` state, `v-show` so both stay
mounted). The tab order is fixed — **All tasks** first, **Kanban** second — but
+6 -29
View File
@@ -473,7 +473,7 @@ h1 {
background: var(--bg);
}
/* --- project detail: header, inline title/description, manage menu - */
/* --- project detail: header, inline title, manage menu ----------------- */
.project-head {
display: flex;
@@ -487,10 +487,11 @@ h1 {
margin: 0 0 0.5rem;
}
.project-head__title input,
.project-head__desc {
.project-head__title input {
width: 100%;
font: inherit;
font-size: 1.4rem;
font-weight: 600;
color: var(--text);
background: transparent;
border: 1px solid transparent;
@@ -498,31 +499,13 @@ h1 {
padding: 0.25rem 0.4rem;
}
.project-head__title input {
font-size: 1.4rem;
font-weight: 600;
}
.project-head__desc {
display: block;
resize: vertical;
min-height: 2.75rem;
font-size: 0.95rem;
color: var(--muted);
margin-bottom: 0.75rem;
}
.project-head__title input:hover,
.project-head__desc:hover {
.project-head__title input:hover {
border-color: var(--border);
}
.project-head__title input:focus,
.project-head__desc:focus {
outline: none;
.project-head__title input:focus {
color: var(--text);
background: var(--bg);
border-color: var(--accent);
}
.menu {
@@ -587,12 +570,6 @@ h1 {
color: var(--error);
}
/* --- project detail: keep the header/prose readable on the wide layout -- */
.project__chrome {
max-width: 42rem;
}
/* --- tabs -------------------------------------------------------------- */
.tabs {
+39 -66
View File
@@ -31,7 +31,6 @@ const tabs = [
const activeTab = ref<(typeof tabs)[number]['key']>('kanban')
const titleDraft = ref('')
const descriptionDraft = ref('')
const menuOpen = ref(false)
const confirmingDelete = ref(false)
@@ -106,10 +105,7 @@ async function onColumnChange(change: ColumnChange, column: Column) {
}
watch(project, (value) => {
if (value) {
titleDraft.value = value.title
descriptionDraft.value = value.description
}
if (value) titleDraft.value = value.title
})
watch(confirmingDelete, async (open) => {
@@ -151,7 +147,7 @@ async function load() {
}
}
async function patchProject(fields: { title?: string; description?: string }) {
async function patchProject(fields: { title?: string }) {
actionError.value = null
try {
const { project: updated } = await apiRequest<{ project: Project }>(`/projects/${projectId}`, {
@@ -162,10 +158,7 @@ async function patchProject(fields: { title?: string; description?: string }) {
project.value = updated
} catch (e) {
actionError.value = e instanceof ApiError ? e.message : 'Could not save the change.'
if (project.value) {
titleDraft.value = project.value.title
descriptionDraft.value = project.value.description
}
if (project.value) titleDraft.value = project.value.title
}
}
@@ -179,12 +172,6 @@ function saveTitle() {
if (next !== project.value.title) void patchProject({ title: next })
}
function saveDescription() {
if (!project.value) return
const next = descriptionDraft.value.trim()
if (next !== project.value.description) void patchProject({ description: next })
}
function askDelete() {
menuOpen.value = false
deleteError.value = null
@@ -232,62 +219,48 @@ async function onCreate() {
<template>
<section class="card project">
<p><RouterLink to="/">&larr; All projects</RouterLink></p>
<p v-if="loadError" class="form-error">{{ loadError }}</p>
<template v-else-if="project">
<div class="project__chrome">
<div class="project-head">
<h1 class="project-head__title">
<input
v-model="titleDraft"
type="text"
maxlength="255"
aria-label="Project title"
@blur="saveTitle"
@keyup.enter="($event.target as HTMLInputElement).blur()"
/>
</h1>
<div class="project-head">
<h1 class="project-head__title">
<input
v-model="titleDraft"
type="text"
maxlength="255"
aria-label="Project title"
@blur="saveTitle"
@keyup.enter="($event.target as HTMLInputElement).blur()"
/>
</h1>
<div class="menu">
<button
type="button"
class="menu__toggle"
aria-haspopup="true"
:aria-expanded="menuOpen"
@click="menuOpen = !menuOpen"
>
Manage &#9662;
</button>
<div class="menu">
<button
type="button"
class="menu__toggle"
aria-haspopup="true"
:aria-expanded="menuOpen"
@click="menuOpen = !menuOpen"
>
Manage &#9662;
</button>
<template v-if="menuOpen">
<div class="menu__backdrop" @click="menuOpen = false" />
<ul class="menu__list" role="menu">
<li role="none">
<button
type="button"
role="menuitem"
class="menu__item menu__item--danger"
@click="askDelete"
>
Delete project
</button>
</li>
</ul>
</template>
</div>
<template v-if="menuOpen">
<div class="menu__backdrop" @click="menuOpen = false" />
<ul class="menu__list" role="menu">
<li role="none">
<button
type="button"
role="menuitem"
class="menu__item menu__item--danger"
@click="askDelete"
>
Delete project
</button>
</li>
</ul>
</template>
</div>
<textarea
v-model="descriptionDraft"
class="project-head__desc"
rows="2"
maxlength="2000"
placeholder="Add a description"
aria-label="Project description"
@blur="saveDescription"
/>
</div>
<p v-if="actionError" class="form-error">{{ actionError }}</p>