feat(profile): drop seed-glyph illustrations from the avatar picker
The picker now offers only a photo; with none, the generated DiceBear avatar is used. Removes the seedks-ttf illustration row (and the now-dead avatarGlyphNames/avatarGlyphToken). tane:seed:<glyph> values set before this still render (avatarGlyphChar kept) for backward compatibility.
This commit is contained in:
parent
d4a9142ee2
commit
9560d0d18f
3 changed files with 15 additions and 54 deletions
|
|
@ -1,29 +1,19 @@
|
|||
import 'seed_glyph.dart';
|
||||
|
||||
/// A profile avatar is carried in one string (stored locally and published as
|
||||
/// the NIP-01 kind:0 `picture`), in one of three shapes:
|
||||
/// the NIP-01 kind:0 `picture`), in one of two shapes:
|
||||
/// - `data:image/jpeg;base64,…` — a tiny photo thumbnail (rides inline, no
|
||||
/// media server, like offer photos);
|
||||
/// - `tane:seed:<name>` — one of our own seed illustrations (for people who'd
|
||||
/// rather not put a real photo — pseudonymity stays the default);
|
||||
/// - empty — a DiceBear "thumbs" face generated deterministically from the pubkey.
|
||||
///
|
||||
/// A legacy `tane:seed:<name>` value (a seed illustration, no longer offered in
|
||||
/// the picker) is still rendered for anyone who set one before; see
|
||||
/// [avatarGlyphChar].
|
||||
const avatarGlyphPrefix = 'tane:seed:';
|
||||
|
||||
/// The seed illustrations offered as ready-made avatars. Names are the stable
|
||||
/// storage key (appended to [avatarGlyphPrefix]); the glyphs already ship in
|
||||
/// [SeedGlyphs]. Order is the picker order.
|
||||
const avatarGlyphNames = <String>[
|
||||
'jars',
|
||||
'sack',
|
||||
'jar',
|
||||
'scattered',
|
||||
'pouring',
|
||||
'mug',
|
||||
'bigSpoon',
|
||||
'smallSpoon',
|
||||
];
|
||||
|
||||
/// The glyph char for an avatar illustration [name], or null if unknown.
|
||||
/// The glyph char for a legacy seed-illustration [name], or null if unknown.
|
||||
/// Retained only to render `tane:seed:` avatars stored before the picker dropped
|
||||
/// them; new avatars are photos or the generated default.
|
||||
String? avatarGlyphChar(String name) => switch (name) {
|
||||
'jars' => SeedGlyphs.jars,
|
||||
'sack' => SeedGlyphs.sack,
|
||||
|
|
@ -35,6 +25,3 @@ String? avatarGlyphChar(String name) => switch (name) {
|
|||
'smallSpoon' => SeedGlyphs.smallSpoon,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
/// The token that selects illustration [name] (e.g. `tane:seed:jars`).
|
||||
String avatarGlyphToken(String name) => '$avatarGlyphPrefix$name';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue