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