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:
+6
-29
@@ -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 {
|
||||
|
||||
@@ -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="/">← 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 ▾
|
||||
</button>
|
||||
<div class="menu">
|
||||
<button
|
||||
type="button"
|
||||
class="menu__toggle"
|
||||
aria-haspopup="true"
|
||||
:aria-expanded="menuOpen"
|
||||
@click="menuOpen = !menuOpen"
|
||||
>
|
||||
Manage ▾
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user