Exclusivobeta
Net Progress <mv-net-progress>
Separa la actividad bruta del progreso neto y hace visible el trabajo que se deshace, para documentación y especificaciones, código, archivos de diseño, modelos, backlogs, calendarios editoriales o contratos en negociación. Dale ediciones con marca de tiempo (añadidas, eliminadas, revertidas, reabiertas, con un área y una versión opcionales) y cada marcha atrás se imputa al periodo cuyo trabajo deshace, empezando por el trabajo más reciente y dentro de una ventana opcional ("words still there after 14 days"), de modo que cada semana, día o mes muestra lo que se produjo y lo que sigue en pie; o dale periodos bruto/neto ya calculados por tu herramienta de analítica. Dibuja barras emparejadas por periodo (lo escrito, con la parte deshecha rayada, y lo conservado a su lado; los periodos aún en curso, con trazo discontinuo), convierte el periodo seleccionado en una frase con diez puntos (“For every 10 words written this week, 3 remain so far.”), detecta las idas y vueltas cuando un área vuelve a una versión que ya tuvo (“Pricing & plans went back and forth between two versions, 3 times.”, con el historial de versiones $49/mo → $59/mo → $49/mo), clasifica las áreas que más se rehacen con un filtro y un enlace directo, y describe la tendencia de forma neutral como exploración, convergencia o estabilidad a partir de un ajuste por mínimos cuadrados de lo deshecho en los últimos periodos completos, opcionalmente frente al plan previsto (expect="converge"). Una tabla de datos real espera detrás de un desplegable; el conjunto nunca nombra ni culpa a nadie.
| Categoría | Visualización de datos |
|---|---|
| Tipo | Web Component (<mv-net-progress>) |
| Estado | beta |
| Keywords | exclusive, culture, churn, rework, net-progress, gross-vs-net, productivity, analytics, oscillation, flip-flop, revisions, backlog, reopened, code-churn, document, contract, negotiation, trend, bar-chart, data-table, dashboard |
When to use
- A spec, doc or contract draft sees lots of editing and the team needs to know how much of the work actually stuck
- A backlog closes many tickets but reopened ones should count against the week they were closed, not vanish in a total
- Code or design analytics already compute added vs still-there-after-N-days and need a readable weekly summary
- A lead wants to see whether a project is still exploring or converging, and which sections keep flipping back
Avoid when
- The question is whether a goal will be met by a deadline and what daily pace is needed → use Steady Pace instead
- Readers must see which exact words of a text changed since a baseline, and who changed them → use Theseus instead
- One metric over time needs a plain line, area or bar chart with no churn semantics → use Chart instead
Instalación
node scripts/add.mjs net-progress --out ./src/marvelousAgente de IA con el servidor MCP de Marvelous UI: install_components({ slugs: ["net-progress"], target_dir: "<absolute path>/src/marvelous", framework: "react" }).
Archivos copiados (dependencias incluidas): tokens/tokens.css, core/base.css, core/dom.js, core/element.js, core/focus.js, core/observe.js, components/net-progress/net-progress.js, components/net-progress/net-progress.css.
Uso
Marcado de referencia: parte de él y personalízalo con atributos, data-* y variables CSS:
<div id="np-demo" style="width:min(100%,64rem);margin-inline:auto">
<style>
#np-demo { display:grid; gap:1.75rem }
#np-demo .npd-col { display:grid; gap:.75rem; min-width:0; align-content:start }
#np-demo .npd-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.75rem 1rem }
#np-demo .npd-bar h3 { margin:0; font-size:1.0625rem; letter-spacing:-.01em }
#np-demo .npd-bar p { margin:.125rem 0 0; color:var(--mv-fg-muted); font-size:.8125rem }
#np-demo .npd-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem }
#np-demo .npd-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.5rem; align-items:start }
#np-demo .npd-log { display:flex; align-items:center; gap:.5rem; min-width:0; color:var(--mv-fg-muted); font-size:.75rem }
#np-demo .npd-log span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
@media (max-width:52rem) { #np-demo .npd-row { grid-template-columns:minmax(0,1fr) } }
</style>
<!-- A product spec: words written vs words still there after 14 days -->
<section class="npd-col" aria-labelledby="npd-spec-h">
<div class="npd-bar">
<div>
<h3 id="npd-spec-h">Checkout 2.0 launch spec</h3>
<p>Shared product doc · 5 editors · a take-back within 14 days counts as churn</p>
</div>
<div class="npd-actions">
<mv-segmented id="npd-period" aria-label="Group by" value="week">
<button value="week">Weeks</button>
<button value="day">Days</button>
</mv-segmented>
<label class="mv-choice" data-control="end">
<input type="checkbox" role="switch" class="mv-switch" id="npd-expect">
<span class="mv-choice-text"><span class="mv-choice-title">Plan says converge</span></span>
</label>
<button class="mv-button" data-variant="outline" data-size="sm" type="button" id="npd-revert">Change pricing back to $59/mo</button>
</div>
</div>
<mv-net-progress id="npd-spec" label="Checkout 2.0 launch spec" unit="word|words" window="14d">
<script type="application/json" data-events>[
{"at":"-52d","area":"overview","added":900},
{"at":"-51d","area":"onboarding","added":1400},
{"at":"-49d","area":"pricing","added":500,"version":"$49/mo"},
{"at":"-45d","area":"onboarding","removed":900,"added":1200},
{"at":"-43d","area":"overview","removed":300,"added":350},
{"at":"-41d","area":"pricing","removed":350,"added":420,"version":"$59/mo"},
{"at":"-38d","area":"onboarding","removed":800,"added":900},
{"at":"-37d","area":"api","added":700,"version":"1,000 req/min"},
{"at":"-35d","area":"pricing","removed":380,"added":400,"version":"$49/mo"},
{"at":"-31d","area":"onboarding","removed":500,"added":600},
{"at":"-29d","area":"api","removed":300,"added":350,"version":"600 req/min"},
{"at":"-27d","area":"pricing","removed":300,"added":320,"version":"$59/mo"},
{"at":"-24d","area":"onboarding","removed":250,"added":400},
{"at":"-23d","area":"security","added":800},
{"at":"-21d","area":"api","removed":200,"added":260,"version":"1,000 req/min"},
{"at":"-17d","area":"security","removed":150,"added":300},
{"at":"-16d","area":"onboarding","removed":120,"added":250},
{"at":"-15d","area":"pricing","removed":280,"added":300,"version":"$49/mo"},
{"at":"-13d","area":"glossary","added":300},
{"at":"-14d","area":"security","removed":120,"added":90},
{"at":"-10d","area":"security","removed":80,"added":450},
{"at":"-9d","area":"onboarding","removed":40,"added":200},
{"at":"-8d","area":"overview","added":150},
{"at":"-7d","area":"security","removed":110},
{"at":"-6d","area":"api","added":120},
{"at":"-3d","area":"security","removed":30,"added":380},
{"at":"-2d","area":"onboarding","added":160},
{"at":"-1d","area":"overview","removed":20,"added":120},
{"at":"-1d","area":"onboarding","removed":70},
{"at":"-8h","area":"security","removed":90,"added":40},
{"at":"-2h","area":"pricing","added":90}
]</script>
<script type="application/json" data-areas>[
{"id":"overview","label":"Overview & goals","href":"#spec-overview"},
{"id":"onboarding","label":"Onboarding flow","href":"#spec-onboarding"},
{"id":"pricing","label":"Pricing & plans","href":"#spec-pricing"},
{"id":"api","label":"API rate limits","href":"#spec-api"},
{"id":"security","label":"Security review","href":"#spec-security"},
{"id":"glossary","label":"Glossary","href":"#spec-glossary"}
]</script>
</mv-net-progress>
<div class="npd-log" aria-hidden="true"><span class="mv-badge" data-variant="secondary" data-shape="pill" id="npd-event">event</span><span id="npd-last">Pick a week, or an area in “Most rework”…</span></div>
</section>
<div class="npd-row">
<!-- A sprint backlog: tickets closed vs tickets that stayed closed -->
<section class="npd-col" aria-labelledby="npd-bl-h">
<div class="npd-bar"><div><h3 id="npd-bl-h">Payments team backlog</h3><p>Compact · reopened tickets count against the week they were closed</p></div></div>
<mv-net-progress variant="compact" label="Sprint tickets" unit="ticket|tickets" gross-label="Closed" net-label="Stayed closed" net-verb="stayed closed" window="21d">
<script type="application/json" data-events>[
{"at":"-51d","area":"checkout","added":9},
{"at":"-49d","area":"search","added":6},
{"at":"-48d","area":"notifications","added":4},
{"at":"-44d","area":"checkout","reopened":4,"added":7},
{"at":"-43d","area":"search","reopened":2,"added":5},
{"at":"-41d","area":"billing","added":6},
{"at":"-38d","area":"checkout","reopened":3,"added":8},
{"at":"-36d","area":"billing","reopened":3,"added":5},
{"at":"-35d","area":"search","added":4},
{"at":"-30d","area":"checkout","reopened":4,"added":6},
{"at":"-29d","area":"notifications","reopened":1,"added":5},
{"at":"-27d","area":"billing","reopened":2,"added":4},
{"at":"-24d","area":"checkout","reopened":3,"added":7},
{"at":"-22d","area":"search","reopened":1,"added":6},
{"at":"-20d","area":"billing","added":5},
{"at":"-16d","area":"checkout","reopened":4,"added":6},
{"at":"-14d","area":"notifications","added":5},
{"at":"-13d","area":"search","reopened":2,"added":4},
{"at":"-10d","area":"checkout","reopened":3,"added":8},
{"at":"-8d","area":"billing","reopened":2,"added":6},
{"at":"-7d","area":"search","added":5},
{"at":"-3d","area":"checkout","reopened":4,"added":5},
{"at":"-2d","area":"search","added":4},
{"at":"-1d","area":"notifications","added":3},
{"at":"-6h","area":"checkout","reopened":3}
]</script>
<script type="application/json" data-areas>[
{"id":"checkout","label":"Checkout"},
{"id":"search","label":"Search"},
{"id":"billing","label":"Billing"},
{"id":"notifications","label":"Notifications"}
]</script>
</mv-net-progress>
</section>
<!-- A codebase, from pre-computed analytics: lines added vs still there after 21 days -->
<section class="npd-col" aria-labelledby="npd-code-h">
<div class="npd-bar"><div><h3 id="npd-code-h">checkout-service repository</h3><p>Compact · pre-computed periods · lines still there after 21 days</p></div></div>
<mv-net-progress variant="compact" label="Lines of code" unit="line|lines" gross-label="Added" net-label="Still there" net-verb="are still there">
<script type="application/json" data-periods>[
{"start":"-52d","gross":3120,"net":1480},
{"start":"-45d","gross":2840,"net":1620},
{"start":"-38d","gross":3400,"net":2050},
{"start":"-31d","gross":2600,"net":1790},
{"start":"-24d","gross":2950,"net":2240},
{"start":"-17d","gross":2210,"net":1810,"state":"settling"},
{"start":"-10d","gross":1980,"net":1700,"state":"settling"},
{"start":"-3d","gross":1460,"net":1350}
]</script>
</mv-net-progress>
</section>
</div>
<script type="module">
const spec = document.getElementById("npd-spec");
await customElements.whenDefined("mv-net-progress");
const $ = (id) => document.getElementById(id);
const log = (name, text) => { $("npd-event").textContent = name; $("npd-last").textContent = text; };
spec.addEventListener("mv-period-change", (e) => log("mv-period-change", `${e.detail.period.name}: ${e.detail.period.gross.toLocaleString("en-US")} written, ${e.detail.period.net.toLocaleString("en-US")} kept`));
spec.addEventListener("mv-churn-select", (e) => {
const d = e.detail;
if (d.action === "open") {
e.preventDefault(); // the app would scroll to or open that section
log("mv-churn-select", `Open “${d.label}” (${d.changedBack} changes back, ${Math.round(d.ratio * 100)}% taken back)`);
} else log("mv-churn-select", d.id ? `Filter to “${d.label}”` : "Show all areas");
});
$("npd-period").addEventListener("mv-change", (e) => {
const day = e.detail.value === "day";
spec.limit = day ? 14 : 8;
spec.period = day ? "day" : "week";
});
$("npd-expect").addEventListener("change", (e) => { spec.expect = e.target.checked ? "converge" : null; });
let next = "$59/mo";
$("npd-revert").addEventListener("click", (e) => {
spec.addEvents({ at: new Date(), area: "pricing", removed: 300, added: 300, version: next });
log("addEvents", `Pricing & plans changed back to ${next}`);
next = next === "$59/mo" ? "$49/mo" : "$59/mo";
e.currentTarget.textContent = `Change pricing back to ${next}`;
});
</script>
</div>Referencia cultural
La Odisea, Homero (hacia el siglo VIII a. C., poema épico). Penélope teje un sudario de día y lo deshace en secreto de noche, así que una gran cantidad de trabajo visible no produce ningún progreso. En la interfaz, la actividad bruta y el progreso neto se separan: cada edición que deshace un trabajo anterior se imputa al periodo que lo produjo, y las vueltas repetidas a una versión anterior se señalan, de modo que las semanas ajetreadas que no llevaron a ninguna parte se hacen visibles sin culpar a nadie.
API
Attributes
| Name | Tipo | Default | Description |
|---|---|---|---|
label | string | Name of what is tracked ("Checkout 2.0 launch spec"). Titles the group, the data table caption and the header. | |
unit | "singular|plural" | string | change|changes | What is counted: "word|words", "line|lines", "ticket|tickets", "clause|clauses". A single word gets an automatic plural (a trailing s is read as already plural). |
gross-label | string | Written | Legend and column name of gross activity ("Added", "Closed", "Proposed"). Its lowercase form is the default gross-verb. |
net-label | string | Kept | Legend and column name of net progress ("Still there", "Stayed closed", "Agreed"). |
gross-verb | string | lowercase gross-label | Verb in sentences: “For every 10 words {gross-verb} this week…”. |
net-verb | string | remain | Verb in sentences: “…, 3 {net-verb}.” ("are still there", "stayed closed"). |
period | day | week | month | week | Bucket size for events, and the unit named in sentences, the trend and the table. Pre-computed periods keep their own starts. |
limit | number | 8 | How many periods are shown, ending with the one that contains now. Older events still count: their work can be taken back inside the range. |
window | time ("14d", "2w", "36h", days as a number) | A take-back only counts as churn if it undoes work younger than this ("lines still there after 14 days"); older work has settled and its later revisions are reported separately as “earlier work revised”. Periods closer to now than the window are marked as still settling. Without it, any later take-back counts and only the current period is marked in progress. | |
top | number | 5 | Length of the “Most rework” list (areas with take-backs or back and forth, by amount taken back). |
oscillation | number | 2 | How many changes back an area needs before it is listed under “Back and forth”. |
trend | number | 4 | How many recent periods with activity the exploring/converging trend is fitted on (the current period is left out once there are at least four). |
expect | explore | converge | What the plan expects now. With converge, an exploring phase adds a neutral pointer to the areas that rework most; with explore, it is confirmed as matching the plan. | |
now | date (ISO, YYYY-MM-DD, epoch ms) | the current time | Reference time for the range, relative dates and the in-progress / settling states (reports, tests, time travel). |
week-start | 0-6 | 1 (Monday) | First day of a week bucket (0 = Sunday). |
locale | BCP 47 tag | en-US | Number, percent and date formatting. |
variant | full | compact | full | compact keeps the header, the sentence, the figures, the chart and the data table, and hides the trend, back and forth and area panels (dashboard tiles). |
area | string (area id) | Filters the chart, sentence, trend and table to one area. Reflected when the user picks an area; remove it to show all areas. |
Properties
| Name | Tipo | Description |
|---|---|---|
events | Array<{ at, area?, added?, removed?, reverted?, reopened?, state?, version?, href? }> | Timestamped edits (also read from a child <script type="application/json" data-events>). at: Date, epoch ms, ISO, YYYY-MM-DD or relative ("-3d", "-2w", "-6h", "now"). added is new work; removed, reverted and reopened are take-backs charged to the most recent work of the same area. state (or version, a readable label such as "$49/mo") fingerprints the area after the edit: returning to an earlier state counts as a change back; a reverted amount without state counts as one too. Tuples [at, area, added, removed, state] are accepted. |
periods | Array<{ start | label, gross, net | taken, state? }> | Array<[start, gross, net]> | Pre-computed periods (also data-periods), used when there are no events. net may be negative (more removed than added). state: "current" | "settling" | "final"; otherwise the period containing now is current. |
areas | Array<{ id, label, href?, gross?, net?, changedBack?, versions?, periods? }> | Record<id, …> | Area names and jump links (also data-areas). Without events it also carries the area figures; an area with its own periods series can filter the chart. |
summary | object | Read-only: { mode, area, periods (gross, net, taken, ratio, earlier, state, name…), selected, totals, phase { phase, kind, from, to, avg, n }, areas, oscillations }. |
selectedPeriod | number | Index of the selected period in the visible range (latest by default; stays on the latest when new periods arrive). |
selectedArea | string | null | Mirror of the area attribute. |
strings | Partial<Record<string, string>> | Overrides for every visible text and announcement (headline templates ratio / all / nearlyAll / none / negative, when-phrases, trend texts, back / backTwo, titles, table headers…). English defaults. |
Methods
| Name | Description |
|---|---|
selectPeriod(index | "latest") | Selects a period; emits mv-period-change. Returns false when out of range or canceled. |
selectArea(id | null) | Filters to an area or back to all; emits mv-churn-select. Returns false when unknown or canceled. |
addEvents(events) | Appends live events (one or an array) and recomputes; selections are kept. |
refresh() | Recomputes, e.g. after mutating the events array in place or when now should move. |
Events
| Name | Description |
|---|---|
mv-period-change | Cancelable. A period was selected (click, arrow keys, API). detail: { index, period (gross, net, taken, ratio, earlier, state, name, start, end), previous, via: "pointer" | "keyboard" | "api" }. preventDefault() keeps the current selection. |
mv-churn-select | Cancelable. An area was picked. detail: { id, label, href, action: "filter" | "open" | "clear", gross, net, taken, ratio, changedBack, trail, via }. For filter, preventDefault() keeps the chart as it is; for open (the jump link), preventDefault() stops the navigation so the app can route or scroll itself. |
Content structure
| Name | Description |
|---|---|
script[data-events] / script[data-periods] / script[data-areas] | Optional JSON children read once on first connection (properties set before that win). |
CSS classes
| Name | Description |
|---|---|
mv-net-progress-root | The card (role=group, data-variant, data-mode="events | periods"). |
mv-net-progress-head / -label / -range / -chip | Header: label, date range with the overall kept share, phase chip (data-phase="exploring | converging | steady"). |
mv-net-progress-headline / -pips / -stats / -note | The sentence for the selected period (numbers in <b>), ten pips filled with the kept share, the three figures, and the earlier-work note. |
mv-net-progress-plot / -col / -bar / -taken / -tag / -tick | Chart: one radio button per period (data-selected, data-state="current | settling | final", data-empty, --_g, --_n, --_t), paired bars (data-kind="gross | net"), hatched taken-back part, kept % tag, period tick. |
mv-net-progress-trend / -phase / -spark | Exploring or converging panel: phase badge, sentence, churn sparkline with the fitted trend dashed. |
mv-net-progress-back / -back-item / -trail / -ver | Back and forth panel: one filter button per oscillating area with its version trail. |
mv-net-progress-areas / -area / -area-btn / -area-bar / -area-link | Most rework list: filter toggle (aria-pressed), kept vs taken-back bar, jump link. |
mv-net-progress-data / -table | <details> disclosure with the full data table. |
CSS variables
| Name | Default | Description |
|---|---|---|
--mv-net-progress-net | var(--mv-accent) | Kept (net progress) bars, pips and area bars. |
--mv-net-progress-gross | muted neutral | Gross activity bars. |
--mv-net-progress-taken | var(--mv-fg-muted) | Ink of the taken-back hatching and of the churn sparkline. |
--mv-net-progress-exploring | var(--mv-info) | Tint of the Exploring phase badge. |
--mv-net-progress-converging | var(--mv-success) | Tint of the Converging phase badge. |
--mv-net-progress-chart-height | 11rem | Height of the bar area. |
--mv-net-progress-padding | var(--mv-space-5) | Card padding. |
Accessibility
The card is a group named by its label and described by the headline, so the key fact is read in words first (“For every 10 words written this week, 3 remain so far.”); the ten pips, bars, area bars and sparkline are aria-hidden because the same facts are in text. The chart is a radiogroup of real buttons, one per period, each with a full label (“Week of Sep 14: 1,240 words written, 380 remain, 860 taken back (69% churn). Still settling: take-backs can still arrive.”); it is a single Tab stop, arrows, Home and End move and select, and the selection follows focus. Its complete equivalent is a real table (period, written, kept, taken back, churn, status) behind a native <details> disclosure that everyone can open. Nothing is color-only: taken-back work is hatched, still-settling periods are dashed, the phase is a word with an icon, and changes back are counted in words. Area filters and back-and-forth items are toggle buttons (aria-pressed); jump links are real links with a named target (“Open Pricing & plans”). A polite live region speaks only when the area filter changes (“Showing Pricing & plans only. For every 10 words…”); period moves are already read by the radio labels. All wording describes the work, never a person, and exploring is framed as expected rather than as a problem; no red is used. Reduced motion (OS setting or data-motion="reduce"): no draw-in, bars and pips jump instead of growing. Forced colors: kept uses Highlight, gross an outlined Canvas bar, taken back a CanvasText hatch, and the selected period gets a Highlight outline.