Signals: an admin chooses whether the server's TypeSafe key pays for everyone (#271)

With signals_on_server set and TYPESAFE_KEY present, the judge asks Jev
about everyone's Signals on the server's key; otherwise each person turns
Signals on in Settings with a key of their own, which is now checked with
TypeSafe before it is saved. The Signals folder shows only when they are on.

The browser suite's daemon inherited the shell's TYPESAFE_KEY, so fixture
feeds were sent to the real TypeSafe to be categorised; it is blanked now,
and an empty key counts as none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 13:18:03 +00:00
parent 33eb1f4db2
commit 9a41641eaa
15 changed files with 242 additions and 71 deletions

View File

@@ -18,6 +18,10 @@ function signalOf(view: string|null){
return id===null ? undefined : S.signals.find(s=>s.id===id);
}
/// Whether you have Signals (#271): everyone does on the server's key; on your own, once you have
/// turned them on in Settings with a key TypeSafe took.
const signalsOn=()=>S.me?.signals==='server'||!!S.me?.typesafe_key_set;
/// The Signals folder: first in the feed list, under All Subscriptions, open or closed as an OPML's
/// is (#255, #256). As rows under the places, a long list of them pushed the feeds down.
const SIGNALS=':signals';
@@ -42,6 +46,7 @@ function signalTile(sg: {name: string, icon: string|null}){
}
const badgeHTML=(n: number)=>`<span class="badge${n?'':' zero'}" title="${n} unread">${n>999?'999+':n}</span>`;
function signalFolder(list: HTMLElement, q: string){
if(!signalsOn()) return;
const mine=S.signals.filter(s=>!q||s.name.toLowerCase().includes(q));
if(q&&!mine.length) return;
const open=expanded.has(SIGNALS)||!!q;
@@ -101,7 +106,7 @@ function renderSignals(){
}
function signalHead(sg: Signal){
const nokey=S.me&&!S.me.typesafe_key_set;
const nokey=S.me&&!signalsOn();
return `
<div class="fhead slim">
${signalTile(sg)}
@@ -130,7 +135,7 @@ async function signalAction(a: string, sg: Signal){
/// Making a Signal, or changing one.
function signalModal(sg?: Signal){
const nokey=S.me&&!S.me.typesafe_key_set;
const nokey=S.me&&!signalsOn();
openModal(`<h3>${sg?'Edit signal':'New signal'}</h3>
<div class="field"><label for="sgname">Name</label>
<div class="inline"><button type="button" class="iconpick" id="sgicon" title="Choose an icon" aria-label="Choose an icon"
@@ -148,8 +153,7 @@ function signalModal(sg?: Signal){
<input type="text" id="sgdesc" value="${esc(sg?.description||'')}" placeholder="AI tools for writing software: coding agents, vibe coding">
<span class="hint">Every item in the feeds you subscribe to is read, the last 30 days of them
and each new one, and the ones about this subject are pulled out: its name, these words and
your sentence together. The rest stays noise, in its own feed. Each item is one call on your
TypeSafe key.${sg?' A change here reads everything again.':''}</span></div>
your sentence together. The rest stays noise, in its own feed.${S.me?.signals==='server'?'':' Each item is one call on your TypeSafe key.'}${sg?' A change here reads everything again.':''}</span></div>
${nokey?`<p class="hint" style="color:var(--warn)">Without a TypeSafe key, nothing is picked out. ${KEY_LINKS}</p>`:''}
<div class="cardacts"><button class="btn ico" onclick="closeModal()" title="Cancel" aria-label="Cancel">${ICON.close}</button>
<button class="btn ico primary" id="sgsave" title="${sg?'Save':'Make signal'}" aria-label="${sg?'Save':'Make signal'}">${sg?ICON.check:ICON.plus}</button></div>`);
@@ -280,6 +284,7 @@ const KEY_LINKS=`<a href="https://typesafe.ai" target="_blank" rel="noopener">Ge
async function keySetting(){
closeModal();
await prefsModal();
$<HTMLInputElement>('#ssigon').checked=true; $('#ssigkey').hidden=false;
const k=$<HTMLInputElement>('#stskey'); k.scrollIntoView({block:'center'}); k.focus();
}
document.addEventListener('click',(e: MouseEvent)=>{