Enhance dashboard with 7-day lookahead, priority surfacing, and inline edit buttons
Dashboard improvements: - Added "Due This Week" section (next 7 days) and "High Priority" section (amber accent, catches high-priority tasks not already shown by date) - All task sections sort by priority desc then due date asc - Cascading deduplication via shared seen-set across all 5 sections - Combined due-today + due-this-week into single API call, split client-side - Removed unused `tomorrow` variable (fixed vue-tsc build error) Inline edit buttons: - NoteCard and TaskCard show "Edit" button on hover (always visible on touch) - Navigates directly to edit view via .prevent.stop on router-link cards - Styled as subtle bordered button, highlights to primary on hover Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
import type { Note } from "@/types/note";
|
||||
import TagPill from "@/components/TagPill.vue";
|
||||
import { relativeTime } from "@/composables/useRelativeTime";
|
||||
import { renderPreview } from "@/utils/markdown";
|
||||
|
||||
defineProps<{ note: Note }>();
|
||||
const props = defineProps<{ note: Note }>();
|
||||
const emit = defineEmits<{ "tag-click": [tag: string] }>();
|
||||
const router = useRouter();
|
||||
|
||||
function onTagClick(tag: string) {
|
||||
emit("tag-click", tag);
|
||||
}
|
||||
|
||||
function goEdit() {
|
||||
router.push(`/notes/${props.note.id}/edit`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<router-link :to="`/notes/${note.id}`" class="note-card">
|
||||
<h3 class="note-title">{{ note.title || "Untitled" }}</h3>
|
||||
<div class="note-top">
|
||||
<h3 class="note-title">{{ note.title || "Untitled" }}</h3>
|
||||
<button class="btn-edit" title="Edit" @click.prevent.stop="goEdit">Edit</button>
|
||||
</div>
|
||||
<div v-if="note.body" class="note-preview prose" v-html="renderPreview(note.body)"></div>
|
||||
<div class="note-meta">
|
||||
<TagPill
|
||||
@@ -42,9 +51,44 @@ function onTagClick(tag: string) {
|
||||
.note-card:hover {
|
||||
box-shadow: 0 2px 8px var(--color-shadow);
|
||||
}
|
||||
.note-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.note-title {
|
||||
margin: 0 0 0.25rem;
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-edit {
|
||||
flex-shrink: 0;
|
||||
padding: 0.2rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
background: transparent;
|
||||
color: var(--color-text-muted);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s, color 0.15s, border-color 0.15s;
|
||||
}
|
||||
.note-card:hover .btn-edit {
|
||||
opacity: 1;
|
||||
}
|
||||
.btn-edit:hover {
|
||||
color: var(--color-primary);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
@media (hover: none) {
|
||||
.btn-edit {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.note-preview {
|
||||
margin: 0 0 0.5rem;
|
||||
|
||||
Reference in New Issue
Block a user