Changeset 814ad8b in Klonkt


Ignore:
Timestamp:
06/22/2026 03:38:58 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
1ce1ffe
Parents:
b20460e
Message:

feat(circles): site name automatically from the remote actor (no manual input)

syncOne sets circle_links.label = actor.name (every sync, COALESCE fallback).
The manual name field in Admin -> Circles is gone; only the URL is needed.

Co-Authored-By: Claude <noreply@…>
EOF

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/services/CircleService.js

    rb20460e r814ad8b  
    194194  }
    195195
     196  // Naam automatisch overnemen van de remote actor (geen handmatige invoer nodig).
     197  // COALESCE: heeft de actor geen naam, dan blijft een evt. bestaand label staan.
    196198  db.prepare(
    197     "UPDATE circle_links SET remote_actor_id=?, last_synced=CURRENT_TIMESTAMP, status='active', last_error=NULL WHERE id=?"
    198   ).run(actorId, link.id);
     199    "UPDATE circle_links SET remote_actor_id=?, label=COALESCE(?, label), last_synced=CURRENT_TIMESTAMP, status='active', last_error=NULL WHERE id=?"
     200  ).run(actorId, actor.name || null, link.id);
    199201
    200202  return { ok: true, actorId, items: seen.size, pruned: stale.length };
  • src/services/i18n.js

    rb20460e r814ad8b  
    544544    'acir.label': 'Label',
    545545    'acir.optional': 'optioneel',
     546    'acir.name_auto': 'De naam wordt automatisch van de site overgenomen — alleen de URL is nodig.',
    546547    'acir.label_ph': 'bijv. Joost Klein',
    547548    'acir.add': 'Toevoegen',
     
    15241525    'acir.label': 'Label',
    15251526    'acir.optional': 'optional',
     1527    'acir.name_auto': 'The name is taken automatically from the site — only the URL is needed.',
    15261528    'acir.label_ph': 'e.g. Joost Klein',
    15271529    'acir.add': 'Add',
     
    25032505    'acir.label': 'Bezeichnung',
    25042506    'acir.optional': 'optional',
     2507    'acir.name_auto': 'Der Name wird automatisch von der Seite übernommen — nur die URL ist nötig.',
    25052508    'acir.label_ph': 'z. B. Joost Klein',
    25062509    'acir.add': 'Hinzufügen',
  • src/views/pages/admin-circle.ejs

    rb20460e r814ad8b  
    3535        <input type="text" name="remote_url" inputmode="url" autocapitalize="off" autocorrect="off" spellcheck="false" placeholder="artiest.klonkt.com" required>
    3636      </label>
    37       <label class="set-field">
    38         <span><%= t('acir.label') %> <small style="font-weight:400">— <%= t('acir.optional') %></small></span>
    39         <input type="text" name="label" maxlength="80" placeholder="<%= t('acir.label_ph') %>">
    40       </label>
     37      <p class="set-help" style="margin:.2rem 0 .6rem"><%= t('acir.name_auto') %></p>
    4138      <button type="submit" class="btn btn-primary"><%= t('acir.add') %></button>
    4239    </form>
Note: See TracChangeset for help on using the changeset viewer.