feat(projects): gather the cards one member carries
A board answers "where does the work stand". Nobody opens a dashboard to ask that first: they ask what is on them today, and once the work is spread over several boards no single board can answer it. The cards assigned to a member are now listed on a page of their own, grouped by deadline, with a counter on the sidebar entry — a page you have to open to know whether it needs you is a page you stop opening. The column travels with each card, so finishing one from the list is a single move rather than a detour through its board. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d2256e2211
commit
fcc82d82d6
6 files changed
+732
-6
No files matched your search
+53
-3
@@ -21,6 +21,14 @@ const ROUTES = [
|
||||
module: './views/overview.js',
|
||||
level: LEVELS.STAFF,
|
||||
},
|
||||
{
|
||||
path: 'tasks',
|
||||
icon: '✓',
|
||||
label: 'Mes tâches',
|
||||
group: 'Pilotage',
|
||||
module: './views/tasks.js',
|
||||
level: LEVELS.STAFF,
|
||||
},
|
||||
{
|
||||
path: 'org',
|
||||
icon: '⬡',
|
||||
@@ -190,10 +198,18 @@ function liveIndicator() {
|
||||
return node;
|
||||
}
|
||||
|
||||
function sidebar() {
|
||||
const visible = ROUTES.filter(
|
||||
(route) => state.me.accessLevel >= route.level && (!route.advanced || state.mode === 'advanced'),
|
||||
/**
|
||||
* Pages the visitor can actually reach. Shared with the palette so a search
|
||||
* never offers a page that would answer with « niveau d’accès supérieur ».
|
||||
*/
|
||||
function visibleRoutes() {
|
||||
return ROUTES.filter(
|
||||
(route) => (state.me?.accessLevel ?? 0) >= route.level && (!route.advanced || state.mode === 'advanced'),
|
||||
);
|
||||
}
|
||||
|
||||
function sidebar() {
|
||||
const visible = visibleRoutes();
|
||||
|
||||
const groups = [];
|
||||
for (const route of visible) {
|
||||
@@ -222,6 +238,9 @@ function sidebar() {
|
||||
{ href: `#/${route.path}`, dataset: { route: route.path } },
|
||||
h('span', { class: 'nav-icon', text: route.icon }),
|
||||
h('span', { text: route.label }),
|
||||
// A page you have to open to know whether it needs you is a page
|
||||
// you stop opening; the count is what makes it a morning habit.
|
||||
route.path === 'tasks' && h('span', { class: 'nav-count', hidden: true }),
|
||||
),
|
||||
),
|
||||
]),
|
||||
@@ -286,6 +305,7 @@ async function renderView(host) {
|
||||
const route = ROUTES.find((entry) => entry.path === (segments[0] ?? ''));
|
||||
resetSubscriptions();
|
||||
highlightNav();
|
||||
refreshTaskCount();
|
||||
host.scrollIntoView?.({ block: 'start' });
|
||||
|
||||
if (!route) {
|
||||
@@ -334,9 +354,39 @@ export function render() {
|
||||
mount(app, shell);
|
||||
applyModeButtons(shell);
|
||||
highlightNav(shell);
|
||||
refreshTaskCount();
|
||||
renderView(main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open cards assigned to the viewer, shown on the sidebar entry.
|
||||
*
|
||||
* Asked for with `issues=0`: the counter needs a number, not a round trip to
|
||||
* the forge to resolve every linked issue. Throttled, because navigating is not
|
||||
* a reason to ask again.
|
||||
*/
|
||||
const TASK_COUNT_TTL_MS = 60_000;
|
||||
let taskCountAt = 0;
|
||||
|
||||
async function refreshTaskCount(force = false) {
|
||||
if (!qs('.nav-count')) return;
|
||||
if (!force && Date.now() - taskCountAt < TASK_COUNT_TTL_MS) return;
|
||||
taskCountAt = Date.now();
|
||||
|
||||
const data = await api.get('/api/me/tasks', { issues: '0' }).catch(() => null);
|
||||
// The shell may have been rebuilt while the request was in flight.
|
||||
const node = qs('.nav-count');
|
||||
if (!node || !data) return;
|
||||
|
||||
const { open, overdue } = data.counts;
|
||||
node.textContent = open > 99 ? '99+' : String(open);
|
||||
node.hidden = open === 0;
|
||||
node.dataset.tone = overdue > 0 ? 'late' : 'normal';
|
||||
node.title = overdue > 0 ? `${overdue} carte(s) en retard` : `${open} carte(s) à faire`;
|
||||
}
|
||||
|
||||
document.addEventListener('fws:tasks-changed', () => refreshTaskCount(true));
|
||||
|
||||
/** Names the interface actually being served, archive deployments being easy to get wrong. */
|
||||
async function showBuild() {
|
||||
const health = await api.get('/api/health').catch(() => null);
|
||||
|
||||
Reference in new issue
Block a user