Atomic Angular — Doc interne

Bookmarks

A starred toggle button on any document, and a paginated list of the user's bookmarks — reopening one re-runs the query it came from to land back on the exact record.

Bookmarking marks a single document for later, independently of any collection or label. <bookmark-button> is the toggle a result row or a preview header shows; <bookmarks> is the paginated list of everything the user has bookmarked.

Minimal example

A bookmark toggle on a result row
result-row.component.ts
import { Component, input } from "@angular/core";
import { BookmarkButtonComponent } from "@sinequa/atomic-angular";
import type { Article } from "@sinequa/atomic";

@Component({
  selector: "result-row",
  imports: [BookmarkButtonComponent],
  template: `<bookmark-button [article]="article()" />`,
})
export class ResultRowComponent {
  readonly article = input.required<Article>();
}

The button reads its own pressed state from UserSettingsStore.isBookmarked(article) — there is nothing else to wire for the toggle itself to reflect reality after a bookmark is added elsewhere in the app.

How it works

isBookmarked(article) click bookmark()/unbookmark() persists reads bookmarks() itemClick(bookmark) no record found BookmarkButtonComponent UserSettingsStore User Backend BookmarksComponent re-run bookmark.queryName, filter on id re-run the app's default query instead

Opening a bookmark from the list is a search, not a direct navigation to a stored document: <bookmarks> re-runs the query the bookmark was made from (bookmark.queryName), filtered to that document's id, and makes the first matching record the current article (SelectionService.setCurrentArticle). When that query no longer returns the record — the source query was removed from the app, say — it falls back to the app's default query before giving up and warning the user the bookmark looks outdated.

Keyboard

Same list, same keys as recent searches: ↑ / ↓ to move, Enter to open, Delete to remove (Backspace too on a Mac). While the keyboard focus is in the list, the focused row and the footer say so — a mouse click never shows it.

Options

Prop

Type

Pitfalls

What's next

On this page