Search and tags look through the Archive, and archived cards say so

A search or a tag filter on the main board, and a tag's own view, now
list every note not in Trash (a new `all` board view on the server and in
the core), so finished work can still be looked up. Archive and Trash
keep a search inside themselves.

An archived note met anywhere but the Archive carries an "Archived" chip
at the top of its card, on the web and on Android.

Task #6315.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 16:23:08 -04:00
co-authored by Claude Opus 5.5
parent 5780220ff1
commit b98a0c315f
10 changed files with 107 additions and 18 deletions
+10 -2
View File
@@ -3,7 +3,9 @@ import { ref } from "vue";
import { repo } from "../adapters";
import { useUiStore } from "./ui";
export type NoteView = "active" | "archived" | "trash";
// `all` is the board and the Archive together: what a search or a tag looks through,
// so finished work stays findable after it has been put away. Never Trash.
export type NoteView = "active" | "archived" | "trash" | "all";
// Combinable facet filters for the board (mirrors the GET /api/notes query). All
// optional; empty = the plain, unfiltered board. The date bounds are Timeline's.
export interface NoteFacets {
@@ -118,7 +120,13 @@ export const useNotesStore = defineStore("notes", () => {
function belongsHere(n: Note): boolean {
const v = view.value;
const inView =
v === "trash" ? n.trashed : v === "archived" ? !n.trashed && n.archived : !n.trashed && !n.archived;
v === "trash"
? n.trashed
: v === "archived"
? !n.trashed && n.archived
: v === "all"
? !n.trashed
: !n.trashed && !n.archived;
if (!inView) return false;
if (activeFacets.value.shared === "with_me" && (n.permission ?? "owner") === "owner") return false;
if (activeLabel.value) return n.labels.some((lb) => lb.id === activeLabel.value);