주 시작을 월요일과 일요일로 선택하고 개인 설정으로 연동

주 시작 선택을 달력 표시 옵션에 추가했다. 앱과 웹의 머리글과 날짜 배열 및 월간과 두 주 위젯이 같은 설정을 사용한다. 주말 색상은 실제 요일을 따르며 당직 기준일과 반복 근무는 바꾸지 않는다. 0.12.0과 설치 번호 16 및 웹 2026-11-21.2로 맞췄다.

서버는 weekStart에 일요일 0과 월요일 1만 허용한다. 구버전에서 필드를 생략하면 기존 값을 유지한다. 반복 근무와 개인 옵션은 같은 트랜잭션에서 버전을 맞춘다. DB 구조 변경은 없다.

앱 단위 37개와 서버 검사 66개 및 웹의 주 시작·음력·반복·업데이트 검사 통과. APK와 공개 소스 ZIP 새 폴더 빌드 통과. 정적 검사 오류 0개와 경고 71개. 가상 기기에서 월·일 머리글과 첫 날짜 및 주말 색상과 두 주 위젯의 시작을 확인했다. 웹에서 월요일 선택 저장과 재접속 유지 및 42칸을 확인했다.

변경 전 소스와 DB는 보조서버 비공개 20261121-week-start 백업에 보관했다. 운영 웹과 직접 APK 업데이트 경로에 반영했다. 요청한 관리자 계정의 weekStart만 월요일로 바꾸고 나머지 근무와 표시 옵션을 보존했다. 실물 휴대폰과 제조사별 홈 화면은 별도 확인이 필요하다.
This commit is contained in:
블리어 committed 2026-11-20 23:59:32 +00:00
1 parent 2d237cb532
commit 30d2fb26c7
30 files changed
+255 -63

No files matched your search

+5 -5
View File
@@ -3,18 +3,18 @@ const fs=require('node:fs'),vm=require('node:vm'),assert=require('node:assert/st
const source=fs.readFileSync(__dirname+'/web/updates.js','utf8');
async function setup(seen=''){
const storage=new Map([['duty-web-update-seen',seen]]),nodes=new Map();
let release={webVersion:'2026-11-21.1',appVersion:'0.11.0',notes:['검증']},reloaded=0,editing=false;
let release={webVersion:'2026-11-21.2',appVersion:'0.12.0',notes:['검증']},reloaded=0,editing=false;
const node=id=>{if(!nodes.has(id))nodes.set(id,{textContent:'',open:false,showModal(){this.open=true;},close(){this.open=false;},addEventListener(){}});return nodes.get(id);};
const context={console,$:node,localStorage:{getItem:k=>storage.get(k)||null,setItem:(k,v)=>storage.set(k,v),removeItem:k=>storage.delete(k)},document:{visibilityState:'visible',querySelector:()=>editing||node('update-dialog').open,addEventListener(){}},pending:[],saving:false,connected:false,notify(){},setInterval(){},location:{reload(){reloaded++;}},fetch:async()=>({ok:true,json:async()=>release})};
vm.createContext(context);vm.runInContext(source,context);await new Promise(setImmediate);
return {context,node,storage,setRelease:v=>release=v,setEditing:v=>editing=v,reloaded:()=>reloaded,check:async()=>{await vm.runInContext('checkWebVersion()',context);}};
}
(async()=>{
const first=await setup();assert.equal(first.node('update-dialog').open,true);assert.equal(first.node('update-apply').textContent,'확인');first.node('update-apply').onclick();assert.equal(first.reloaded(),0);assert.equal(first.storage.get('duty-web-update-seen'),'2026-11-21.1');
const first=await setup();assert.equal(first.node('update-dialog').open,true);assert.equal(first.node('update-apply').textContent,'확인');first.node('update-apply').onclick();assert.equal(first.reloaded(),0);assert.equal(first.storage.get('duty-web-update-seen'),'2026-11-21.2');
const returning=await setup('2026-11-20.4');assert.equal(returning.node('update-dialog').open,true);
const latest=await setup('2026-11-21.1');assert.equal(latest.node('update-dialog').open,false);
latest.setEditing(true);latest.setRelease({webVersion:'2026-11-21.2',appVersion:'0.11.0',notes:['검증']});await latest.check();assert.equal(latest.node('update-dialog').open,false);
const latest=await setup('2026-11-21.2');assert.equal(latest.node('update-dialog').open,false);
latest.setEditing(true);latest.setRelease({webVersion:'2026-11-21.3',appVersion:'0.12.0',notes:['검증']});await latest.check();assert.equal(latest.node('update-dialog').open,false);
latest.setEditing(false);await latest.check();assert.equal(latest.node('update-dialog').open,true);assert.equal(latest.node('update-apply').textContent,'업데이트 적용');latest.node('update-later').onclick();await latest.check();assert.equal(latest.node('update-dialog').open,false);
latest.storage.delete('duty-web-update-later');await latest.check();latest.node('update-apply').onclick();assert.equal(latest.reloaded(),1);assert.equal(latest.storage.get('duty-web-update-seen'),'2026-11-21.2');
latest.storage.delete('duty-web-update-later');await latest.check();latest.node('update-apply').onclick();assert.equal(latest.reloaded(),1);assert.equal(latest.storage.get('duty-web-update-seen'),'2026-11-21.3');
console.log('웹 업데이트: 첫 안내, 재접속, 현재 버전, 편집 보호, 나중에, 동의 후 적용 통과');
})().catch(error=>{console.error(error);process.exitCode=1;});