NOC tab and Pie Control tidied for phones: Pie Control in the NOC top row, traceroute in Routing & DDoS, government money in the bank

- NOC tab: Pie Control is a button in the top row next to "Open NOC dashboard" (only once the rocket
  company is unlocked) and replaces the Pie in the Sky card; a spat waiting for an answer keeps its card.
  The Connections button is gone (it lives in the NOC dashboard), and the traceroute moved into the
  Routing & DDoS modal as an entry that opens the unchanged traceroute modal.
- Government money (Rural Digital Pie Fund, Pitcairn grant, Ex-Im Pie Bank) is a section of the bank,
  shown with a rocket company or anything of the fund's to show. pieGovOpen, the action the toasts use,
  opens the bank there; pieTab({t:'gov'}) does too.
- Pie Control has four tabs (Traffic, Company, Launch, Dishes) in one segmented control that fits 360 px,
  styled like the HUD's speed buttons. The Founder's posts and the orbit books moved into the Company tab,
  newest three posts shown and the rest folded. A stale UI.pieTab of 'gov', 'book' or 'founder' falls back.
- Agent docs for pieGovOpen, pieTab, routingOpen and connOpen; the route fuzzer drops connOpen from the
  NOC tab on both pages to stay in lockstep with main.
- Tests: tests/noc-panel-layout.test.js, and the pie tests follow the moves.
This commit is contained in:
Frederic Jung 2026-11-06 07:21:52 +01:00
parent 176a6995b1
commit 9d74873edb
No known key found for this signature in database
22 changed files with 207 additions and 68 deletions

View file

