source: Klonkt/src/views/pages/guardian.ejs@ c6185fa

main
Last change on this file since c6185fa was fcd6964, checked in by Robin <roboburr@…>, 7 weeks ago

Guardianship: ward ziet z'n guardians, PWA-assets no-cache, handle-fix

De handshake commit werkte al aan beide kanten (geverifieerd live: sound-fabrics
ziet beta als ward, beta weet dat sound-fabrics guardian is), maar het TONEN
ontbrak op drie plekken. Dit lost de Klonkt-kant op.

  1. Ward-kant: in Berichten ziet een ward nu wie z'n guardians zijn (committed relaties, FEP-633c §2). Die view bestond nog niet.
  2. other_handle bewaarde per ongeluk de FEP-escalatiehandle (candidate/inbox) i.p.v. de @handle, dus overal waar we het toonden kwam een inbox-URL uit. Nu de echte @handle uit de offer; display self-healt oude rijen door @user@host uit de actor-URI af te leiden als de opgeslagen handle geen @ is.
  3. Guardian PWA-assets via /guardian/app.js|css met Cache-Control: no-cache, dus een update wordt nooit meer gemaskeerd door de 1-jaar /assets-cache of een vastgelopen install (dat was de "niks werkt na deploy"-bug). Client zit nu in try/catch met een zichtbare foutbanner i.p.v. stil te hangen.

Changed files:
src/services/guardianship/handshake.js

  • applyCommitLocally schrijft de @handle (offer.ward/candidate_handle) naar other_handle

src/routes/posts.js

  • messages-route levert myGuardians (committed guardians met afgeleide @handle)

src/views/pages/messages.ejs

  • "Jouw guardians"-sectie voor de ward

src/services/i18n.js

  • msg.guardians_label (nl/en/de)

src/routes/guardian.js

  • /guardian/app.js|css no-cache; ASSET_V-mtime-machinerie weg

src/assets/js/guardian.js

  • hele client in try/catch met zichtbare foutbanner; handleOf vertrouwt alleen echte @handles

src/views/pages/guardian.ejs

  • assets via no-cache routes i.p.v. /assets?v=

test/guardianship.test.js

  • assert dat other_handle de @handle is na commit

remarks: getest met npm test (6/6). sound-fabrics (stable-lane, handmatig) bewust
niet aangeraakt; wacht op akkoord.

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[318d0c2]1<!DOCTYPE html>
2<html lang="<%= lang %>">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
[c26cc18]6 <title><%= t('guardian.app_name') %></title>
[318d0c2]7 <link rel="manifest" href="/guardian/manifest.webmanifest">
8 <link rel="icon" href="/guardian/icon.svg" type="image/svg+xml">
9 <meta name="theme-color" content="#ff6b35">
[fcd6964]10 <link rel="stylesheet" href="/guardian/app.css">
[318d0c2]11</head>
12<body>
13 <header class="g-head">
14 <span class="g-buoy">🛟</span>
[c26cc18]15 <div class="g-head-txt">
16 <h1><%= t('guardian.app_name') %></h1>
17 <p class="g-sub"><%= t('guardian.tagline') %></p>
18 </div>
[318d0c2]19 <% if (sites.length > 1) { %>
[c26cc18]20 <select id="site-picker" aria-label="<%= t('guardian.acting_as') %>">
[318d0c2]21 <% for (const s of sites) { %>
22 <option value="<%= s.slug %>" <%= s.slug === state.site ? 'selected' : '' %>>@<%= s.slug %></option>
23 <% } %>
24 </select>
25 <% } else { %>
[c26cc18]26 <span class="g-me" title="<%= t('guardian.acting_as') %>">@<%= state.site %></span>
[318d0c2]27 <% } %>
28 </header>
29
30 <main>
[c26cc18]31 <!-- 1. Berichtencentrum: hulpverzoeken. Dat is waar dit voor bestaat. -->
[318d0c2]32 <section id="help-section">
[c26cc18]33 <div class="g-sec-head">
34 <h2><%= t('guardian.help_title') %></h2>
35 <span id="help-count" class="g-badge" hidden></span>
36 </div>
37 <p class="g-sec-sub"><%= t('guardian.help_sub') %></p>
[318d0c2]38 <div id="help-list" class="g-list"></div>
[c26cc18]39 <p id="help-empty" class="g-empty"><%= t('guardian.help_empty') %></p>
[318d0c2]40 </section>
41
[c26cc18]42 <!-- 2. Nieuwe ward adopteren. -->
43 <section id="adopt-section">
44 <div class="g-sec-head"><h2><%= t('guardian.adopt_title') %></h2></div>
45 <p class="g-sec-sub"><%= t('guardian.adopt_sub') %></p>
[318d0c2]46 <form id="adopt-form" autocomplete="off">
[c26cc18]47 <input id="adopt-handle" type="text" inputmode="email" autocomplete="off"
[318d0c2]48 placeholder="@kind@server.eu" aria-label="<%= t('guardian.adopt_label') %>">
[c26cc18]49 <button type="submit" id="adopt-btn"><%= t('guardian.adopt_btn') %></button>
[318d0c2]50 </form>
51 <p id="adopt-msg" class="g-msg" hidden></p>
[c26cc18]52 </section>
53
54 <!-- 3. Verzonden aanvragen (nog niet beantwoord). -->
55 <section id="pending-section" hidden>
56 <div class="g-sec-head"><h2><%= t('guardian.pending_title') %></h2></div>
57 <p class="g-sec-sub"><%= t('guardian.pending_sub') %></p>
58 <div id="pending-list" class="g-list"></div>
59 </section>
60
61 <!-- 4. Mijn wards (geaccepteerd). -->
62 <section id="wards-section">
63 <div class="g-sec-head"><h2><%= t('guardian.wards_title') %></h2></div>
[318d0c2]64 <div id="wards-list" class="g-list"></div>
[c26cc18]65 <p id="wards-empty" class="g-empty"><%= t('guardian.wards_empty') %></p>
[318d0c2]66 </section>
67
[c26cc18]68 <!-- 5. Meldingen. -->
[318d0c2]69 <section id="push-section">
[c26cc18]70 <div class="g-sec-head"><h2><%= t('guardian.push_title') %></h2></div>
71 <p class="g-sec-sub"><%= t('guardian.push_sub') %></p>
72 <button id="push-toggle" class="quiet" data-on-label="<%= t('guardian.push_off') %>"
[318d0c2]73 data-off-label="<%= t('guardian.push_on') %>"><%= t('guardian.push_on') %></button>
74 <p id="push-msg" class="g-msg" hidden></p>
75 </section>
76 </main>
77
78 <script type="application/json" id="guardian-state"><%- JSON.stringify(state) %></script>
[fcd6964]79 <script src="/guardian/app.js" defer></script>
[318d0c2]80</body>
81</html>
Note: See TracBrowser for help on using the repository browser.