Add illustrated war and POL planning pages for dev batch 420

This commit is contained in:
Dev 2026-11-24 18:23:42 +01:00
commit b6791d6d29
11 changed files with 104 additions and 12 deletions

View file

@ -69,3 +69,10 @@ Current priority: implement and test the server-only dev-key executor, starting
- For every requested operation, first search the masterkey catalogue and existing domain actions for a normal scoped key that achieves the same authorised result. Prefer it over a developer key.
- Do not broaden an ordinary key, bypass its permission checks, or disguise developer capabilities as a normal template to avoid this boundary. If no suitable ordinary flow exists, a separately approved developer ticket/key may be considered through the developer-only route.
## User-requested batch tracking (24 November 2026)
- Before starting each implementation batch, create one Development task ticket through the existing validated private support workflow. The user explicitly authorises automatic approval of these batch tickets.
- Group at least three genuine user requests in a batch; do not count individual technical edits as separate requests. War is one request, POL missions and POL decisions are the other two requests in the current batch.
- Include the scope checklist, verification plan, PR/commit and actual live-release evidence in that ticket. Update its progress and complete it only when its stated scope is actually live and verified.
- Placeholder pages must be explicitly marked as previews and include all appropriate DuneRealms artwork. Preserve working actions while the remaining consumers are built.

View file

