Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
VER=$(git rev-parse --short HEAD)
sed "s|src/app/main.js|src/app/main.js?v=${VER}|" index.html > _site/index.html
cp -r src _site/
if [ -d assets ]; then cp -r assets _site/; fi
find _site/src -name '*.js' -print0 | while IFS= read -r -d '' f; do
sed -i -E "s|from ([\"'])((\.\.?/[^\"'?]+))(\1)|from \1\2?v=${VER}\4|g" "$f"
done
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
VER=$(git rev-parse --short HEAD)
sed "s|src/app/main.js|src/app/main.js?v=${VER}|" index.html > _site/index.html
cp -r src _site/
if [ -d assets ]; then cp -r assets _site/; fi
find _site/src -name '*.js' -print0 | while IFS= read -r -d '' f; do
sed -i -E "s|from ([\"'])((\.\.?/[^\"'?]+))(\1)|from \1\2?v=${VER}\4|g" "$f"
done
Expand Down
Binary file added assets/summon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
body{transition:padding-left .22s ease}
.sidebar{position:fixed;left:0;top:0;bottom:0;width:62px;background:#191c22;z-index:45;
display:flex;flex-direction:column;align-items:center;gap:7px;padding:16px 0}
.sblogo{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,#3b6ef6,#9b8cff);margin-bottom:12px;flex:none}
.sblogo{width:108px;height:36px;border-radius:8px;background:#fff;padding:5px 8px;margin:0 0 10px 6px;flex:none;
align-self:flex-start;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none}
.sblogo:hover{background:#f0f0f0}
.sblogo img{height:24px;width:auto;max-width:100%;display:block}
.sbicon{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#9aa1ac;flex:none}
.sbicon:hover{background:rgba(255,255,255,.08);color:#fff}
.sbicon.active{background:rgba(255,255,255,.13);color:#fff}
Expand Down Expand Up @@ -589,7 +592,8 @@
@media (max-width:740px){
body{padding-left:48px}
.sidebar{width:48px;gap:5px;padding:12px 0}
.sblogo{width:26px;height:26px;margin-bottom:8px}
.sblogo{width:92px;height:32px;padding:4px 6px;margin-left:4px}
.sblogo img{height:20px}
.sbicon{width:38px;height:38px}
.sbsearchpop{left:56px;width:min(290px,calc(100vw - 64px))}
/* the chart fills the screen and scrolls inside itself, like a native app */
Expand Down Expand Up @@ -645,7 +649,9 @@
<body>

<aside class="sidebar">
<div class="sblogo"></div>
<button type="button" class="sblogo" title="Summon — whole team, next week" onclick="goHome()" aria-label="Reset to default view">
<img src="assets/summon-logo.png" alt="Summon" height="24">
</button>
<button class="sbicon" id="sbsearch" title="Search tasks" onclick="toggleSearch()">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="9" cy="9" r="5.4"/><path d="M13.4 13.4 17 17"/></svg>
</button>
Expand Down
22 changes: 19 additions & 3 deletions src/app/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
PEOPLE, TODAY, HARDWARE_VOCAB, CLIENTS,
SIZE_KEYS, SIZE_PTS, SIZE_NAMES, LEAD, ZOOMS, GBAR_H, normalizeSize, sizePts, barHeight,
R0G, R1G, SPAN_G, TODAY_PX, ganttRange,
R0G, R1G, SPAN_G, TODAY_PX, ganttRange, DEFAULT_ZOOM,
C_LATE, C_TODAY, C_RADAR, C_LATER, C_DONE,
} from "../data/constants.js";
import { inferOwnerByDomain, canonHardware, findClient, buildRespMapText, buildVocabText, norm as _norm } from "../lib/domain.js";
Expand Down Expand Up @@ -68,6 +68,22 @@ document.addEventListener("keydown",e=>{
let lastTilt=0, ownerFilter="all";
const want=o=>ownerFilter==="all"||o===ownerFilter;
function setFilter(k){ ownerFilter=k; closeFlyouts(); setTimeout(renderAll,0); }
function goHome(){
closeSidePops();
closeFlyouts();
closeSheet();
ownerFilter="all";
GVIEW="proj";
showDone=false;
focusToday=false;
subsAll=false;
COL.clear();
EXP.clear();
ZOOM=DEFAULT_ZOOM;
zoomScrollStart=true;
ganttScroll.left=0;
setTimeout(renderAll,0);
}
/* one roll-out open at a time; expandable icons stay lit while their options are out */
function closeFlyouts(exceptId){
document.querySelectorAll(".gfctl.open").forEach(c=>{ if(c.id!==exceptId){ c.classList.remove("open");
Expand Down Expand Up @@ -236,7 +252,7 @@ function sizeScale(){
bars. Bar height tracks t-shirt size; each bar has a done-dot (left) and owner bubble
(right). The window scrolls horizontally; zoom buttons set how many days fit on screen. */
/* chart starts at today - no dead space on the left */
let ZOOM = 2, showDone = false;
let ZOOM = DEFAULT_ZOOM, showDone = false;
let dayN, dayIso, barSpan, workDays, barColor, barGeom,
rollupSpan, spanFor, leafWeight, progWD, isUrgent, fmtD, commitBarDrag;
function syncDateHelpers() {
Expand Down Expand Up @@ -1720,7 +1736,7 @@ const _globals = {
toggleSearch, openTeam, micFabTap, openTranscript,
toggleFlyout, toggleFocus, toggleShowDone, toggleSubs, closeCapture, toggleCapLang, minimizeCapture,
sendTurn, restoreCapture, skipKey, saveKey, clearKey, closeTranscript, runTranscript, closeReview,
closeTeam, closeSheet, saveDetail, openProjectChart, setFilter, setScaleView, ding, toggleDone, openDetail, setZoom, setGView,
closeTeam, closeSheet, saveDetail, openProjectChart, setFilter, goHome, setScaleView, ding, toggleDone, openDetail, setZoom, setGView,
toggleExp, updTask, refreshBarMenu, addChild, addProject, deleteTask, addCapTask, barDown, barContext, pickSearch,
projDown, rowDown,
uploadPhoto, removePhoto, rvToggle, rvText, rvOwner, rvDue, rvSize, pushApproved, attachTranscript,
Expand Down
3 changes: 3 additions & 0 deletions src/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export const ZOOMS = [
{ l: "Next 6 weeks", s: "+6 weeks", h: 42, v: 42, r0: 0, r1: 41 },
];

/** Default timeline zoom: whole team, next week. */
export const DEFAULT_ZOOM = ZOOMS.findIndex((z) => z.s === "+1 week");

/** Visible gantt day range for a zoom preset (day offsets from today). */
export function ganttRange(zoom) {
if (zoom?.r0 != null && zoom?.r1 != null) return { r0: zoom.r0, r1: zoom.r1 };
Expand Down
6 changes: 6 additions & 0 deletions tests/constants.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import {
barHeight,
DEFAULT_ZOOM,
GBAR_H,
ganttRange,
LEAD,
Expand Down Expand Up @@ -50,4 +51,9 @@ describe("size constants", () => {
expect(ganttRange(ZOOMS[4])).toEqual({ r0: 0, r1: 20 });
expect(ganttRange(ZOOMS[5])).toEqual({ r0: 0, r1: 41 });
});

it("defaults to the next-week zoom preset", () => {
expect(DEFAULT_ZOOM).toBe(3);
expect(ZOOMS[DEFAULT_ZOOM].s).toBe("+1 week");
});
});
2 changes: 2 additions & 0 deletions tests/smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ describe("project layout", () => {
const html = readFileSync("index.html", "utf8");
expect(html).toContain('<script type="module" src="src/app/main.js">');
expect(html).not.toContain("<script>\n/* ================= sample data");
expect(html).toContain('onclick="goHome()"');
expect(html).toContain("assets/summon-logo.png");
expect(html).toContain('onclick="addProject()"');
expect(html).toContain("#vmodal.show .capwrap,#vmodal.show .caprestore{pointer-events:auto}");
});
Expand Down
Loading