Junk joins the system views; Report spam / Not spam come from the toolbar, menu and `!`; messages show their spam score as a badge. Rules gains an Add spam filter preset — score over 5 → Junk, placed first and stopping later rules — and the editor offers only numeric comparisons for spam score. Conversation lists now load older pages. The list previously only ever showed the newest 50 conversations, leaving older mail unreachable even though the API returned a cursor. Pages load as the end scrolls into view, when j walks past the end, or via a Load older button that also covers keyboard use. Refreshing after an action re-reads as many rows as were loaded, so a deep scroll doesn't collapse back to one page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e46ba09826
commit
789b550301
9 files changed
+171
-16
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
Desktop webapp client for [Tern](../) — see [`docs/webapp-client-spec.md`](docs/webapp-client-spec.md) and [`docs/branding-spec.md`](docs/branding-spec.md).
|
||||
|
||||
**Status: mail client with organisation** (build order phases 3–5). What's here:
|
||||
**Status: mail client with organisation and spam handling** (build order phases 3–6). What's here:
|
||||
|
||||
- Vite + Svelte 5 + TypeScript, no other runtime dependencies, per the spec's "fast and simple" priority (§1) and browser-API-only approach (§5).
|
||||
- The decided color palette wired up as CSS custom properties with `data-theme` light/dark/system switching (§4).
|
||||
@@ -13,11 +13,13 @@ Desktop webapp client for [Tern](../) — see [`docs/webapp-client-spec.md`](doc
|
||||
- **Compose, reply and reply-all** in a native `<dialog>`, with drafts. Replying to your own sent message addresses the people you wrote to, not yourself. `Ctrl+Enter` sends.
|
||||
- **Outbox** view for drafts, queued and failed messages, showing retry timing and the last error, with Retry/Delete for failures.
|
||||
- Opening a conversation marks it read.
|
||||
- **Views, folders and tags** in the sidebar (Inbox, All mail, Sent, Outbox, Trash, your folders, your tags), with tag chips on list rows.
|
||||
- **Views, folders and tags** in the sidebar (Inbox, All mail, Sent, Outbox, Junk, Trash, your folders, your tags), with tag chips on list rows.
|
||||
- **Conversation lists load older pages as you scroll** (or press `j` past the end), with a *Load older* button as a keyboard-reachable fallback.
|
||||
- **Spam** — *Report spam* / *Not spam* (`!`), each message's spam score shown as a badge, and an **Add spam filter** preset in Rules.
|
||||
- **Conversation actions** — archive, delete/restore, mark read/unread, move, tag — from a toolbar, a right-click context menu (native Popover API, §5), or the keyboard. Keyboard actions apply to the row under the cursor when nothing is open, so mail can be triaged straight from the list.
|
||||
- **Rules editor** — conditions and actions edited as the structured JSON they're stored as, so anything the API accepts the editor can show. Each rule can stop later rules when it matches, and **Run now** applies it to existing mail. Server validation errors (e.g. a bad regex) appear inline without losing the form.
|
||||
- **Trash** shows when each conversation will be permanently deleted.
|
||||
- **Keyboard shortcuts** (§4a): `j`/`k`, `Enter`/`o`, `u`/`Esc`, `g`/`G`, `e` archive, `#` delete/restore, `Shift+I`/`Shift+U` read/unread, `v`/`l` move/tag, `c`, `r`/`a`, `Shift+R`, `?`.
|
||||
- **Keyboard shortcuts** (§4a): `j`/`k`, `Enter`/`o`, `u`/`Esc`, `g`/`G`, `e` archive, `#` delete/restore, `!` spam/not spam, `Shift+I`/`Shift+U` read/unread, `v`/`l` move/tag, `c`, `r`/`a`, `Shift+R`, `?`.
|
||||
- Polls `/events` while the tab is open, since WebSocket push is phase 7.
|
||||
- No PWA, no service worker, no offline cache — matches §2's explicit scope cut.
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
}
|
||||
|
||||
const inTrash = $derived(view.kind === 'trash');
|
||||
const inJunk = $derived(view.kind === 'junk');
|
||||
const tagged = (id: string) => thread?.tag_ids.includes(id) ?? false;
|
||||
</script>
|
||||
|
||||
@@ -66,6 +67,11 @@
|
||||
{:else}
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'archive' }])}>Archive <kbd>e</kbd></button>
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'delete' }])}>Delete <kbd>#</kbd></button>
|
||||
{#if inJunk}
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'move', folder_id: null }])}>Not spam <kbd>!</kbd></button>
|
||||
{:else}
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'junk' }])}>Report spam <kbd>!</kbd></button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if thread.unread_count > 0}
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'mark_read' }])}>Mark read <kbd>I</kbd></button>
|
||||
@@ -75,7 +81,7 @@
|
||||
|
||||
<p class="heading">Move to</p>
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'move', folder_id: null }])}>Inbox</button>
|
||||
{#each folders as f (f.id)}
|
||||
{#each folders.filter((f) => f.role !== 'junk') as f (f.id)}
|
||||
<button role="menuitem" onclick={() => pick([{ type: 'move', folder_id: f.id }])}>{f.name}</button>
|
||||
{/each}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
let folders = $state<Folder[]>([]);
|
||||
let tags = $state<Tag[]>([]);
|
||||
let threads = $state<ThreadSummary[]>([]);
|
||||
let nextCursor = $state<string | null>(null);
|
||||
let loadingMore = $state(false);
|
||||
let outbox = $state<OutboxItem[]>([]);
|
||||
let section = $state<'mail' | 'outbox' | 'rules'>('mail');
|
||||
let mailView = $state<MailView>({ kind: 'inbox' });
|
||||
@@ -71,6 +73,7 @@
|
||||
case 'all': return 'All mail';
|
||||
case 'sent': return 'Sent';
|
||||
case 'trash': return 'Trash';
|
||||
case 'junk': return 'Junk';
|
||||
case 'folder': { const id = mailView.id; return folders.find((f) => f.id === id)?.name ?? 'Folder'; }
|
||||
case 'tag': { const id = mailView.id; return tags.find((t) => t.id === id)?.name ?? 'Tag'; }
|
||||
}
|
||||
@@ -81,11 +84,20 @@
|
||||
return !('id' in v) || ('id' in mailView && v.id === mailView.id);
|
||||
}
|
||||
|
||||
const PAGE = 50;
|
||||
const MAX_PAGE = 200;
|
||||
|
||||
/**
|
||||
* Re-reads the list from the top. Asks for as many rows as are currently
|
||||
* loaded (up to the API's cap), so refreshing after an action doesn't
|
||||
* collapse a list the reader has scrolled deep into back to one page.
|
||||
*/
|
||||
async function refresh() {
|
||||
error = null;
|
||||
try {
|
||||
const page = await listThreads(mailView);
|
||||
const page = await listThreads(mailView, undefined, Math.min(MAX_PAGE, Math.max(PAGE, threads.length)));
|
||||
threads = page.threads;
|
||||
nextCursor = page.next_cursor;
|
||||
// Keep the open conversation's summary current (tags, counts), or
|
||||
// drop it if an action moved it out of this view.
|
||||
if (selected) selected = threads.find((t) => t.thread_id === selected!.thread_id) ?? null;
|
||||
@@ -97,6 +109,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function loadMore() {
|
||||
if (!nextCursor || loadingMore) return;
|
||||
loadingMore = true;
|
||||
const view = mailView;
|
||||
try {
|
||||
const page = await listThreads(view, nextCursor, PAGE);
|
||||
// The view may have changed while this was in flight.
|
||||
if (view !== mailView) return;
|
||||
const known = new Set(threads.map((t) => t.thread_id));
|
||||
threads = [...threads, ...page.threads.filter((t) => !known.has(t.thread_id))];
|
||||
nextCursor = page.next_cursor;
|
||||
} catch (e) {
|
||||
error = e instanceof Error ? e.message : 'failed to load older conversations';
|
||||
} finally {
|
||||
loadingMore = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshMeta() {
|
||||
[folders, tags] = await Promise.all([listFolders(), listTags()]);
|
||||
}
|
||||
@@ -136,6 +166,8 @@
|
||||
function showView(v: MailView) {
|
||||
section = 'mail';
|
||||
mailView = v;
|
||||
threads = [];
|
||||
nextCursor = null;
|
||||
selected = null;
|
||||
activeIndex = 0;
|
||||
loading = true;
|
||||
@@ -274,6 +306,8 @@
|
||||
case 'j':
|
||||
event.preventDefault();
|
||||
activeIndex = Math.min(activeIndex + 1, threads.length - 1);
|
||||
// Walking off the end with j pulls in the next page.
|
||||
if (activeIndex >= threads.length - 5) loadMore();
|
||||
break;
|
||||
case 'k':
|
||||
event.preventDefault();
|
||||
@@ -322,6 +356,12 @@
|
||||
act(t, [inTrash ? { type: 'restore' } : { type: 'delete' }]);
|
||||
}
|
||||
break;
|
||||
case '!':
|
||||
if (t && !inTrash) {
|
||||
event.preventDefault();
|
||||
act(t, [mailView.kind === 'junk' ? { type: 'move', folder_id: null } : { type: 'junk' }]);
|
||||
}
|
||||
break;
|
||||
case 'I':
|
||||
if (t) {
|
||||
event.preventDefault();
|
||||
@@ -369,13 +409,15 @@
|
||||
Outbox
|
||||
{#if outboxCount > 0}<span class="badge">{outboxCount}</span>{/if}
|
||||
</button>
|
||||
<button class:active={isView({ kind: 'junk' })} onclick={() => showView({ kind: 'junk' })}>Junk</button>
|
||||
<button class:active={isView({ kind: 'trash' })} onclick={() => showView({ kind: 'trash' })}>Trash</button>
|
||||
|
||||
<div class="group">
|
||||
<span>Folders</span>
|
||||
<button class="plus" aria-label="New folder" onclick={() => { adding = 'folder'; newName = ''; }}>+</button>
|
||||
</div>
|
||||
{#each folders as f (f.id)}
|
||||
<!-- Junk is listed with the system views above, not among folders. -->
|
||||
{#each folders.filter((f) => f.role !== 'junk') as f (f.id)}
|
||||
<div class="item">
|
||||
<button class:active={isView({ kind: 'folder', id: f.id })} onclick={() => showView({ kind: 'folder', id: f.id })}>
|
||||
{f.name}
|
||||
@@ -442,6 +484,9 @@
|
||||
{activeIndex}
|
||||
onSelect={open}
|
||||
onContextMenu={(t, i, x, y) => { activeIndex = i; openMenu(t, x, y); }}
|
||||
hasMore={nextCursor !== null}
|
||||
{loadingMore}
|
||||
onLoadMore={loadMore}
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
onCancel: () => void;
|
||||
} = $props();
|
||||
|
||||
type ActionType = 'tag' | 'move' | 'archive' | 'mark_read' | 'delete';
|
||||
type ActionType = 'tag' | 'move' | 'archive' | 'junk' | 'mark_read' | 'delete';
|
||||
|
||||
const fields: [RuleField, string][] = [
|
||||
['from', 'From'],
|
||||
@@ -29,6 +29,7 @@
|
||||
['subject', 'Subject'],
|
||||
['body', 'Body'],
|
||||
['header', 'Header…'],
|
||||
['spam_score', 'Spam score'],
|
||||
];
|
||||
const ops: [RuleOp, string][] = [
|
||||
['contains', 'contains'],
|
||||
@@ -38,10 +39,15 @@
|
||||
['greater_than', 'is greater than'],
|
||||
['less_than', 'is less than'],
|
||||
];
|
||||
// A spam score is a number: only numeric comparisons make sense.
|
||||
const numericOps = new Set<RuleOp>(['greater_than', 'less_than', 'exists']);
|
||||
const opsFor = (field: RuleField) => (field === 'spam_score' ? ops.filter(([v]) => numericOps.has(v)) : ops);
|
||||
|
||||
const actionTypes: [ActionType, string][] = [
|
||||
['tag', 'Tag with'],
|
||||
['move', 'Move to'],
|
||||
['archive', 'Archive'],
|
||||
['junk', 'Move to Junk'],
|
||||
['mark_read', 'Mark read'],
|
||||
['delete', 'Move to Trash'],
|
||||
];
|
||||
@@ -143,7 +149,11 @@
|
||||
</legend>
|
||||
{#each tests as t, i}
|
||||
<div class="row">
|
||||
<select bind:value={t.field} aria-label="Field">
|
||||
<select
|
||||
bind:value={t.field}
|
||||
aria-label="Field"
|
||||
onchange={() => { if (t.field === 'spam_score' && !numericOps.has(t.op)) t.op = 'greater_than'; }}
|
||||
>
|
||||
{#each fields as [v, label]}<option value={v}>{label}</option>{/each}
|
||||
</select>
|
||||
{#if t.field === 'header'}
|
||||
@@ -151,7 +161,7 @@
|
||||
{/if}
|
||||
<label class="negate"><input type="checkbox" bind:checked={t.negate} /> not</label>
|
||||
<select bind:value={t.op} aria-label="Comparison">
|
||||
{#each ops as [v, label]}<option value={v}>{label}</option>{/each}
|
||||
{#each opsFor(t.field) as [v, label]}<option value={v}>{label}</option>{/each}
|
||||
</select>
|
||||
{#if t.op !== 'exists'}
|
||||
<input class="value" bind:value={t.value} aria-label="Value" />
|
||||
|
||||
@@ -55,6 +55,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The spec's threshold rule (§3.5): score over N → Junk. Placed first so
|
||||
* it runs before anything else — otherwise a list rule could file spam
|
||||
* into a folder before it's caught — and stops later rules for spam.
|
||||
* 5 is SpamAssassin's own default; PMG only adds its header from level 3.
|
||||
*/
|
||||
async function addSpamFilter() {
|
||||
const rule = await createRule({
|
||||
name: 'Spam filter',
|
||||
enabled: true,
|
||||
stop_after_match: true,
|
||||
conditions: { match: 'all', tests: [{ field: 'spam_score', op: 'greater_than', value: '5', negate: false }] },
|
||||
actions: [{ type: 'junk' }],
|
||||
});
|
||||
rules = await reorderRules([rule.id, ...rules.map((r) => r.id)]);
|
||||
editing = rules[0];
|
||||
}
|
||||
|
||||
const hasSpamFilter = $derived(rules.some((r) => r.conditions.tests.some((t) => t.field === 'spam_score')));
|
||||
|
||||
async function toggle(rule: Rule) {
|
||||
await updateRule(rule.id, { ...rule, enabled: !rule.enabled });
|
||||
await load();
|
||||
@@ -73,7 +93,7 @@
|
||||
}
|
||||
|
||||
const fieldLabel: Record<string, string> = {
|
||||
from: 'from', to: 'to', cc: 'cc', recipients: 'to/cc', subject: 'subject', body: 'body',
|
||||
from: 'from', to: 'to', cc: 'cc', recipients: 'to/cc', subject: 'subject', body: 'body', spam_score: 'spam score',
|
||||
};
|
||||
const opLabel: Record<string, string> = {
|
||||
contains: 'contains', equals: 'is', matches: 'matches', exists: 'exists',
|
||||
@@ -87,6 +107,7 @@
|
||||
case 'tag': return `tag “${tags.find((t) => t.id === a.tag_id)?.name ?? 'deleted tag'}”`;
|
||||
case 'move': return `move to ${a.folder_id ? (folders.find((f) => f.id === a.folder_id)?.name ?? 'deleted folder') : 'Inbox'}`;
|
||||
case 'archive': return 'archive';
|
||||
case 'junk': return 'move to Junk';
|
||||
case 'mark_read': return 'mark read';
|
||||
case 'delete': return 'move to Trash';
|
||||
default: return a.type;
|
||||
@@ -119,7 +140,12 @@
|
||||
{:else}
|
||||
<header>
|
||||
<h2>Rules</h2>
|
||||
<button class="primary" onclick={() => (editing = 'new')}>New rule</button>
|
||||
<div class="header-actions">
|
||||
{#if !hasSpamFilter}
|
||||
<button onclick={addSpamFilter} title="Score over 5 → Junk, placed first">Add spam filter</button>
|
||||
{/if}
|
||||
<button class="primary" onclick={() => (editing = 'new')}>New rule</button>
|
||||
</div>
|
||||
</header>
|
||||
<p class="hint">
|
||||
Applied to new mail in this order; every matching rule runs unless one above it is set to stop. Run now applies a single rule to mail you already have — disabled rules included, so you can try one before switching it on.
|
||||
@@ -169,6 +195,10 @@
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
.hint,
|
||||
.empty,
|
||||
.error {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
['g / G', 'Jump to first / last'],
|
||||
['e', 'Archive'],
|
||||
['#', 'Delete (restore, in Trash)'],
|
||||
['!', 'Report spam (not spam, in Junk)'],
|
||||
['Shift+I / Shift+U', 'Mark read / unread'],
|
||||
['v or l', 'Move or tag'],
|
||||
['c', 'Compose'],
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
tags,
|
||||
onSelect,
|
||||
onContextMenu,
|
||||
hasMore,
|
||||
loadingMore,
|
||||
onLoadMore,
|
||||
}: {
|
||||
threads: ThreadSummary[];
|
||||
selectedId: string | null;
|
||||
@@ -17,8 +20,27 @@
|
||||
onSelect: (thread: ThreadSummary, index: number) => void;
|
||||
/** Right-click on a row (§4a: context menus instead of a "…" per row). */
|
||||
onContextMenu: (thread: ThreadSummary, index: number, x: number, y: number) => void;
|
||||
hasMore: boolean;
|
||||
loadingMore: boolean;
|
||||
onLoadMore: () => void;
|
||||
} = $props();
|
||||
|
||||
let sentinel = $state<HTMLElement | null>(null);
|
||||
|
||||
// Infinite scroll: fetch the next page as the end of the list comes into
|
||||
// view (with some margin, so it's usually there before it's needed).
|
||||
$effect(() => {
|
||||
if (!sentinel || !hasMore) return;
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
if (entries.some((e) => e.isIntersecting)) onLoadMore();
|
||||
},
|
||||
{ root: listEl, rootMargin: '300px' },
|
||||
);
|
||||
observer.observe(sentinel);
|
||||
return () => observer.disconnect();
|
||||
});
|
||||
|
||||
const tagById = $derived(new Map(tags.map((t) => [t.id, t])));
|
||||
|
||||
function purgeText(at: string): string {
|
||||
@@ -79,6 +101,13 @@
|
||||
{/if}
|
||||
</button>
|
||||
{/each}
|
||||
{#if hasMore}
|
||||
<!-- Also a button: a fallback where IntersectionObserver doesn't fire,
|
||||
and reachable by keyboard. -->
|
||||
<button class="more" bind:this={sentinel} onclick={onLoadMore} disabled={loadingMore}>
|
||||
{loadingMore ? 'Loading…' : 'Load older'}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@@ -160,6 +189,15 @@
|
||||
font-size: 0.72rem;
|
||||
color: var(--accent);
|
||||
}
|
||||
.more {
|
||||
padding: 0.7rem;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--primary);
|
||||
font: inherit;
|
||||
font-size: 0.8rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -89,6 +89,11 @@
|
||||
{:else}
|
||||
<button onclick={() => onAction([{ type: 'archive' }])} title="Archive (e)">Archive</button>
|
||||
<button onclick={() => onAction([{ type: 'delete' }])} title="Delete (#)">Delete</button>
|
||||
{#if view.kind === 'junk'}
|
||||
<button onclick={() => onAction([{ type: 'move', folder_id: null }])} title="Not spam (!)">Not spam</button>
|
||||
{:else}
|
||||
<button onclick={() => onAction([{ type: 'junk' }])} title="Report spam (!)">Spam</button>
|
||||
{/if}
|
||||
{/if}
|
||||
<button onclick={() => onAction([{ type: 'mark_unread' }])} title="Mark unread (Shift+U)">Mark unread</button>
|
||||
<button
|
||||
@@ -119,6 +124,9 @@
|
||||
<span class="sender">
|
||||
{message.from_name || message.from_addr || 'Unknown sender'}
|
||||
{#if message.source === 'sent'}<span class="sent-tag">sent</span>{/if}
|
||||
{#if message.spam_score !== null}
|
||||
<span class="spam-tag" title="Score from the spam filter's headers">spam {message.spam_score}</span>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="date">{formatFullDate(message.sent_at)}</span>
|
||||
</button>
|
||||
@@ -218,6 +226,15 @@
|
||||
border-radius: 0.6rem;
|
||||
background: var(--secondary);
|
||||
}
|
||||
.spam-tag {
|
||||
margin-left: 0.4rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 500;
|
||||
padding: 0 0.35rem;
|
||||
border-radius: 0.6rem;
|
||||
border: 1px solid var(--accent);
|
||||
color: var(--text);
|
||||
}
|
||||
.reply-bar {
|
||||
display: flex;
|
||||
gap: 0.4rem;
|
||||
|
||||
+11
-5
@@ -36,8 +36,8 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
export interface Folder {
|
||||
id: string;
|
||||
name: string;
|
||||
/** 'archive' for the system Archive folder, null for the user's own. */
|
||||
role: 'archive' | null;
|
||||
/** System folders (Archive, Junk) have a role; the user's own have null. */
|
||||
role: 'archive' | 'junk' | null;
|
||||
}
|
||||
|
||||
export interface MessageSummary {
|
||||
@@ -53,6 +53,8 @@ export interface MessageSummary {
|
||||
/** 'imap' for received mail, 'sent' for mail sent from Tern. */
|
||||
source: 'imap' | 'sent';
|
||||
deleted_at: string | null;
|
||||
/** From the spam filter's headers; null means the filter didn't flag it. */
|
||||
spam_score: number | null;
|
||||
}
|
||||
|
||||
export interface MessageBody {
|
||||
@@ -94,17 +96,20 @@ export type MailView =
|
||||
| { kind: 'all' }
|
||||
| { kind: 'sent' }
|
||||
| { kind: 'trash' }
|
||||
| { kind: 'junk' }
|
||||
| { kind: 'folder'; id: string }
|
||||
| { kind: 'tag'; id: string };
|
||||
|
||||
export function listThreads(view: MailView, before?: string): Promise<{
|
||||
/** `cursor` is the opaque `next_cursor` from the previous page; null there means no more pages. */
|
||||
export function listThreads(view: MailView, cursor?: string, limit?: number): Promise<{
|
||||
threads: ThreadSummary[];
|
||||
next_cursor: string | null;
|
||||
}> {
|
||||
const query = new URLSearchParams({ view: view.kind });
|
||||
if (view.kind === 'folder') query.set('folder_id', view.id);
|
||||
if (view.kind === 'tag') query.set('tag_id', view.id);
|
||||
if (before) query.set('before', before);
|
||||
if (cursor) query.set('before', cursor);
|
||||
if (limit) query.set('limit', String(limit));
|
||||
return request(`/threads?${query}`);
|
||||
}
|
||||
|
||||
@@ -211,12 +216,13 @@ export type Action =
|
||||
| { type: 'untag'; tag_id: string }
|
||||
| { type: 'move'; folder_id: string | null }
|
||||
| { type: 'archive' }
|
||||
| { type: 'junk' }
|
||||
| { type: 'mark_read' }
|
||||
| { type: 'mark_unread' }
|
||||
| { type: 'delete' }
|
||||
| { type: 'restore' };
|
||||
|
||||
export type RuleField = 'from' | 'to' | 'cc' | 'recipients' | 'subject' | 'body' | 'header';
|
||||
export type RuleField = 'from' | 'to' | 'cc' | 'recipients' | 'subject' | 'body' | 'header' | 'spam_score';
|
||||
export type RuleOp = 'contains' | 'equals' | 'matches' | 'exists' | 'greater_than' | 'less_than';
|
||||
|
||||
export interface RuleTest {
|
||||
|
||||
Reference in new issue
Block a user