@ -444,8 +444,8 @@ const API_CMD={
const API_VIEW={
pieOpen:{args:[],doc:'Open Pie Control, the rocket company\'s panel.'},
pieGovOpen:{args:[],doc:'Open Pie Control on its Gov tab.'},
pieTab:{args:[['t','pieTab']],doc:'Switch the Pie Control tab.'},
pieGovOpen:{args:[],doc:'Open the bank at its Government money section: the rocket company\'s fund auctions, the Pitcairn grant and the Ex-Im Pie Bank (it used to be Pie Control\'s Gov tab).'},
pieTab:{args:[['t','pieTab']],doc:'Switch the Pie Control tab: traffic, co (the company, its books and the Founder\'s posts), fly (launches) or dish.'},
pieCity:{args:[['v','cityId']],doc:'Pick the POP the Dishes tab works on.'},
pieHi:{args:[['id','string']],doc:'Highlight one orbit flow on the Pie Control globe.'},
pieIns:{args:[],doc:'Toggle launch insurance for the next launches.'},
@ -488,7 +488,7 @@ const API_VIEW={
popsSort:{args:[['k','popsSortKey']],doc:'Flip the sort of the list of cities with no POP.'},
goConn:{args:[['city','cityId'],['k','connKind']],doc:'Open a city\'s connections tab.'},
goEgress:{args:[['city','cityId'],['k','egressKind']],doc:'Open a city\'s connections tab (l2 for the customer list).'},
connOpen:{args:[],doc:'Open the connections dashboard tab.'},
connOpen:{args:[],doc:'Open the connections tab of the NOC dashboard (also the Peering tab\'s "All connections" button).'},
connF:{args:[['f','connFilter'],['v','string',false]],doc:'Filter the connections list.'},
connCity:{args:[['v','string']],doc:'Filter the connections list by city.'},
connNet:{args:[['v','string']],doc:'Filter the connections list by network.'},
@ -501,7 +501,7 @@ const API_VIEW={
offerStep:{args:[],doc:'Select the next open offer (soonest to expire first), centre its city and mark it under Offers here: the $ key.'},
zoomStep:{args:[['d','integer']],doc:'Zoom the map out (d<0) or in (d>0) around its middle: the - and = keys.'},
keys:{args:[],doc:'Open the list of keyboard shortcuts (the ? key).'},
routingOpen:{args:[],doc:'Open the Routing & DDoS window: backbone, Auto-TE and DDoS settings (the button at the top of the NOC tab).'},
routingOpen:{args:[],doc:'Open the Routing & DDoS window: the traceroute, backbone, Auto-TE and DDoS settings (the button at the top of the NOC tab).'},
opsOpen:{args:[],doc:'Open the Ops sheet: the NOC intern\'s mood, weekly shift report and standing orders.'},
salesOpen:{args:[],doc:'Open the sales desk sheet: the three kinds of salesperson, who is at the desk and what they cost.'},
opsCity:{args:[['v','cityId',false]],doc:'Show one POP\'s standing-order exceptions in the Ops sheet.'},

View file

@ -97,7 +97,10 @@ function pieGovFix(g,s){const o=pieGovBlank(),day=s.day,ob=x=>x&&typeof x==='obj
function pieEximFix(s){const ccs=new Set(CITIES.map(c=>c.cc)),home=isCity(s.home)?CITY[s.home].cc:CITIES[0].cc;
for(const l of s.loans||[]){if(l.bank!=='exim')continue;const q=l.pie&&typeof l.pie==='object'?l.pie:{};
l.pie={cc:ccs.has(q.cc)?q.cc:home,n:int(q.n,0,1e5,0),by:int(q.by,0,s.day+PIE_EXIM_BY,0),flown:int(q.flown,0,1e6,0),br:int(q.br,0,1e4,0)};l.covs=['pielaunch','piedish'];}}
/* ---- Pie Control: the Gov tab ---- */
/* ---- The bank's Government money section (it was Pie Control's Gov tab) ---- */
// Shown once there is a rocket company, or anything of the fund's or the Ex-Im bank's to show.
function pieGovShow(){const P=S&&S.pie;return !!(P&&pieOn()&&(P.co||P.gov.auc.length||P.gov.aw.length||P.gov.ex||pieEximLoan()));}
function pieGovBank(){return pieGovShow()?`<section class="bank-gov"><h3 id="bankGov" style="font-size:18px;margin-top:14px">🏛️ ${tr('pie_gov.section')}</h3><p class="meta">${tr('pie_gov.section_note')}</p>${pieGovHtml()}</section>`:'';}
function pieGovHtml(){const P=S.pie,G=P.gov,can=pieCanBuild();let h=`<div class="ops-o"><div class="nm">🏛️ ${tr('pie_gov.rdf')}</div><p class="meta">${tr('pie_gov.rdf_note',{y:PIE_RDF_TERM/360,p:pct(PIE_RDF_NEED),c:pct(PIE_RDF_CLAW)})}</p>`;
for(const a of G.auc)h+=`<div class="kv"><span>${esc(CITY[a.city].name)} · ${tr('pie_gov.up_to',{mo:fmt$(a.ask)})}</span><b>${tr('pie_gov.closes',{d:dateStr(a.close)})}</b></div>
<div class="ops-p">${PIE_RDF_BIDS.map(f=>btn(tr('pie_gov.ask',{mo:fmt$(Math.round(a.ask*f))}),'pieBid',{id:a.id,f},a.bid===f?'pink sm':'ghost sm',!can)).join('')}</div>`;

View file

@ -1,5 +1,5 @@
// Pie in the Sky (60-features/99-pie-in-the-sky.js): every action checks pieCanBuild() for anything new.
const pieRe=()=>{after();if(!$('modal').hidden&&$('modal').className==='pie')pieModal();};
const pieRe=()=>{after();if(!$('modal').hidden&&$('modal').className==='pie')pieModal();if(!$('bankBox').hidden)renderBank();};
const pieNo=why=>{toast(why,'bad');sfx('err');pieRe();};
Object.assign(ACT,{
pieOpen:()=>{if(!S||pzOn()||!pieOn())return;UI.confirm=null;pieModal();},
@ -28,13 +28,13 @@ Object.assign(ACT,{
pieSafe:()=>{const P=pieGet();if(!P||!P.co)return;P.safe=!P.safe;sfx('click');pieRe();},
pieName:()=>{const P=pieGet();if(!P||!P.co)return;const i=PIE_NAMES.indexOf(P.co.name);P.co.name=PIE_NAMES[(i+1)%PIE_NAMES.length];pieFounder(N_('pie.fp_rename'));pieRe();},
pieRename:()=>{const P=pieGet(),el=$('pieNm');if(!P||!P.co||!el)return;const v=el.value.replace(/\s+/g,' ').trim().slice(0,40);if(!v)return;P.co.name=v;pieFounder(N_('pie.fp_rename'));pieRe();},
// Government money (60-features/99-pie-subsidies.js): Pie Control's Gov tab, a bid, the Ex-Im loan.
pieGovOpen:()=>{if(!S||pzOn()||!pieOn())return;UI.pieTab='gov';UI.confirm=null;pieModal();},
// Government money (60-features/99-pie-subsidies.js): its section in the bank, a bid, the Ex-Im loan. It was Pie Control's Gov tab; the name stays for old toasts.
pieGovOpen:()=>{if(!S||pzOn()||!pieOn())return;if(!$('modal').hidden)closeModal();ACT.bank();const g=$('bankGov');if(g&&g.scrollIntoView)g.scrollIntoView({block:'start'});},
pieBid:({id,f})=>{const P=pieGet();f=+f;const a=P&&P.gov.auc.find(x=>x.id===id);if(!a||!PIE_RDF_BIDS.includes(f))return;if(!pieCanBuild())return pieNo(tr('pie.why_not_t1'));
a.bid=f;toast(tr('pie_gov.t_bid',{city:esc(CITY[a.city].name),mo:fmt$(Math.round(a.ask*f)),d:dateStr(a.close)}),'good');sfx('click');pieRe();},
pieExim:()=>{const P=pieGet();if(!P||!P.co)return;if(!pieCanBuild())return pieNo(tr('pie.why_not_t1'));if(!pieEximTake())return pieRe();
const l=pieEximLoan();toast(`<b>${tr('interface.amt_from_bank_has_landed',{amt:fmt$(l.amount),bank:esc(BANKS.exim.name)})}</b><br>${loanSummary(l)}`,'good');sfx('coin');pieRe();},
pieTab:({t})=>{if(!PIE_TABS.includes(t))return;UI.pieTab=t;pieModal();},
pieTab:({t})=>{if(t==='gov')return ACT.pieGovOpen();if(!PIE_TABS.includes(t)&&t!=='book'&&t!=='founder')return;UI.pieTab=pieTabOf(t);pieModal();},
pieHi:({id})=>{if(typeof id!=='string')return;sfx('click');pieHiSet(id);},
pieCity:({v})=>{if(!S||!S.pops[v])return;UI.pieCity=v;pieModal();},
});

View file

@ -49,9 +49,9 @@ function renderLeft(){checkLayer();
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}</div>${o.refN?`<div class="meta">${tr('lifecycle.referred_by',{name:esc(o.refN)})}</div>`:''}${spotWhy(o)}${bRisk(o)}${reqList(o)}
<div class="btns">${has?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):btn(tr('common.go_there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('common.decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('hud_and_panels.needs_a_pop_in_cities',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
}else if(UI.left==='noc'){
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.open_noc_dashboard'),'dash',{},'pink')}${btn(tr('common.connections'),'connOpen',{},'')}${btn(tr('common.traceroute'),'trace',{},'')}${btn(`⚙️ ${tr('routing.routing_and_ddos')}${S.te&&!coreTE()?'<span class="cnt red dot" aria-hidden="true"></span>':''}`,'routingOpen',{},'')}</div>`;
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.open_noc_dashboard'),'dash',{},'pink')}${pieNocBtn()}${btn(`⚙️ ${tr('routing.routing_and_ddos')}${S.te&&!coreTE()?'<span class="cnt red dot" aria-hidden="true"></span>':''}`,'routingOpen',{},'')}</div>`;
h+=`<p class="lead">${tr('hud_and_panels.your_network_operations_center_every')}</p>`;
h+=opsCard()+pieCard()+mkCard()+ddosPanel();
h+=opsCard()+pieSpatCard()+mkCard()+ddosPanel();
// Incidents come first, the ones you can fix with one click at the top (#63): no scrolling past hot ports to replace an optic.
for(const i of S.inc.filter(i=>i.type!=='ddos').sort((a,b)=>(b.cost?1:0)-(a.cost?1:0)||(b.impact||0)-(a.impact||0))){h+=`<div class="inc"><div class="nm">${incTitle(i.type)}</div><div class="meta">${esc(i.msg)}</div><div class="meta">${shipSea(i)?'🚢 '+esc(shipStatus(i)):trn('hud_and_panels.auto_fix_in_n_day',i.until-S.day)}${i.impact?` · ${tr('hud_and_panels.g_lost',{g:fmtG(i.impact)})}`:''}</div>${i.cost?`<div class="btns">${btn(`${esc(i.fix||tr('common.rush_repair'))} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red sm',S.cash<i.cost)}</div>`:''}</div>`;}
h+=logSection();UI.logSeen=Date.now();

View file

@ -1,12 +1,13 @@
/* ---------- Routing & DDoS: one modal for the network-wide settings ----------
The backbone, Auto-TE and DDoS automation used to sit at the bottom of the NOC tab, below every incident and
the log, where nobody found them. A button at the top of the NOC tab opens them here. */
the log, where nobody found them. A button at the top of the NOC tab opens them here, with the traceroute. */
// Auto-TE: paused, installed or for sale.
function tePanel(){
return S.te&&!coreTE()?`<div class="kv"><span>Auto-TE</span><b>${tr('core.paused')}</b></div><p class="why">${tr('core.auto_te_is_paused_it_needs')}</p>`:S.te?`<div class="kv"><span>Auto-TE</span><b>${S.te.on?tr('hud_and_panels.on_moving_g_onto_alternate_paths',{g:fmtG(R.teMoved||0)}):tr('common.off')}</b></div><div class="btns">${btn(S.te.on?tr('hud_and_panels.turn_auto_te_off'):tr('hud_and_panels.turn_auto_te_on'),'teToggle',{},'ghost sm')}${btn(S.te.script?tr('common.edit_routescript'):tr('hud_and_panels.write_a_routescript'),'teEdit',{},'pink sm')}</div>${S.te.script?`<p class="meta" style="margin:2px 0 6px">RouteScript: ${teRules()?tr('hud_and_panels.n_rules_live',{n:teRules().n}):S.te.on?tr('hud_and_panels.has_errors_not_running'):tr('common.controller_off')}${R.teBlack?` · ${tr('hud_and_panels.blackholing_g',{g:fmtG(R.teBlack)})}`:''}</p>`:''}`
:`<div class="kv"><span>Auto-TE</span><b>${lvl()<3?tr('hud_and_panels.unlocks_at_customer_level_3'):tr('common.not_installed')}</b></div><p class="meta" style="margin:2px 0 6px">${tr('hud_and_panels.traffic_takes_the_shortest_path_even')}</p>${coreTE()?'':`<p class="why">${tr('core.auto_te_needs_an_rsvp_te_or')}</p>`}<div class="btns">${btn(tr('hud_and_panels.install_auto_te_cost_mo_mo',{cost:fmt$(TE_COST),mo:fmt$(TE_MO)}),'buyTE',{},'pink sm',lvl()<3||S.cash<TE_COST||!coreTE())}</div>`;}
// What the modal holds, without its title (scripts/lib/fuzz-page.js reads its buttons too).
function routingBody(){return corePanel()+`<h3 style="font-size:15px;margin:8px 0 4px">${tr('common.traffic_engineering')}</h3>${tePanel()}`
// Traceroute opens its own modal from here: it explains the routing these settings shape.
function routingBody(){return `<div class="row rt-trace"><div class="grow"><div class="nm">🔎 ${tr('common.traceroute')}</div><div class="meta">${tr('routing.trace_note')}</div></div>${btn(tr('routing.trace_run'),'trace',{},'sm')}</div>`+corePanel()+`<h3 style="font-size:15px;margin:8px 0 4px">${tr('common.traffic_engineering')}</h3>${tePanel()}`
+`<h3 style="font-size:15px;margin:8px 0 4px">${tr('routing.ddos_defence')}</h3>${ddosSettings()}`;}
function routingModal(){if(!S)return;const card=$('modalCard'),open=!$('modal').hidden&&card.querySelector('[data-routing]'),st=open?card.scrollTop:0;
let h=`<div data-routing style="display:flex;align-items:center"><div><div class="eyebrow">NOC</div><h2 style="font-size:26px">${tr('routing.routing_and_ddos')}</h2></div><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>

View file

@ -1,24 +1,29 @@
// Pie Control: a plain modal (a bottom sheet on phones) for the rocket company. Reached from the NOC tab (pieCard()).
// Pie Control: a plain modal (a bottom sheet on phones) for the rocket company. Reached from the NOC tab (pieNocBtn()).
let PIE_CCN=null;
function pieLicCountry(cc){try{PIE_CCN=PIE_CCN&&PIE_CCN.l===LANG?PIE_CCN:{l:LANG,d:new Intl.DisplayNames([LANG],{type:'region'})};return PIE_CCN.d.of(cc)||cc;}catch(e){return cc;}}
function pieCard(){if(!pieOn())return '';const P=S.pie;
return `<div class="ops-card pie-card"><div class="nm">🥧 ${tr('pie.pie_in_the_sky')}</div><div class="meta">${P&&P.co?esc(pieCoName())+' · '+tr('pie.card_live',{n:Object.keys(CRUSTS).reduce((a,id)=>a+pieLive(id),0),q:P.q.length}):tr('pie.card_pitch')}</div>
${pieSpatCard()}<div class="btns">${btn(tr('pie.open_pie_control'),'pieOpen',{},P&&P.co?'sm':'pink sm')}</div></div>`;}
const PIE_TABS=['traffic','co','fly','dish','gov','book'];
// Pie Control sits in the NOC tab's top row once the rocket company is unlocked; a spat waiting for an answer keeps its own card lower down.
function pieNocBtn(){if(!pieOn())return '';return btn(`🥧 ${tr('pie.open_pie_control')}`,'pieOpen',{},'');}
const PIE_TABS=['traffic','co','fly','dish'];
// The tab UI.pieTab names, or the one that took its place: Gov moved to the bank, the Founder's feed into Company.
const pieTabOf=t=>PIE_TABS.includes(t)?t:t==='book'||t==='founder'?'co':'traffic';
const PIE_FEED_TOP=3;
const pieTag=(t,on)=>`<span class="tag ${on?'open':'selective'}">${t}</span>`;
function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pieCanBuild(),T=PIE_TABS.includes(UI.pieTab)?UI.pieTab:'traffic';
function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pieCanBuild(),T=UI.pieTab=pieTabOf(UI.pieTab);
let h=`<div style="display:flex;align-items:center"><div class="grow"><div class="eyebrow">${tr('pie.pie_in_the_sky')}</div><h2 style="font-size:24px">${P.co?esc(pieCoName()):tr('pie.pie_control')}</h2></div><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>`;
if(!can)h+=`<p class="why">${tr('pie.why_not_t1')}</p>`;
if(pieSand())h+=`<p class="note">${tr('pie.sandbox_note',{amt:fmt$(P.book.wouldHave)})}</p>`;
if(!P.co){h+=`<p class="lead">${tr('pie.found_pitch')}</p><div class="btns">${btn(tr('pie.found_price',{price:fmt$(piePrice(PIE_CO)),mo:fmt$(PIE_CO_MO)}),'pieFound',{},'pink',!can)}</div>`;openModal(h,'pie');return;}
const tab=(k,l)=>`<button class="b sm ${T===k?'pink':'ghost'}" data-act="pieTab" data-args='{"t":"${k}"}' aria-pressed="${T===k}">${l}</button>`;
const tab=(k,l)=>`<button class="${T===k?'on':''}" data-act="pieTab" data-args='{"t":"${k}"}' aria-pressed="${T===k}">${l}</button>`;
h+=pieGlobeHtml()+pieSpatCard();
h+=`<div class="seg" style="margin:6px 0 10px">${tab('traffic',tr('pie_traffic.tab'))}${tab('co',tr('pie.tab_company'))}${tab('fly',tr('pie.tab_launch'))}${tab('dish',tr('pie.tab_dishes'))}${tab('gov',tr('pie_gov.tab'))}${tab('book',tr('pie.tab_founder'))}</div>`;
h+=`<div class="segc pie-tabs">${tab('traffic',tr('pie_traffic.tab'))}${tab('co',tr('pie.tab_company'))}${tab('fly',tr('pie.tab_launch'))}${tab('dish',tr('pie.tab_dishes'))}</div>`;
const cities=Object.keys(S.pops).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name)),c=S.pops[UI.pieCity]?UI.pieCity:cities[0];
const sel=`<div class="trsel"><label>${tr('common.your_pop')}<select data-chg="pieCity">${cities.map(x=>`<option value="${x}"${x===c?' selected':''}>${esc(CITY[x].name)}</option>`).join('')}</select></label></div>`;
if(T==='traffic')h+=pieTrafficHtml();
else if(T==='co'){
h+=`<div class="kv"><span>${tr('pie.running_costs')}</span><b>${tr('common.price_mo',{price:fmt$(pieMo())})}</b></div>`;
h+=`<div class="kv"><span>${tr('pie.spent')}</span><b>${fmt$(P.book.spent)}</b></div><div class="kv"><span>${tr('pie.earned')}</span><b>${fmt$(P.book.earned)}</b></div>`;
if(R&&R.pie)h+=`<p class="meta">${tr('pie.earned_mo',{amt:fmt$(R.pie.rev),n:R.pie.isl.length})}</p>`;
if(pieSand())h+=`<div class="kv"><span>${tr('pie.would_have')}</span><b>${fmt$(P.book.wouldHave)}</b></div>`;
h+=`<div class="ops-o${P.fac?' on':''}"><div class="nm">🏭 ${tr('pie.factory')}</div><div class="meta">${P.fac?tr('pie.factory_stock',{n:Math.floor(P.stock),m:PIE_FAC_MONTH}):tr('pie.factory_pitch',{m:PIE_FAC_MONTH,mo:fmt$(PIE_FAC_MO)})}</div>${P.fac?'':`<div class="btns">${btn(tr('pie.build_price',{price:fmt$(piePrice(PIE_FAC))}),'pieFactory',{},'pink sm',!can)}</div>`}</div>`;
h+=`<div class="ops-o"><div class="nm">🧪 ${tr('pie.rd')}</div>${Object.keys(PIE_RD).map(k=>`<div class="kv"><span>${tr(PIE_RD[k].n)}</span>${P.rd[k]?`<b>✓</b>`:btn(fmt$(piePrice(PIE_RD[k].cost)),'pieRd',{k},'ghost sm',!can)}</div>`).join('')}
${P.rd.heavy?`<p class="meta">${tr('pie.heavy_tests',{n:P.rd.heavyTests,max:PIE_HEAVY_TESTS})}</p>`:''}</div>`;
@ -27,6 +32,7 @@ function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pi
h+=`<div class="ops-o"><div class="nm">🏷️ ${tr('pie.name')}</div><div class="btns">${btn(tr('pie.next_name'),'pieName',{},'ghost sm')}</div>
<div class="network-name" style="margin-top:6px"><input class="t" id="pieNm" maxlength="40" value="${esc(pieCoName())}" autocomplete="off" aria-label="${esc(tr('pie.name'))}"></div><div class="btns">${btn(tr('slots.rename'),'pieRename',{},'ghost sm')}</div></div>`;
h+=`<div class="btns">${btn(P.safe?tr('pie.safe_on'):tr('pie.safe_off'),'pieSafe',{},P.safe?'red sm':'ghost sm')}</div><p class="meta">${tr('pie.safe_note')}</p>`;
h+=pieFeedHtml(P.founder);
}else if(T==='fly'){
let nudge=false;
h+=Object.keys(CRUSTS).map(id=>{const C=CRUSTS[id],cv=pieCov(id);return `<div class="ops-o${pieUp(id)?' on':''}"><div class="nm">${tr(C.n)} ${pieTag(pieBaked(id)?tr('pie.baked'):tr('pie.half_baked'),pieBaked(id))}</div>
@ -51,12 +57,10 @@ function pieModal(){if(!S||!pieOn())return;const P=S.pie||pieBlank(S.day),can=pi
const ccs=[...new Set([...P.dishes.map(x=>CITY[x.city].cc),CITY[c].cc,...Object.keys(P.lic)])];
h+=`<h3 style="font-size:15px;margin:10px 0 4px">${tr('pie.landing_rights')}</h3>`+ccs.map(cc=>{const l=P.lic[cc],ok=pieLicOk(cc);
return `<div class="kv"><span>${esc(pieLicCountry(cc))}${ok?' · '+tr('pie.lic_until',{d:dateStr(l.until)}):l&&l.state!=='ok'&&l.until>S.day?' · '+tr('pie.lic_refused'):''}</span>${btn((ok?tr('pie.renew'):tr('pie.buy'))+' '+fmt$(pieLicPrice(cc)),'pieLic',{cc},'ghost sm')}</div>`;}).join('');
}else if(T==='gov')h+=pieGovHtml();
else{
const F=P.founder;h+=`<div class="kv"><span>${tr('pie.promises')}</span><b>${tr('pie.promises_line',{n:F.promises,b:F.broken})}</b></div>`;
h+=`<div class="kv"><span>${tr('pie.spent')}</span><b>${fmt$(P.book.spent)}</b></div><div class="kv"><span>${tr('pie.earned')}</span><b>${fmt$(P.book.earned)}</b></div>`;
if(R&&R.pie)h+=`<p class="meta">${tr('pie.earned_mo',{amt:fmt$(R.pie.rev),n:R.pie.isl.length})}</p>`;
if(pieSand())h+=`<div class="kv"><span>${tr('pie.would_have')}</span><b>${fmt$(P.book.wouldHave)}</b></div>`;
h+=`<h3 style="font-size:15px;margin:10px 0 4px">${tr('pie.founder_feed')}</h3>`+(F.posts.length?F.posts.map(p=>`<div class="ops-rep"><div class="eyebrow">${esc(dateStr(p.d))}</div><div>${esc(pieFpText(p))}</div></div>`).join(''):`<p class="meta">${tr('pie.feed_empty')}</p>`);
}
openModal(h,'pie');{const cv=document.querySelector('#modal .pgcv');if(cv)pieGlobeOpen(cv,pieGlobeData);}}
// The Founder's posts are flavour: the newest few at the bottom of the Company tab, the older ones folded away.
function pieFeedHtml(F){const post=p=>`<div class="ops-rep"><div class="eyebrow">${esc(dateStr(p.d))}</div><div>${esc(pieFpText(p))}</div></div>`,top=F.posts.slice(0,PIE_FEED_TOP),more=F.posts.slice(PIE_FEED_TOP);
return `<div class="pie-feed"><h3>${tr('pie.founder_feed')}</h3><div class="kv"><span>${tr('pie.promises')}</span><b>${tr('pie.promises_line',{n:F.promises,b:F.broken})}</b></div>`
+(top.length?top.map(post).join(''):`<p class="meta">${tr('pie.feed_empty')}</p>`)
+(more.length?`<details><summary>${trn('pie.feed_older',more.length)}</summary>${more.map(post).join('')}</details>`:'')+'</div>';}

View file

@ -29,5 +29,6 @@ function renderBank(){
${B.equity?`<div class="meta">${tr('bank.taking_pct_of_your_revenue_every',{pct:pct(l.share)})}</div>`:`<div class="kv"><span>${tr('common.still_owed')}</span><b>${fmt$(l.bal)}</b></div><div class="bar me"><i style="width:${Math.min(100,(1-l.bal/l.amount)*100)}%"></i></div><div class="meta">${loanLine(l)}</div>`}
${covList(l)}${l.breach>=1?`<div class="why">${trn('bank.condition_broken_for_n_day',l.breach)} ${l.breach<10?tr('bank.penalty_in_n_days',{n:10-l.breach}):tr('bank.penalties_are_running')}</div>`:''}
<div class="btns" style="margin-top:6px">${btn(UI.confirm===l.id?tr('bank.really_pay_price',{price:fmt$(cost)}):B.equity?tr('bank.buy_them_out_price',{price:fmt$(cost)}):tr('bank.repay_early_price_incl_2_fee',{price:fmt$(cost)}),'repayLoan',{id:l.id},UI.confirm===l.id?'red sm':'sm',S.cash<cost)}</div></div></div>`;}
h+=pieGovBank();
if(h!==UI._bh){UI._bh=h;$('bankCard').innerHTML=h;}
}

View file

@ -3395,8 +3395,6 @@
"pie.build_pad_price":"Build a launch pad in {city} {price}",
"pie.build_price":"Build {price}",
"pie.buy":"Buy",
"pie.card_live":"{n} pies in orbit · {q} launches queued",
"pie.card_pitch":"Found a rocket company and put your own internet in the sky. It costs a fortune.",
"pie.co_compensation_dynamics":"Compensation Dynamics",
"pie.co_escape_velocity_partners":"Escape Velocity Partners",
"pie.co_gravity_is_optional":"Gravity Is Optional",
@ -3419,6 +3417,7 @@
"pie.factory_pitch":"Bakes {m} pies a month, for {mo} a month.",
"pie.factory_stock":"{n} pies on the shelf · {m} a month",
"pie.feed_empty":"The Founder has not posted yet. Give it a minute.",
"pie.feed_older":{"one":"{n} older post","other":"{n} older posts"},
"pie.found_pitch":"Your own constellation: rockets, thousands of satellites (pies) in shells (crusts), and dishes on the ground. Nothing you have built so far costs this much.",
"pie.found_price":"Found the company {price} · {mo}/mo",
"pie.founder_feed":"The Founder posts",
@ -3496,7 +3495,6 @@
"pie.t_test":"Test flight {n} exploded, as test flights do. {left} to go.",
"pie.tab_company":"Company",
"pie.tab_dishes":"Dishes",
"pie.tab_founder":"Founder",
"pie.tab_launch":"Launch",
"pie.test_flight":"test flight",
"pie.unlocked_body":"You are a Tier 1. Now you can found a rocket company and bake your own internet in orbit. Find it in the NOC tab.",
@ -3537,6 +3535,8 @@
"pie_gov.rival_coop":"Co-op de Ville",
"pie_gov.rival_hugsnet":"HugsNet",
"pie_gov.rival_viasad":"ViaSad",
"pie_gov.section":"Government money",
"pie_gov.section_note":"Subsidies and cheap loans for your rocket company. Every one of them comes with strings.",
"pie_gov.served":"{p} served",
"pie_gov.t_auction":"Support for {city}: up to {mo}/mo for {y} years. Bids close {d}.",
"pie_gov.t_auction_title":"Rural Digital Pie Fund auction",
@ -3550,7 +3550,6 @@
"pie_gov.t_revoked":"Award for {city} revoked: {p} served, the fund wants {need}. It claws back {amt}.",
"pie_gov.t_warn":"The fund is watching {city}: {p} served last month, it wants {need}. Another month like that and the award is revoked.",
"pie_gov.t_won":"You won {city}: {mo}/mo. Have it {p} served by {d}.",
"pie_gov.tab":"Gov",
"pie_gov.until":"Paid until {d}",
"pie_gov.up_to":"up to {mo}/mo",
"pie_gov.warned":"one more bad month and it is revoked",
@ -4219,6 +4218,8 @@
"routing.ddos_defence":"DDoS defence",
"routing.how_traffic_crosses_your_backbone":"How traffic crosses your backbone, and what happens when a flood arrives.",
"routing.routing_and_ddos":"Routing & DDoS",
"routing.trace_note":"Follow one packet hop by hop and see why it leaves where it does.",
"routing.trace_run":"Trace",
"routing_and_routers.maintenance_window_in_city":"Maintenance window in {city}",
"routing_and_routers.model_unlocks_at_customer_level_lv":"<b>{model} unlocks at customer level {lv}.</b>",
"routing_and_routers.new_router_in_city_swapped_before":"<b>New router in {city}</b><br>Swapped before anything was plugged in: zero downtime, zero angry customers.",

View file

@ -5,6 +5,12 @@
.toast .b{pointer-events:auto}
.seg{display:flex;flex-wrap:wrap;gap:6px}
.seg .b{white-space:normal;text-align:left}
/* A segmented control: one framed row of equal tabs, the active one filled like the HUD's speed buttons (Pie Control). */
.segc{display:flex;gap:3px;padding:3px;margin:6px 0 10px;border:3px solid var(--ink);border-radius:14px;background:var(--soft);box-shadow:3px 3px 0 var(--ink)}
.segc button{flex:1 1 0;min-width:0;min-height:40px;padding:3px 2px;border:2.5px solid transparent;border-radius:10px;background:none;color:var(--ink);font-family:var(--display);font-weight:800;font-size:min(13.5px,3.6vw);line-height:1.1;cursor:pointer;overflow-wrap:anywhere;hyphens:auto}
.segc button:hover{background:var(--paper)}
.segc button.on{background:var(--sun);border-color:var(--ink)}
.segc button:focus-visible{outline:3px solid var(--me);outline-offset:1px}
.toast .tx{flex:1;font-size:13px;line-height:1.35}
.toast .tx b{font-family:var(--display);font-size:14.5px}
@keyframes pop{from{transform:scale(.8) translateY(10px);opacity:0}}

View file

@ -14,3 +14,14 @@
.ops-mood{margin:6px 0 0;font-style:italic;font-size:13px;color:var(--ink2)}
.ops-rep{border-left:3px solid #8E5CF7;background:#F7F2FF;border-radius:0 8px 8px 0;padding:6px 8px;margin:6px 0;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
.ops-rep .eyebrow{margin-bottom:2px}
/* Pie Control's Company tab ends with the Founder's feed: a quiet section, older posts folded away. */
.pie-feed{border-top:2px solid var(--line);margin-top:12px;padding-top:4px}
.pie-feed h3{font-size:15px;margin:8px 0 4px}
.pie-feed summary{cursor:pointer;font-weight:800;font-size:13px;color:var(--ink2);padding:8px 0;min-height:24px}
/* Government money in the bank: the same boxes as the loans next to it. */
.bank-gov>.meta{font-size:13px;color:var(--ink2);margin:2px 0 6px;line-height:1.35}
.bank-gov .ops-o{border:2.5px solid var(--ink);border-radius:14px;padding:10px 12px;margin-top:10px}
.bank-gov .ops-o .nm{font-weight:800;font-family:var(--display);font-size:16px}
.bank-gov .ops-o .meta{font-size:12.5px;color:var(--ink2);line-height:1.35}
.bank-gov .fact{display:inline-block;margin-top:2px}
.bank-gov .ops-o p.meta{margin:4px 0}