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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user