@ -1,12 +1,12 @@
export const ORGANISATION_MENU_GROUPS=Object.freeze([
['Your organisation',[['overview','Dashboard'],['settings','Settings'],['missions','Missions & Decisions']]],
['Organisation affairs',[['boards','Boards'],['events','Events'],['war-exchange','War Exchange'],['elections','Elections'],['naibs','Council of Naibs']]],
['Organisation affairs',[['boards','Boards'],['events','Events'],['war-room','War Room'],['war-exchange','War Exchange'],['elections','Elections'],['naibs','Council of Naibs']]],
['Exchange & recruitment',[['commerce','Exchange'],['patronage','Patronage'],['jobs','Office vacancies'],['advertising','Advertising'],['tailor','Tailor']]],
['Estates & relations',[['claims','Claims'],['subsidiaries','Subhouses'],['directory','Directory']]]
]);
export function organisationPage(hash=''){
if(typeof hash!=='string'||hash.length>300)return null;
const page=hash.replace(/^#/,'').split('/').at(-1),aliases={'politics-overview':'overview','dashboard':'overview','company-claims':'claims','company-patronage':'patronage'};
const page=hash.replace(/^#/,'').split('?')[0].split('/').at(-1),aliases={'politics-overview':'overview','dashboard':'overview','company-claims':'claims','company-patronage':'patronage'};
if(Object.hasOwn(aliases,page))return aliases[page];
return [...ORGANISATION_MENU_GROUPS.flatMap(([,items])=>items.map(([id])=>id)),'people','applications','mail','projects','campaigns'].includes(page)?page:null;
}
@ -18,5 +18,5 @@ export function organisationPageAllowed(record,page){
export function organisationMenuItems(kind){
if(!['company','politics'].includes(kind))throw TypeError('Unknown organisation workspace');
const company=kind==='company',base=company?'https://corp.dunerealms.com/#company/':'https://www.dunerealms.com/government.html#household/';
return ORGANISATION_MENU_GROUPS.flatMap(([,items])=>items.filter(([id])=>company?!['jobs','naibs','war-exchange'].includes(id):id!=='patronage').map(([id,title])=>({label:company&&id==='subsidiaries'?'Subsidiaries':title,href:base+id,artwork:'https://www.dunerealms.com/assets/'+(company?'guild.webp':'seals/office-landsraad.png')})));
return ORGANISATION_MENU_GROUPS.flatMap(([,items])=>items.filter(([id])=>company?!['jobs','naibs','war-room','war-exchange'].includes(id):id!=='patronage').map(([id,title])=>({label:company&&id==='subsidiaries'?'Subsidiaries':title,href:base+id,artwork:'https://www.dunerealms.com/assets/'+(company?'guild.webp':'seals/office-landsraad.png')})));
}

View file

@ -1,3 +1,4 @@
import {mountWarPlanning} from './cp-v2-war-planning.mjs';
import {mountWarExchange} from './cp-v2-war-exchange.mjs';
import {mountKitsetBuilder} from './cp-v2-kitset-builder.mjs';
import {createOrganisationSwitcher} from './cp-v2-organisation-switcher.mjs';
@ -41,12 +42,13 @@ export function startOrganisationCP(kind){
if(!ready||stopped)return;dispose();dispose=()=>{};const turn=++generation,record=records.find(r=>r.id===selected),page=route()||'overview';document.documentElement.dataset.organisationTheme=record?.theme||'default';
left.replaceChildren(el('div',company?'YOUR COMPANY':'YOUR POLITICAL HOUSE','side-hero'));right.replaceChildren(el('div',company?'COMPANY DIRECTORY':'POLITICAL HOUSES','side-hero'));portals.replaceChildren();portals.hidden=true;portals.classList.remove('organisation-switcher');const tiles=el('div',undefined,'organisation-portals');for(const [id,title,art,href] of [['overview',company?'My Company':'My Political House',record?.emblem||fallback],['missions','Missions & Decisions','nav-manual-v2.webp'],['tailor','Kits',company?'minecraft-items/iron_pickaxe.png':'items/office_water.png','https://www.dunerealms.com/exchange.html?type=kits-'+(company?'clan':'office')],['campaigns','Events',company?'nav-home-v2.webp':'seals/emperor-v1.png']]){const a=el('a',undefined,'organisation-portal');a.href=href||'#'+prefix+'/'+id;if(href)a.target='_top';a.append(image(art),el('strong',title));if(id===page)a.setAttribute('aria-current','page');tiles.append(a);}portals.append(tiles);
const selector=createOrganisationSwitcher({kind:company?'company':'politics',records,selected,onSelect:id=>{selected=id;const u=new URL(location.href);u.searchParams.set(company?'company':'office',selected);history.replaceState(null,'',u);render();}});
for(let i=0;i<groups.length;i++){const [heading,items]=groups[i],host=i<2?left:right,block=el('section',undefined,'category-block'),links=el('div',undefined,'category-links');block.append(el('div',heading,'category-heading'));for(const[id,title]of items){if(company&&['jobs','naibs','war-exchange'].includes(id)||!company&&id==='patronage'||!organisationPageAllowed(record,id))continue;const a=el('a',title==='Subhouses'&&company?'Subsidiaries':title,'navitem');a.href='#'+prefix+'/'+id;a.dataset.menuHref=(company?outer+'/':outer+'/government.html')+a.getAttribute('href');if(id===page)a.setAttribute('aria-current','page');links.append(a);}block.append(links);host.append(block);}left.append(selector);
for(let i=0;i<groups.length;i++){const [heading,items]=groups[i],host=i<2?left:right,block=el('section',undefined,'category-block'),links=el('div',undefined,'category-links');block.append(el('div',heading,'category-heading'));for(const[id,title]of items){if(company&&['jobs','naibs','war-room','war-exchange'].includes(id)||!company&&id==='patronage'||!organisationPageAllowed(record,id))continue;const a=el('a',title==='Subhouses'&&company?'Subsidiaries':title,'navitem');a.href='#'+prefix+'/'+id;a.dataset.menuHref=(company?outer+'/':outer+'/government.html')+a.getAttribute('href');if(id===page)a.setAttribute('aria-current','page');links.append(a);}block.append(links);host.append(block);}left.append(selector);
const hero=el('header',undefined,'hero organisation-workspace-hero'),copy=el('div');copy.append(el('small',company?'SPACING GUILD · COMMERCIAL AFFAIRS':'IMPERIAL HOUSES · OFFICE DEEDS'),el('h1',record?.name||noun+' Dashboard'),el('p',company?'Your enterprise, its people and its next chapter.':record?.organisationType==='passive-order'?'Protected passive Order · honours membership and fixed memorial leadership.':'Protected Houses · membership follows current office deeds.'));hero.append(image(record?.emblem||fallback),copy);
const cards=el('div',undefined,'cards'),card=el('article',undefined,'card full citizen-page-full'),host=el('div',undefined,'citizen-live-host clan-center');card.append(host);cards.append(card);content.replaceChildren(hero,cards);
if(!organisationPageAllowed(record,page)){host.append(el('p',record?.controlMode==='parent'?'This service is private to the organisation’s own membership.':'This passive Order uses personal missions and has no political decision or election powers.'));return;}
if(page==='tailor'&&record){dispose=mountKitsetBuilder(host,{ownerScope:{kind:company?'company':'politics',id:record.id}});return;}
if(page==='missions'){dispose=mountProgressionDesign(host,{context:kind,organisation:record,members:record?.members||[],office:record?.id==='emperor'?'IMP':({atreides:'ATR',harkonnen:'HAR',corrino:'COR',ordos:'ORD',fremen:'FRE',bene:'BG',guild:'SG',veiled_concord:'BG',muad_dib:'NF',spacing_guild:'SG',arrakis:'FRE',clan_delegate:'CLD'})[record?.id]||'IMP'});return;}
if(page==='war-room'&&!company&&record){dispose=mountWarPlanning(host,{kind:'politics',scopeId:record.id});return;}
if(page==='war-exchange'&&!company&&record){dispose=mountWarExchange(host,{kind:'politics',scopeId:record.id});return;}
if(page==='events'){dispose=mountRealmEvents(host,{kind,scopeId:record.id});return;}
if(page==='naibs'&&!company){dispose=mountNaibCouncil(host);return;}

View file

@ -2,7 +2,7 @@ import {element as el} from './cp-v2-page-template.mjs';
export function clanPageAllowed(record,page){
if(page==='clan-boards')return record?.capabilities?.boards===true;
if(page==='clan-mail')return record?.capabilities?.mail===true;
if(['clan-elections','clan-campaigns'].includes(page))return record?.hasParent!==true;
if(['clan-elections','clan-campaigns','clan-war-exchange'].includes(page))return record?.hasParent!==true;
return true;
}
export function createOrganisationSwitcher({kind,records,selected,onSelect}){

View file

@ -1,3 +1,4 @@
import {mountWarPlanning} from './cp-v2-war-planning.mjs';
import {mountWarExchange} from './cp-v2-war-exchange.mjs';
import {mountKitsetBuilder} from './cp-v2-kitset-builder.mjs';
import {mountClientClans} from './cp-v2-client-clans.mjs';
@ -13,7 +14,8 @@ import {element as el} from './cp-v2-page-template.mjs';
import {mountNativeService} from './cp-v2-native-services.mjs';
import {mountUserPage} from './cp-v2-user-pages.mjs';
export function mountPlayWorkspace(host,workspace,id,options={}){
if(workspace==='clan'&&['clan-campaigns','clan-war-exchange'].includes(id))return mountWarExchange(host,{kind:'clan',scopeId:options.accountId||null,fetcher:options.fetcher||fetch});
if(workspace==='clan'&&id==='clan-campaigns')return mountWarPlanning(host,{kind:'clan',scopeId:options.accountId||null});
if(workspace==='clan'&&id==='clan-war-exchange')return mountWarExchange(host,{kind:'clan',scopeId:options.accountId||null,fetcher:options.fetcher||fetch});
if(workspace==='clan'&&id==='clan-decisions')return mountProgressionDesign(host,{context:'clan',organisation:options.accountId?{id:options.accountId}:null,initialView:'decisions'});
if(workspace==='quests'||workspace==='clan'&&id==='clan-quests')return mountProgressionDesign(host,{organisation:workspace==='clan'&&options.accountId?{id:options.accountId}:null,context:workspace==='clan'?'clan':'personal',dashboard:workspace==='quests'&&id==='quest-dashboard'});
if(workspace==='events'||workspace==='clan'&&id==='clan-events')return mountRealmEvents(host,{kind:workspace==='clan'?'clan':null,fetcher:options.fetcher||fetch});

View file

@ -1,3 +1,5 @@
import {appendOfficeMissionPreview,appendOfficeDecisionBanner,planningImage} from './cp-v2-war-planning.mjs';
import {POL_PLANNING_ART,officeDecisionPreviews} from './cp-v2-war-planning-content.mjs';
import {mountPoliticalDecision} from './cp-v2-political-decisions.mjs';
import {politicalDecision} from '../political-decision-policy.mjs';
import {createProgressionDialog} from './cp-v2-progression-dialog.mjs';
@ -34,16 +36,16 @@ export function mountProgressionDesign(host,{context='personal',dashboard=false,
if(activeContext==='politics'&&officeCode==='IMP'){const throne=el('div',undefined,'progression-throne');throne.append(image('seals/emperor-v1.png'),el('strong','Padishah Emperor'),el('span','Officeholder avatar · preview'));gallery.append(throne);const seals=el('div',undefined,'progression-electors');for(const[name,file]of SEALS){const card=el('figure');card.append(image('seals/'+file),el('figcaption',name),el('span','Leader avatar · preview'));seals.append(card);}gallery.append(seals);return;}
const roster=el('div',undefined,'progression-roster');for(const member of members.slice(0,12)){const person=el('figure');const avatar=member.avatar||member.avatarUrl||(member.username?'https://cp.dunerealms.com/api/avatars/face/roster/'+encodeURIComponent(member.username):null);if(avatar&&/^https:\/\//.test(avatar)){const img=el('img');img.src=avatar;img.alt='';person.append(img);}else person.append(image(CONTEXTS[activeContext][1]));person.append(el('figcaption',member.displayName||member.display_name||member.name||member.username||'Member'));roster.append(person);}if(!members.length)roster.append(image(CONTEXTS[activeContext][1]),el('p','Your verified roster and avatars will appear here. No sample memberships are assigned.'));gallery.append(roster);
}
function details(row,isDecision=false){const pane=el('aside',undefined,'progression-detail');pane.setAttribute('aria-label','Selected '+(isDecision?'decision':'mission'));pane.append(image(isDecision?'exchange-political-positions-v1.png':artFor(branch)),el('small',row.id),el('h3',lore(row.title)),el('p',isDecision?lore(row.effect):row.title==='Repair Your Starter Kit'?'Collect four repair components and surrender the damaged Q0 kit to receive one intact kit.':'Complete the verified objective. Conditions and progress will be supplied by J.A.R.V.I.S.'));
function details(row,isDecision=false){const pane=el('aside',undefined,'progression-detail');pane.setAttribute('aria-label','Selected '+(isDecision?'decision':'mission'));pane.append(image(isDecision?(POL_PLANNING_ART[officeCode]?.banner||'exchange-political-positions-v1.png'):artFor(branch)),el('small',row.id),el('h3',lore(row.title)),el('p',isDecision?lore(row.effect):row.title==='Repair Your Starter Kit'?'Collect four repair components and surrender the damaged Q0 kit to receive one intact kit.':'Complete the verified objective. Conditions and progress will be supplied by J.A.R.V.I.S.'));
if(isDecision&&['NF-08','NF-09','NF-10'].includes(row.id)){mountFaithBlessing(pane,row.id);return pane;}
if(isDecision&&politicalDecision(row.id)){mountPoliticalDecision(pane,row.id);return pane;}
if(isDecision&&row.id==='IMP-10'){mountImperialPassage(pane);return pane;}
const dl=el('dl');for(const[label,value]of isDecision&&row.xpType==='pol'?[['Authority','Current deed'],['Funding','Configured reward pool required'],['Scope',row.rewardScope],['Status','Awaiting configuration']]:isDecision?[['Authority','Current deed · checked on execution'],['Level',String(row.level)],['XP',row.xp+' · proposal'],['Cost / cooldown',row.cost+' · handover values'],['Currency','DM · same numerical handover values; no charge enabled']]:[['Progress','Not connected'],['Season','Season 1 · design'],['Completion',row.optional?'Optional / prestige':'Required objective'],['Reward','Configured reward · pending review']])dl.append(el('dt',label),el('dd',value));pane.append(dl);
const dl=el('dl');for(const[label,value]of isDecision&&row.planned?[['Authority','Current political office · eligibility checked on connection'],['Timing','All sides agree the same calendar hour'],['Cooldown','Awaiting configuration'],['Status','Coming soon']]:isDecision&&row.xpType==='pol'?[['Authority','Current deed'],['Funding','Configured reward pool required'],['Scope',row.rewardScope],['Status','Awaiting configuration']]:isDecision?[['Authority','Current deed · checked on execution'],['Level',String(row.level)],['XP',row.xp+' · proposal'],['Cost / cooldown',row.cost+' · handover values'],['Currency','DM · same numerical handover values; no charge enabled']]:[['Progress','Not connected'],['Season','Season 1 · design'],['Completion',row.optional?'Optional / prestige':'Required objective'],['Reward','Configured reward · pending review']])dl.append(el('dt',label),el('dd',value));pane.append(dl);
if(isDecision){const audit=decisionAudit(row.id);if(audit)pane.append(el('p',audit.authority+'. '+audit.gap,'progression-notice'));}
if(row.title==='Repair Your Starter Kit'){const parts=el('div',undefined,'progression-repair');for(const item of STARTER_REPAIR_PARTS){const part=el('figure');part.append(image(item.art),el('figcaption',item.name+' × '+item.quantity));parts.append(part);}pane.append(el('p','Your '+STARTER_KIT_POLICY.tier+' faction kit starts with '+STARTER_KIT_POLICY.remainingDurabilityBps/100+'% durability. Collect all four parts and return that damaged kit for one intact replacement. Minecraft collection and surrender must be verified.'),parts);}
if(isDecision)pane.append(field('Target',['Select eligible target · preview']));const action=button(isDecision?'Execute decision · pending integration':'Claim reward · pending integration');action.disabled=true;pane.append(action,el('p','J.A.R.V.I.S. dossier · no live execution reference exists yet.','progression-muted'));return pane;
}
function renderMissions(){const toolbar=el('div',undefined,'progression-toolbar'),select=field('Mission branch',MISSION_BRANCHES.map(b=>b.title)),season=field('Season',['Season 1','Season archive · preview']);select.querySelector('select').selectedIndex=MISSION_BRANCHES.findIndex(b=>b.id===branch);select.onchange=e=>{branch=MISSION_BRANCHES[e.target.selectedIndex].id;selected=null;render();};toolbar.append(select,season);content.append(toolbar);
function renderMissions(){if(activeContext==='politics'){appendOfficeMissionPreview(content,{officeCode,dialog:dossier});return;}const toolbar=el('div',undefined,'progression-toolbar'),select=field('Mission branch',MISSION_BRANCHES.map(b=>b.title)),season=field('Season',['Season 1','Season archive · preview']);select.querySelector('select').selectedIndex=MISSION_BRANCHES.findIndex(b=>b.id===branch);select.onchange=e=>{branch=MISSION_BRANCHES[e.target.selectedIndex].id;selected=null;render();};toolbar.append(select,season);content.append(toolbar);
if(activeContext==='personal'){const stats=el('div',undefined,'progression-stats');stats.append(el('strong','XP & level · awaiting connection'),el('span','Season cap 70 · proposed'),el('span','Halfway & completion milestones'),el('progress'));content.append(stats);}else{const info=el('p',activeContext==='politics'?'Office objectives are supplemental. Holding office is never required for personal seasonal completion.':'Organisation mission tree · shared component; organisation-specific objectives await definition.','progression-notice');content.append(info);}
const b=MISSION_BRANCHES.find(b=>b.id===branch)||MISSION_BRANCHES[0],rows=activeContext==='personal'?b.missions:activeContext==='politics'?DECISION_CATALOGUE.filter(d=>d.office===officeCode).map(d=>({id:'MISSION-'+d.id,title:d.title+' · office objective',optional:true})):[];
const layout=el('div',undefined,'progression-layout'),tree=el('div',undefined,'progression-tree');tree.setAttribute('aria-label','Mission tree');if(!rows.length){tree.append(image(CONTEXTS[activeContext][1]),el('h3','Organisation mission tree'),el('p','The roster, tree, objectives and reward panel are ready for shared definitions. Personal mission requirements are not copied onto organisations.'));layout.append(tree);content.append(layout);return;}
@ -52,8 +54,8 @@ export function mountProgressionDesign(host,{context='personal',dashboard=false,
const connect=()=>{if(!tree.isConnected)return;const origin=tree.getBoundingClientRect();svg.setAttribute('viewBox','0 0 '+origin.width+' '+origin.height);svg.replaceChildren();const cards=[...tree.querySelectorAll('[data-mission-id]')];for(let i=1;i<cards.length;i++){const a=cards[i-1].getBoundingClientRect(),b=cards[i].getBoundingClientRect(),line=document.createElementNS(svg.namespaceURI,'path');const sameRow=Math.abs(a.top-b.top)<5;const x1=sameRow?a.right-origin.left:a.left-origin.left+a.width/2,y1=sameRow?a.top-origin.top+a.height/2:a.bottom-origin.top,x2=sameRow?b.left-origin.left:b.left-origin.left+b.width/2,y2=sameRow?b.top-origin.top+b.height/2:b.top-origin.top;line.setAttribute('d',sameRow?'M '+x1+' '+y1+' H '+x2:'M '+x1+' '+y1+' V '+(y1+14)+' H '+x2+' V '+y2);svg.append(line);}};
connectorObserver=new ResizeObserver(connect);connectorObserver.observe(tree);requestAnimationFrame(connect);
}
function renderDecisions(){if(activeContext==='politics'&&!manage){const live=el('div');content.append(live);disposePersonal=mountOfficeRebellionDecisions(live,{officeKey:organisation?.id||({IMP:'emperor',ATR:'atreides',HAR:'harkonnen',COR:'corrino',ORD:'ordos',FRE:'fremen',BG:'veiled_concord',NF:'muad_dib',SG:'spacing_guild',CLD:'clan_delegate'})[officeCode]});}const toolbar=el('div',undefined,'progression-toolbar'),search=el('input');search.type='search';search.placeholder='Search decisions';search.setAttribute('aria-label','Search decisions');search.value=query;search.oninput=()=>{query=search.value;renderDecisionsList();};toolbar.append(search);if(activeContext==='personal'&&xpKind==='pol'){const chooser=field('Questgiver',POL_QUEST_BRANCHES.map(b=>b.title));chooser.querySelector('select').selectedIndex=POL_QUEST_BRANCHES.findIndex(b=>b.id===polDecisionBranch);chooser.onchange=e=>{polDecisionBranch=POL_QUEST_BRANCHES[e.target.selectedIndex].id;selected=null;render();};toolbar.append(chooser);}if((dashboard&&activeContext==='politics')||manage){const chooser=field('Office catalogue',OFFICES.map(([,name])=>name));chooser.querySelector('select').selectedIndex=OFFICES.findIndex(([id])=>id===officeCode);chooser.onchange=e=>{officeCode=OFFICES[e.target.selectedIndex][0];selected=null;render();};toolbar.append(chooser);}content.append(toolbar);const listHost=el('div');content.append(listHost);
function renderDecisionsList(){listHost.replaceChildren();let rows=activeContext==='politics'||manage?DECISION_CATALOGUE.filter(d=>d.office===officeCode):activeContext==='personal'&&xpKind==='pol'?(POL_QUEST_BRANCHES.find(b=>b.id===polDecisionBranch)?.decisions||[]):activeContext==='personal'?[{id:'P-MARK',title:'Equipment Mark eligibility',effect:'Level, materials and equipment restrictions remain necessary.',level:0,xp:0,cost:'Pending configuration'},{id:'P-RARITY',title:'Rarity enhancement eligibility',effect:'Use the existing rarity and Legendary upgrade policy.',level:0,xp:0,cost:'Pending configuration'},{id:'P-SEASON',title:'Seasonal completion entitlement',effect:'One non-tradable completion kit after all mandatory objectives.',level:0,xp:0,cost:'Earned entitlement'}]:[];rows=rows.filter(r=>(r.title+' '+r.effect).toLowerCase().includes(query.toLowerCase()));if(!rows.length){listHost.append(el('p','No decision definitions available for this selection. No authority is inferred.'));return;}selected=rows.find(r=>r.id===selected)?.id||rows[0].id;const layout=el('div',undefined,'progression-layout'),cards=el('div',undefined,'progression-decisions');for(const row of rows){const card=button('',()=>{selected=row.id;dossier.show(details(row,true),{title:lore(row.title),returnFocus:card});},'progression-decision');card.setAttribute('aria-haspopup','dialog');card.setAttribute('aria-pressed',String(row.id===selected));card.append(image('exchange-political-positions-v1.png'),el('small',row.id),el('strong',row.title),el('span',politicalDecision(row.id)?'Review funded decision':row.id==='IMP-10'?'Manage House passage':['NF-08','NF-09','NF-10'].includes(row.id)?'Prepare clan blessing':'View proposal · execution unavailable'));cards.append(card);}layout.append(cards);listHost.append(layout);}renderDecisionsList();
function renderDecisions(){if(activeContext==='politics')appendOfficeDecisionBanner(content,officeCode);if(activeContext==='politics'&&!manage){const live=el('div');content.append(live);disposePersonal=mountOfficeRebellionDecisions(live,{officeKey:organisation?.id||({IMP:'emperor',ATR:'atreides',HAR:'harkonnen',COR:'corrino',ORD:'ordos',FRE:'fremen',BG:'veiled_concord',NF:'muad_dib',SG:'spacing_guild',CLD:'clan_delegate'})[officeCode]});}const toolbar=el('div',undefined,'progression-toolbar'),search=el('input');search.type='search';search.placeholder='Search decisions';search.setAttribute('aria-label','Search decisions');search.value=query;search.oninput=()=>{query=search.value;renderDecisionsList();};toolbar.append(search);if(activeContext==='personal'&&xpKind==='pol'){const chooser=field('Questgiver',POL_QUEST_BRANCHES.map(b=>b.title));chooser.querySelector('select').selectedIndex=POL_QUEST_BRANCHES.findIndex(b=>b.id===polDecisionBranch);chooser.onchange=e=>{polDecisionBranch=POL_QUEST_BRANCHES[e.target.selectedIndex].id;selected=null;render();};toolbar.append(chooser);}if((dashboard&&activeContext==='politics')||manage){const chooser=field('Office catalogue',OFFICES.map(([,name])=>name));chooser.querySelector('select').selectedIndex=OFFICES.findIndex(([id])=>id===officeCode);chooser.onchange=e=>{officeCode=OFFICES[e.target.selectedIndex][0];selected=null;render();};toolbar.append(chooser);}content.append(toolbar);const listHost=el('div');content.append(listHost);
function renderDecisionsList(){listHost.replaceChildren();let rows=activeContext==='politics'||manage?[...DECISION_CATALOGUE.filter(d=>d.office===officeCode),...officeDecisionPreviews(officeCode)]:activeContext==='personal'&&xpKind==='pol'?(POL_QUEST_BRANCHES.find(b=>b.id===polDecisionBranch)?.decisions||[]):activeContext==='personal'?[{id:'P-MARK',title:'Equipment Mark eligibility',effect:'Level, materials and equipment restrictions remain necessary.',level:0,xp:0,cost:'Pending configuration'},{id:'P-RARITY',title:'Rarity enhancement eligibility',effect:'Use the existing rarity and Legendary upgrade policy.',level:0,xp:0,cost:'Pending configuration'},{id:'P-SEASON',title:'Seasonal completion entitlement',effect:'One non-tradable completion kit after all mandatory objectives.',level:0,xp:0,cost:'Earned entitlement'}]:[];rows=rows.filter(r=>(r.title+' '+r.effect).toLowerCase().includes(query.toLowerCase()));if(!rows.length){listHost.append(el('p','No decision definitions available for this selection. No authority is inferred.'));return;}selected=rows.find(r=>r.id===selected)?.id||rows[0].id;const layout=el('div',undefined,'progression-layout'),cards=el('div',undefined,'progression-decisions');for(const row of rows){const card=button('',()=>{selected=row.id;dossier.show(details(row,true),{title:lore(row.title),returnFocus:card});},'progression-decision');card.setAttribute('aria-haspopup','dialog');card.setAttribute('aria-pressed',String(row.id===selected));const art=activeContext==='politics'?POL_PLANNING_ART[officeCode]:activeContext==='personal'&&xpKind==='pol'?POL_PLANNING_ART[POL_QUEST_BRANCHES.find(b=>b.id===polDecisionBranch)?.office]:null;card.append(image(art?.banner||'exchange-political-positions-v1.png'),...(art?[planningImage(art.seal,art.title+' seal','pol-decision-seal')]:[]),el('small',row.id),el('strong',row.title),el('span',politicalDecision(row.id)?'Review funded decision':row.id==='IMP-10'?'Manage House passage':['NF-08','NF-09','NF-10'].includes(row.id)?'Prepare clan blessing':'View proposal · execution unavailable'));cards.append(card);}layout.append(cards);listHost.append(layout);}renderDecisionsList();
}
function render(){dossier.close();connectorObserver?.disconnect();disposePersonal?.();disposePersonal=null;notice.textContent=activeContext==='personal'&&!manage?(xpKind==='pol'?'Reputation missions use verified J.A.R.V.I.S. records and their system questgivers. Decision execution awaits configuration.':'Personal missions use verified J.A.R.V.I.S. records. Decision and organisation integrations remain in preview.'):'Connected decisions open a review and confirmation. Other proposals remain unavailable until their consumers are connected.';root.dataset.context=activeContext;notice.hidden=activeContext==='personal'&&!manage;nav.hidden=report.available&&activeContext==='personal'&&!manage;report.setNavigation(xpKind,tab);report.showBranches(activeContext==='personal');xpNav.replaceChildren();xpNav.hidden=activeContext!=='personal'||manage||report.available;if(!xpNav.hidden)for(const [kind,label]of [['personal','Personal level'],['pol','Reputation level']]){const b=button(label,()=>{xpKind=kind;selected=null;render();});b.setAttribute('aria-pressed',String(kind===xpKind));xpNav.append(b);}contextNav.replaceChildren();for(const[id,[label]]of Object.entries(CONTEXTS)){const b=button(label,()=>{activeContext=id;selected=null;query='';render();});b.setAttribute('aria-pressed',String(id===activeContext));contextNav.append(b);}renderGallery();nav.replaceChildren();for(const[id,label]of [['missions',manage?'Mission Definitions':'Missions'],['decisions',manage?'Decision Definitions':'Decisions'],...(manage?[['rewards','Progression & Rewards']]:[]),['history','History']]){const b=button(label,()=>{tab=id;selected=null;render();});b.setAttribute('aria-pressed',String(tab===id));nav.append(b);}content.replaceChildren();if(activeContext==='clan'&&!manage){notice.hidden=true;disposePersonal=mountClanRebellions(content,{clanId:organisation?.id||null,embedded:true,view:tab,onDecisions:()=>{tab='decisions';render();}});return;}if(activeContext==='personal'&&!manage&&['missions','history'].includes(tab))disposePersonal=mountPersonalProgression(content,{view:tab,apiBase:xpKind==='pol'?'/api/progression/pol':'/api/progression',externalBranches:report.available,initialBranch:branch,onData:data=>report.setJournal(xpKind,data),onBranches:(rows,id)=>{branch=id;report.setBranches(rows,id);}});else if(tab==='missions')renderMissions();else if(tab==='decisions')renderDecisions();else if(tab==='rewards'){content.append(el('h3','Progression & Rewards'),field('Season cap',['70 · proposed']),field('Milestone announcements',['Halfway and completion only']),el('p','Rewards, XP curves, repair recipes and signing editions await backend review. No configuration writes enabled.'));}else content.append(el('h3','J.A.R.V.I.S. History'),el('p','Verified completion, claims, decisions and any staff overrides will appear here after integration. No sample audit records are shown.'));}
render();return()=>{dossier.dispose();connectorObserver?.disconnect();disposePersonal?.();report.dispose();root.remove();};

View file

@ -0,0 +1,36 @@
import {WAR_MODES} from '../war-exchange-policy.mjs';
import {POL_QUEST_BRANCHES} from './cp-v2-pol-quest-catalogue.mjs';
export const WAR_PLANS=Object.freeze([
{id:'clan',...WAR_MODES.clan,art:'war-maps/clan-frontier-v1.png',seal:'nav-clan-v2.webp',title:'The Clan Front',summary:'Mother clans and their client branches contest registered Home Blocks.',sides:['Clan coalition','Opposing clan coalition'],rules:['8 players on each side; client-clan members join the roster.','Every party selects the same one-hour calendar block.','Each province represents a Home Block. No Imperial intervention.']},
{id:'world',...WAR_MODES.world,art:'war-maps/world-frontier-v1.png',seal:'seals/house-aerdrecht-v1.png',title:'War of the Worlds',summary:'Two world coalitions, their military clans and hired allies.',sides:['World coalition','Opposing world coalition'],rules:['16 players per side, selected through the political office.','Coalition and hired-clan selections are planned controls.','The Emperor may support one side; his province is purple.']},
{id:'universal',...WAR_MODES.universal,art:'war-maps/universal-frontier-v1.png',seal:'seals/emperor-v1.png',title:'The Universal Conflict',summary:'Empire, rebellion and countercoalition fight for the Imperium.',sides:['Empire','Rebellion','Countercoalition'],rules:['86 players per side across three coalitions.','Worlds choose their side through the current political office.','The Imperial Home Block is the protected final province.']},
{id:'religious',...WAR_MODES.religious,art:'war-maps/universal-frontier-v1.png',seal:'seals/new-faith-v1.png',title:'War of Faith',summary:'The Spacing Guild, Church of Muad’Dib and independent worlds.',sides:['Spacing Guild & Emperor','Church of Muad’Dib','Independent world coalition'],rules:['86 players per side; participating worlds and hired clans form coalitions.','The Emperor joins the Spacing Guild.','His final province unlocks only after one challenger holds every other province.']}
]);
export const POL_PLANNING_ART=Object.freeze({
IMP:{key:'emperor',title:'Imperial Senate',seal:'seals/emperor-v1.png',banner:'political-imperial-chamber-v1.png'},
ATR:{key:'atreides',title:'House Aerdrecht',seal:'seals/house-aerdrecht-v1.png',banner:'progression/field-mission-v1.webp'},
HAR:{key:'harkonnen',title:'House Harkveen',seal:'seals/house-harkveen-v1.png',banner:'war-maps/world-frontier-v1.png'},
COR:{key:'corrino',title:'House Korenholt',seal:'seals/house-korenholt-v1.png',banner:'progression/imperial-court.webp'},
ORD:{key:'ordos',title:'House Oordwijk',seal:'seals/house-oordwijk-v1.png',banner:'war-maps/clan-frontier-v1.png'},
FRE:{key:'fremen',title:'Council of Naibs',seal:'seals/office-house_leader.png',banner:'exchange-quests-v1.png'},
BG:{key:'veiled_concord',title:'Veiled Concord',seal:'seals/veiled-concord-v1.png',banner:'veiled-concord-banner-v1.png'},
NF:{key:'muad_dib',title:'Church of Muad’Dib',seal:'seals/new-faith-v1.png',banner:'progression/imperial-court.webp'},
SG:{key:'spacing_guild',title:'Spacing Guild',seal:'seals/office-landsraad.png',banner:'exchange-starport-header-v2.webp'},
CLD:{key:'clan_delegate',title:'Clan Delegate',seal:'seals/office-house_leader.png',banner:'political-small-council-v1.png'}
});
const additions={
IMP:[['An Imperial Mandate','Review the political sides and their current office mandates.'],['The Council Must Agree','Coordinate an agreed calendar block with every participating side.'],['The Final Province','Follow the defence of the Imperial Home Block during a universal or religious campaign.']],
NF:[['The Congregation','Review your current congregation and appointed Priors.'],['Blessed by the Prior','Prepare a faith-service objective around an authorised clan blessing.'],['Defenders of the Faith','Prepare the Church coalition for the War of Faith.']],
CLD:[['A Voice for the Clans','Gather a common petition from the represented clans.'],['The Shared Mandate','Present the agreed position to the political council.'],['Clans United','Coordinate eligible clan participants for an agreed campaign.']]
};
export function officeMissionPreview(code){
const art=POL_PLANNING_ART[code]||POL_PLANNING_ART.IMP,branch=POL_QUEST_BRANCHES.find(b=>b.office===code);
return {code,...art,issuerName:branch?.issuerName||null,quests:branch?.quests||((additions[code]||additions.IMP).map(([title,objective],i)=>({id:'PREVIEW-'+code+'-'+(i+1),title,objective,requires:i?['PREVIEW-'+code+'-'+i]:[]})))};
}
export function officeDecisionPreviews(code){
const office=POL_PLANNING_ART[code]||POL_PLANNING_ART.IMP,branch=POL_QUEST_BRANCHES.find(b=>b.office===code);
const planned=[['WORLD','Propose a World Campaign','Prepare a world-war proposal and seek the other side’s agreement.'],['ROSTER','Approve the War Roster','Choose eligible military-clan and client-clan members within the scenario limit.'],['ALLIES','Invite Allied Clans','Prepare coalition or hired-clan terms for an agreed campaign.'],['COALITION','Choose a Universal Coalition','Prepare your world’s preferred side: Empire, Rebellion or Countercoalition.'],['FAITH','Choose a Side in the War of Faith','Review support for the Guild, Church or independent world coalition.']];
if(code==='IMP')planned.push(['INTERVENE','Imperial Intervention','Support one side in a world war and substitute the Imperial Home Block province. Clan wars are excluded.']);
return [...(branch?.decisions||[]),...planned.map(([id,title,effect])=>({id:'PREVIEW-WAR-'+code+'-'+id,office:code,title,effect,planned:true,xpType:'pol',rewardScope:'war',executionStatus:'coming-soon'}))];
}
export const planningArtAssets=()=>[...new Set([...WAR_PLANS.flatMap(p=>[p.art,p.seal]),...Object.values(POL_PLANNING_ART).flatMap(p=>[p.banner,p.seal])])];

View file

@ -0,0 +1,5 @@
.war-planning,.pol-mission-preview{color:#eddbac;min-width:0}.war-planning-notice{border-left:3px solid #c5a65b;background:#183c30;padding:12px 16px;color:#e5d6b5}.war-planning-hero{position:relative;isolation:isolate;overflow:hidden;min-height:190px;display:flex;align-items:flex-end;border:1px solid #af9251;border-radius:12px;margin:0 0 24px;background:#102b23}.war-planning-hero>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.48;z-index:-2}.war-planning-hero:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(5,24,18,.9),rgba(5,24,18,.18));z-index:-1}.war-planning-hero>div{padding:28px;max-width:760px}.war-planning-hero h3{font-size:clamp(24px,3vw,38px);margin:8px 0;color:#f2d996}.war-planning-hero small{color:#d7ba77;letter-spacing:.12em}.war-planning-hero p{line-height:1.55;margin:0}.war-planning-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:20px;margin:20px 0 26px}.war-planning-card{position:relative;display:flex;flex-direction:column;text-align:left;color:#eddbac;background:linear-gradient(145deg,#1d4034,#0b2820);border:1px solid #a98d4f;border-radius:11px;padding:20px;overflow:hidden;min-width:0;font:inherit;box-shadow:0 8px 20px #0002}.war-planning-card:is(button){cursor:pointer;transition:transform .15s,border-color .15s}.war-planning-card:is(button):hover{transform:translateY(-3px);border-color:#f3d788}.war-planning-card:focus-visible,.war-planning-link:focus-visible{outline:3px solid #f0ce72;outline-offset:4px}.war-planning-cover{width:calc(100% + 40px);height:165px;object-fit:cover;max-width:none;margin:-20px -20px 22px;border-bottom:1px solid #a98d4f}.war-planning-seal{width:68px;height:68px;object-fit:contain;position:absolute;top:122px;right:17px;background:#102c23;border:1px solid #b69b59;border-radius:50%;padding:7px;box-sizing:border-box}.war-planning-card small{padding-right:50px;color:#c9b77d;letter-spacing:.07em;font-size:11px}.war-planning-card h3{font-family:Georgia,serif;font-size:25px;line-height:1.15;color:#f1d88e;margin:13px 0}.war-planning-card p{line-height:1.6;margin:0 0 20px}.war-planning-badge{margin-top:auto;align-self:flex-start;border:1px solid #718562;border-radius:20px;padding:6px 11px;font-size:12px;color:#cbd9bf}.war-planning-link{display:inline-block;border:1px solid #b59a56;border-radius:6px;padding:11px 18px;background:#234938;color:#f5d98b;text-decoration:none}.war-planning-detail .war-planning-hero{min-height:250px}.war-planning-detail ul{padding-left:24px;line-height:1.8}.war-planning-detail>strong{display:block;border-top:1px solid #8a7949;margin-top:20px;padding-top:16px;color:#dac38c}.war-planning-detail-seal{width:80px;height:80px;object-fit:contain;float:right;margin:0 0 16px 20px}.war-planning-sides{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:20px 0}.war-planning-sides article{display:flex;flex-direction:column;align-items:center;gap:10px;border:2px solid;border-radius:8px;padding:16px;text-align:center;background:#123125}.war-planning-sides img{width:64px;height:64px;object-fit:contain}.war-planning-sides span{font-size:12px;color:#b7c2aa}.war-planning-step-art{height:120px;width:100%;object-fit:contain;margin-bottom:14px}.pol-mission-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}.progression-decision .pol-decision-seal{width:48px!important;height:48px!important;object-fit:contain!important;position:absolute;right:14px;top:100px;padding:4px;background:#102b23;border:1px solid #a98d4f;border-radius:50%;box-sizing:border-box}.progression-decision:has(.pol-decision-seal){position:relative}.progression-decision:has(.pol-decision-seal)>img:first-child{height:145px;object-fit:cover}.progression-detail .pol-detail-seal{width:70px;height:70px;object-fit:contain;float:right;margin:8px}@media(max-width:600px){.war-planning-hero>div{padding:20px}.war-planning-grid{gap:14px}.war-planning-hero{min-height:170px}.war-planning-detail .war-planning-hero{min-height:210px}}@media(prefers-reduced-motion:reduce){.war-planning-card:is(button){transition:none}}
.war-planning-map{margin:20px 0;border:1px solid #a98d4f;border-radius:8px;overflow:hidden;background:#102c23}.war-planning-map>div{background-size:cover;background-position:center}.war-planning-map svg{display:block;width:100%;height:auto}.war-planning-map path{fill-opacity:.44;stroke:#172a22;stroke-width:3;stroke-linejoin:round}.war-planning-map figcaption{padding:12px 16px;color:#d1c39b;font-size:13px}
.war-planning .cp-v2-template-tabs{flex-wrap:wrap}.war-planning .cp-v2-template-heading>div{min-width:0}.war-planning .cp-v2-template-heading{min-width:0}.war-planning .cp-v2-template-tab{min-width:0;max-width:100%}.war-planning .cp-v2-template-panels{min-width:0}

View file

@ -0,0 +1,32 @@
import {element as el,createCPV2Page} from './cp-v2-page-template.mjs';
import {createProgressionDialog} from './cp-v2-progression-dialog.mjs';
import {WAR_PLANS,POL_PLANNING_ART,officeMissionPreview} from './cp-v2-war-planning-content.mjs';
import {warProvinceGeometry} from './cp-v2-war-province-geometry.mjs';
const assets='https://www.dunerealms.com/assets/';
export function planningStyles(){if(document.querySelector('link[data-war-planning]'))return;const css=el('link');css.rel='stylesheet';css.href=new URL('./cp-v2-war-planning.css',import.meta.url).href;css.dataset.warPlanning='';document.head.append(css);}
export function planningImage(file,alt='',className=''){const image=el('img',undefined,className);image.src=assets+file;image.alt=alt;image.loading='lazy';image.decoding='async';return image;}
function banner(art,title,description){const hero=el('header',undefined,'war-planning-hero');hero.append(planningImage(art,description),el('div'));hero.lastChild.append(el('small','IMPERIAL STRATEGIC ARCHIVE'),el('h3',title),el('p',description));return hero;}
function illustrativeMap(plan){const figure=el('figure',undefined,'war-planning-map'),canvas=el('div');canvas.style.backgroundImage='url("'+assets+plan.art+'")';const ns='http://www.w3.org/2000/svg',svg=document.createElementNS(ns,'svg');svg.setAttribute('viewBox','0 0 1000 560');svg.setAttribute('role','img');svg.setAttribute('aria-label','Illustrative '+plan.label+' province layout, not live ownership');const count=plan.id==='clan'?2:plan.id==='world'?8:13;for(const cell of warProvinceGeometry(count)){const path=document.createElementNS(ns,'path');path.setAttribute('d',cell.path);path.setAttribute('fill',cell.slot===count-1&&['universal','religious'].includes(plan.id)?'#9855c5':['#3276c9','#c64b4b','#45885b'][cell.slot%plan.parties]);svg.append(path);}canvas.append(svg);figure.append(canvas,el('figcaption','Illustrative provinces · the live map will use actual participating Home Blocks.'));return figure;}
export function appendOfficeMissionPreview(host,{officeCode='IMP',dialog}={}){
planningStyles();const office=officeMissionPreview(officeCode),root=el('section',undefined,'pol-mission-preview');root.append(banner(office.banner,office.title+' · Missions','Mission preview · objectives and artwork are ready; completion is not connected here.'));
if(office.issuerName)root.append(el('p','Your adviser: '+office.issuerName));
const grid=el('div',undefined,'war-planning-grid pol-mission-cards');
for(const [i,quest]of office.quests.entries()){
const card=el('button',undefined,'war-planning-card');card.type='button';card.setAttribute('aria-haspopup','dialog');card.append(planningImage(office.banner,office.title+' mission artwork','war-planning-cover'),planningImage(office.seal,office.title+' seal','war-planning-seal'),el('small','MISSION '+String(i+1).padStart(2,'0')+' · PREVIEW'),el('h3',quest.title),el('p',quest.objective),el('span','View mission · coming soon','war-planning-badge'));
card.onclick=()=>{const pane=el('section',undefined,'war-planning-detail');pane.append(banner(office.banner,quest.title,quest.objective),planningImage(office.seal,office.title+' seal','war-planning-detail-seal'),el('p','Office: '+office.title),el('p','Objective: '+quest.objective));if(quest.requires?.length)pane.append(el('p','Previous objectives: '+quest.requires.map(id=>office.quests.find(q=>q.id===id)?.title||id).join(', ')));pane.append(el('p','Rewards, Reputation XP, eligibility and cooldowns will appear here when this mission is connected.'),el('strong','Coming soon · no progress or rewards are issued from this preview.'));dialog?.show(pane,{title:quest.title,returnFocus:card});};grid.append(card);
}
root.append(grid);host.append(root);return root;
}
export function appendOfficeDecisionBanner(host,officeCode){planningStyles();const office=POL_PLANNING_ART[officeCode]||POL_PLANNING_ART.IMP;host.append(banner(office.banner,office.title+' · Decisions','Open a decision to review its effect. Connected actions keep their normal confirmation; planned actions are marked unavailable.'));}
export function mountWarPlanning(host,{kind='clan',scopeId=null}={}){
planningStyles();const overview=el('section'),coalitions=el('section'),reports=el('section');
const {root}=createCPV2Page({shellHost:host,title:'War Room',description:'Campaign plans, coalitions and Home Block provinces.',artwork:'seals/emperor-v1.png',tabs:[{id:'scenarios',label:'War scenarios',artwork:'nav-clan-v2.webp',content:overview},{id:'coalitions',label:'Sides & rosters',artwork:'seals/office-landsraad.png',content:coalitions},{id:'reports',label:'Campaign reports',artwork:'nav-manual-v2.webp',content:reports}]});
root.classList.add('war-planning');const notice=el('p','Design preview · these maps and sides are illustrative. No live war, roster or conquest is shown.','war-planning-notice');root.prepend(notice);host.replaceChildren(root);const dialog=createProgressionDialog(root);
overview.append(banner('political-imperial-chamber-v1.png','Choose your next campaign','Four scenarios. One calendar. Home Blocks become strategic provinces.'));const grid=el('div',undefined,'war-planning-grid');
for(const plan of WAR_PLANS){const card=el('button',undefined,'war-planning-card');card.type='button';card.setAttribute('aria-haspopup','dialog');card.append(planningImage(plan.art,plan.label+' desert campaign map','war-planning-cover'),planningImage(plan.seal,plan.label+' emblem','war-planning-seal'),el('small',plan.parties+' SIDES · '+plan.playersPerSide+' PLAYERS PER SIDE'),el('h3',plan.title),el('p',plan.summary),el('span','Explore scenario · preview','war-planning-badge'));card.onclick=()=>{const pane=el('section',undefined,'war-planning-detail');pane.append(banner(plan.art,plan.title,plan.summary),el('p','Illustrative map · provinces will be generated from the participants’ registered Home Blocks.'));pane.append(illustrativeMap(plan));const sides=el('div',undefined,'war-planning-sides');for(const [i,name]of plan.sides.entries()){const side=el('article');side.style.borderColor=['#3276c9','#c64b4b','#45885b'][i];side.append(planningImage(plan.id==='religious'?['seals/office-landsraad.png','seals/new-faith-v1.png','nav-clan-v2.webp'][i]:plan.id==='universal'?['seals/emperor-v1.png','nav-clan-v2.webp','seals/office-landsraad.png'][i]:plan.seal,name+' emblem'),el('strong',name),el('span',plan.playersPerSide+' roster places · planned'));sides.append(side);}pane.append(sides);const rules=el('ul');for(const rule of plan.rules)rules.append(el('li',rule));pane.append(rules,el('p','Blue: side one · Red: side two · Green: side three · Purple: Imperial province.'),el('strong','Coming soon · coalition and campaign controls are being connected.'));dialog.show(pane,{title:plan.title,returnFocus:card});};grid.append(card);}overview.append(grid);
const exchange=el('a','Open War Exchange →','war-planning-link');exchange.href=kind==='clan'?'#clan/clan-war-exchange':'#household/war-exchange';overview.append(exchange);
coalitions.append(banner('political-small-council-v1.png','Coalitions & campaign rosters','Current political appointments, mother clans and client clans provide the participant list.'));
const steps=el('div',undefined,'war-planning-grid');for(const [title,art,copy]of [['Choose your side','seals/emperor-v1.png','Political offices choose a coalition. The Emperor joins the Guild in a religious war.'],['Prepare the roster','nav-clan-v2.webp','Choose from verified members and client clans; reserve members remain outside the combat roster.'],['Agree the calendar','exchange-starport-header-v2.webp','Every party picks the same one-hour block before a campaign can begin.']]){const card=el('article',undefined,'war-planning-card');card.append(planningImage(art,title,'war-planning-step-art'),el('h3',title),el('p',copy),el('span','Planned control','war-planning-badge'));steps.append(card);}coalitions.append(steps);
reports.append(banner('war-maps/universal-frontier-v1.png','The campaign chronicle','Province colours, captured Home Blocks and conquest progress will follow verified campaign events.'),el('p','No live campaign selected. Open an existing proposal in War Exchange to see its available report.'),el('p','The Imperial final province remains protected until one challenger holds every other province. Its reveal then remains permanent.'));const reportLink=exchange.cloneNode(true);reports.append(reportLink);
return()=>{dialog.dispose();root.remove();};
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,6 @@
import test from 'node:test';import assert from 'node:assert/strict';import {access} from 'node:fs/promises';
import {WAR_PLANS,POL_PLANNING_ART,officeMissionPreview,officeDecisionPreviews,planningArtAssets} from '../control-panel/public/cp-v2/cp-v2-war-planning-content.mjs';
import {POL_QUEST_BRANCHES} from '../control-panel/public/cp-v2/cp-v2-pol-quest-catalogue.mjs';import {organisationMenuItems,organisationPage} from '../control-panel/public/cp-v2/cp-v2-organisation-navigation.mjs';
test('every war and POL placeholder artwork resolves to a bundled existing image',async()=>{assert.equal(WAR_PLANS.length,4);assert.equal(Object.keys(POL_PLANNING_ART).length,10);for(const file of planningArtAssets()){assert.match(file,/^[a-z0-9_/-]+\.(png|webp)$/i);await access(new URL('../web/assets/'+file,import.meta.url));}});
test('office mission previews reuse the real catalogues and keep new ideas distinct from live quest IDs',()=>{for(const code of Object.keys(POL_PLANNING_ART)){const p=officeMissionPreview(code),original=POL_QUEST_BRANCHES.find(b=>b.office===code);assert.ok(p.quests.length>=3);if(original)assert.deepEqual(p.quests,original.quests);else for(const q of p.quests)assert.match(q.id,/^PREVIEW-/);const decisions=officeDecisionPreviews(code);assert.ok(decisions.length>=5);assert.equal(new Set(decisions.map(d=>d.id)).size,decisions.length);for(const d of decisions.filter(d=>d.planned))assert.equal(d.executionStatus,'coming-soon');}});
test('the War Room is reachable through POL navigation and is excluded from company controls',()=>{assert.equal(organisationPage('#household/war-room'),'war-room');assert.equal(organisationPage('#household/missions?view=decisions'),'missions');assert.ok(organisationMenuItems('politics').some(i=>i.label==='War Room'));assert.ok(!organisationMenuItems('company').some(i=>/War/.test(i.label)));});