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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Versioning follows [SemVer](https://semver.org/): **MAJOR.MINOR.PATCH**

---

## [1.35.2] — 2026-06-10

### Changed
- **Rolo recém-cadastrado (ainda não pesado) passa a exibir o peso nominal como peso assumido** (cheio), em vez de mostrar "—" / "Não pesado ainda". O detalhe do rolo, a lista, o detalhe do filamento e o inventário agora mostram o nominal rotulado como `não pesado`, consistente com os relatórios e as roscas (que já o tratavam como cheio desde v1.35.0). Nenhuma pesagem é criada — o dado continua honesto (o histórico de pesagens segue vazio até a primeira pesagem real); só a exibição deixou de parecer "zerada".

## [1.35.1] — 2026-06-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.35.1
1.35.2
2 changes: 1 addition & 1 deletion templates/filaments/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h5 class="fw-semibold mb-3">{{ _('Spools') }} ({{ spools|length }})</h5>
<td>{{ s.nominal_weight_g|int }}g</td>
<td>
{% if s.current_net_g is not none %}{{ s.current_net_g|int }}g
{% else %}<span class="text-muted">—</span>{% endif %}
{% else %}<span class="text-muted" data-bs-toggle="tooltip" title="{{ _('não pesado') }}">{{ s.nominal_weight_g|int }}g</span>{% endif %}
</td>
<td>
{% if s.active %}
Expand Down
2 changes: 1 addition & 1 deletion templates/reports/inventory.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h4 class="mb-0 fw-bold">{{ _('Inventário') }} <span class="text-muted fs-6">({
data-hex="{{ s.color_hex }}"
data-fill="{{ fill }}"
data-pct="{{ pct }}"
data-remaining="{% if s.current_net_g is not none %}{{ s.current_net_g|int }} g / {{ s.nominal_weight_g|int }} g ({{ pct|int }}%){% else %}{% endif %}"
data-remaining="{% if s.current_net_g is not none %}{{ s.current_net_g|int }} g / {{ s.nominal_weight_g|int }} g ({{ pct|int }}%){% else %}{{ s.nominal_weight_g|int }} g · {{ _('não pesado') }}{% endif %}"
data-diameter="{{ s.diameter_mm }} mm"
data-location="{{ s.location or '—' }}"
data-notes="{{ s.notes }}"
Expand Down
3 changes: 2 additions & 1 deletion templates/spools/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ <h4 class="mb-0 fw-bold ms-2">SP-{{ '%04d'|format(spool.id) }}</h4>
<div class="text-muted" style="font-size:0.75rem">{{ _('Pesado em') }} {{ spool.last_weighed_at | localdate }}</div>
{% endif %}
{% else %}
<div class="text-muted">{{ _('Não pesado ainda') }}</div>
<div class="fs-3 fw-bold">{{ spool.nominal_weight_g|int }}g</div>
<div class="text-muted small">{{ _('de {n}g nominais').replace('{n}', spool.nominal_weight_g|int|string) }} · {{ _('não pesado') }}</div>
{% if logged_in and spool.active %}
<a href="{{ url_for('spools_weigh', spool_id=spool.id) }}" class="btn btn-dark btn-sm mt-2">{{ _('Registrar peso') }}</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/spools/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h4 class="mb-0 fw-bold">
<td>{{ s.brand }} / {{ s.family }}</td>
<td>{{ s.location or '—' }}</td>
<td class="weight-cell">
{% if s.current_net_g is not none %}{{ s.current_net_g|int }}g{% else %}{% endif %}
{% if s.current_net_g is not none %}{{ s.current_net_g|int }}g{% else %}<span class="text-muted" data-bs-toggle="tooltip" title="{{ _('não pesado') }}">{{ s.nominal_weight_g|int }}g</span>{% endif %}
</td>
<td class="text-nowrap" onclick="event.stopPropagation()">
<a href="{{ url_for('spools_detail', spool_id=s.id) }}" class="btn btn-sm btn-outline-secondary">{{ _('Ver') }}</a>
Expand Down
9 changes: 9 additions & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ def test_spool_detail_pages_render(auth_client, db):
assert resp.status_code == 200, f"{url} retornou {resp.status_code}"


def test_unweighed_spool_detail_shows_nominal(auth_client, db):
"""Rolo não pesado: o detalhe assume o peso nominal (cheio) em vez de exibir 0/—.
Trava a correção visual — consistente com relatórios e donuts."""
sid = _make_spool(db, nominal=1000)
html = auth_client.get(f"/spools/{sid}").get_data(as_text=True)
assert "1000g" in html
assert "Não pesado ainda" not in html


# ── Autoatualização: o app só escreve o flag (sem privilégio) ────────────────

def test_update_run_writes_flag(auth_client, db):
Expand Down
2 changes: 2 additions & 0 deletions translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@
_EN["Tara (g)"] = "Tare (g)"
_EN["Compra"] = "Purchase"
_EN["Não pesado ainda"] = "Not weighed yet"
_EN["não pesado"] = "not weighed"
_EN["Remover da fila de impressão"] = "Remove from print queue"
_EN["Adicionar à fila de impressão"] = "Add to print queue"
_EN["de {n}g nominais"] = "of {n}g nominal"
Expand Down Expand Up @@ -1111,6 +1112,7 @@
_ES["Tara (g)"] = "Tara (g)"
_ES["Compra"] = "Compra"
_ES["Não pesado ainda"] = "Aún no pesado"
_ES["não pesado"] = "sin pesar"
_ES["Remover da fila de impressão"] = "Quitar de la cola de impresión"
_ES["Adicionar à fila de impressão"] = "Agregar a la cola de impresión"
_ES["de {n}g nominais"] = "de {n}g nominales"
Expand Down