feat(app): tags, one per name, folded when devices made the same
A tag is its name: names are lowercase, a person has one tag per name, and two of one name (made offline on two devices, or by renaming) fold into the one with the smallest id, so every device ends up alike. The colour lives in the payload. Deleting a card deletes its tags too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
31d87e8415
commit
c2d4dfc8b6
2 changed files with 944 additions and 13 deletions
|
|
@ -15,7 +15,8 @@ import 'package:serverpod/serverpod.dart' as _is;
|
|||
|
||||
/// A tag a person gives cards (ADR 0004): a name to study and filter by. Synced; its
|
||||
/// space owns it. The name is content, so it lives in the payload, like a
|
||||
/// studyset's title.
|
||||
/// studyset's title. A tag is its name: a person has one tag per lowercase name, and
|
||||
/// two with the same name, made on two devices offline, fold into one.
|
||||
abstract class Tag
|
||||
implements _is.TableRow<_is.UuidValue?>, _is.ProtocolSerialization {
|
||||
Tag._({
|
||||
|
|
@ -61,7 +62,7 @@ abstract class Tag
|
|||
/// The encryption key's id; always null (ADR 0002), as on studysets.
|
||||
String? keyId;
|
||||
|
||||
/// The content as UTF-8 JSON: {"schemaVersion", "name"}.
|
||||
/// The content as UTF-8 JSON: {"schemaVersion", "name", "color"}.
|
||||
_idt.ByteData payload;
|
||||
|
||||
/// The encryption nonce; always null, like keyId.
|
||||
|
|
@ -225,7 +226,7 @@ class TagTable extends _is.Table<_is.UuidValue?> {
|
|||
/// The encryption key's id; always null (ADR 0002), as on studysets.
|
||||
late final _is.ColumnString keyId;
|
||||
|
||||
/// The content as UTF-8 JSON: {"schemaVersion", "name"}.
|
||||
/// The content as UTF-8 JSON: {"schemaVersion", "name", "color"}.
|
||||
late final _is.ColumnByteData payload;
|
||||
|
||||
/// The encryption nonce; always null, like keyId.
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
### A tag a person gives cards (ADR 0004): a name to study and filter by. Synced; its
|
||||
### space owns it. The name is content, so it lives in the payload, like a
|
||||
### studyset's title.
|
||||
### studyset's title. A tag is its name: a person has one tag per lowercase name, and
|
||||
### two with the same name, made on two devices offline, fold into one.
|
||||
class: Tag
|
||||
table: tag
|
||||
database: sync
|
||||
fields:
|
||||
### The encryption key's id; always null (ADR 0002), as on studysets.
|
||||
keyId: String?
|
||||
### The content as UTF-8 JSON: {"schemaVersion", "name"}.
|
||||
### The content as UTF-8 JSON: {"schemaVersion", "name", "color"}.
|
||||
payload: ByteData
|
||||
### The encryption nonce; always null, like keyId.
|
||||
nonce: ByteData?
|
||||
|
|
|
|||
Loading…
Reference in a new issue