Skip to content

Tags

Tags are folders on sources. The topics the AI puts on items are keywords.

Tags are a user’s labels for sources, like Inoreader folders: a source can carry several (SI-515, SI-525). OPML import turns folders into tags (import-export.md). Code: tags.ts for managing tags as a whole, sources.ts for the tags of one source. In the app: Tags (/tags), linked from the Sources page.

Rules

  • A tag belongs to one user. Names are unique per user, ignoring case: “news” is the existing “News”, which keeps its spelling.
  • Whitespace is tidied. At most 60 characters, no commas. At most 20 tags on one source.
  • A tag lives as long as a source carries it. When the last source loses it (edited, unsubscribed), the tag goes. So a new tag on the Tags page starts with at least one source. Hotaru has no empty tags: a tag is only useful for filtering sources, and the rule keeps the list free of leftovers after imports and edits.

Tags page

The page lists every tag with how many sources carry it. The name links to the Sources page, filtered by that tag (/sources?tag=News).

The stream filters by tag too: the tag menu in its header (stream.md).

  • New tag: a name, and the sources that get it, picked from a filterable list.
  • Rename: inline in the row. A change of case only is a plain rename. A name another tag already has asks first: “Merge “tech” into “Technology”?”. Merging keeps the other tag and gives it the new spelling.
  • Merge: tick two or more tags, give the merged tag a name (the first ticked tag’s by default), and press Merge. Every source that carried any of them carries the merged tag. When another tag already has the name, it is merged in too.
  • Delete: asks first. The tag comes off every source. The sources and their items stay.

On phones the rows keep their actions on screen; the merge and create buttons go full width.

Tag field

One component for every place that takes tags: the source editor, Add a source and the Raindrop save dialog (TagInput.svelte).

  • Chosen tags are chips with a remove button.
  • Typing suggests your tags that contain the text, ignoring case, those that start with it first. At most 8.
  • Arrow keys move through the suggestions. Enter takes the highlighted one, or else the typed text. Escape closes the list; a second Escape reaches the editor or dialog.
  • Comma, or pasting “a, b, c”, adds several at once. Leaving the field keeps what was typed.
  • Backspace in the empty field removes the last chip.
  • Enter in the empty field submits the form: it saves the source, follows the feed, or saves to Raindrop.

It follows the ARIA combobox pattern: the field has role="combobox", the suggestions are a listbox, and the highlighted option is the field’s aria-activedescendant. The list sits in the page flow under the field, so a dialog never cuts it off. In a form post, a hidden input carries the tags comma-separated.

API

All need a write token except the GETs.

Request
GET /api/v1/tags { tags: [{ id, name, sourceCount }] }, by name.
GET /api/v1/tags/:id One tag.
POST /api/v1/tags { name, subscriptionIds } Creates a tag on at least one of your sources. 201, 409 when the name is taken, 422 when a source already has 20 tags, 404 for a subscription that isn’t yours.
PATCH /api/v1/tags/:id { name, merge? } Renames. 409 with conflict (the tag that has the name) unless merge is true; then the two become one.
POST /api/v1/tags/merge { tagIds, name } Merges tags into one.
DELETE /api/v1/tags/:id Deletes the tag from all sources. 204.

Errors are JSON with error (not_found, invalid, conflict, too_many) and message. The tags of one source change with PATCH /api/v1/subscriptions/:id (sources.md).

The SDK has tags(), createTag(), renameTag(), mergeTags() and deleteTag().

const hotaru = createClient({ baseUrl: 'https://hotaru.example.com', token });
try {
await hotaru.renameTag(id, 'Technology');
} catch (e) {
if (e instanceof HotaruApiError && e.status === 409) await hotaru.renameTag(id, 'Technology', { merge: true });
}