stackhelx 1.1.4__tar.gz → 1.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {stackhelx-1.1.4 → stackhelx-1.6.0}/CHANGELOG.md +22 -0
  2. {stackhelx-1.1.4 → stackhelx-1.6.0}/PKG-INFO +1 -1
  3. stackhelx-1.6.0/stackhelx/__init__.py +2 -0
  4. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/browse.py +1 -1
  5. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/server.py +1 -1
  6. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/web/app.css +99 -66
  7. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/web/app.js +103 -28
  8. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/web/index.html +9 -0
  9. stackhelx-1.6.0/stackhelx/web/logic.js +70 -0
  10. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/web/tokens.css +14 -2
  11. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_server.py +2 -1
  12. stackhelx-1.6.0/tests/test_web_logic.py +57 -0
  13. stackhelx-1.1.4/stackhelx/__init__.py +0 -2
  14. {stackhelx-1.1.4 → stackhelx-1.6.0}/.github/workflows/ci.yml +0 -0
  15. {stackhelx-1.1.4 → stackhelx-1.6.0}/.github/workflows/release.yml +0 -0
  16. {stackhelx-1.1.4 → stackhelx-1.6.0}/.gitignore +0 -0
  17. {stackhelx-1.1.4 → stackhelx-1.6.0}/AGENTS.md +0 -0
  18. {stackhelx-1.1.4 → stackhelx-1.6.0}/CLAUDE.md +0 -0
  19. {stackhelx-1.1.4 → stackhelx-1.6.0}/LICENSE +0 -0
  20. {stackhelx-1.1.4 → stackhelx-1.6.0}/README.es.md +0 -0
  21. {stackhelx-1.1.4 → stackhelx-1.6.0}/README.md +0 -0
  22. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/comandos.md +0 -0
  23. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/deteccion.md +0 -0
  24. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/es/comandos.md +0 -0
  25. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/es/deteccion.md +0 -0
  26. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/es/interfaz.md +0 -0
  27. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/es/stack-yaml.md +0 -0
  28. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/interfaz.md +0 -0
  29. {stackhelx-1.1.4 → stackhelx-1.6.0}/docs/stack-yaml.md +0 -0
  30. {stackhelx-1.1.4 → stackhelx-1.6.0}/pyproject.toml +0 -0
  31. {stackhelx-1.1.4 → stackhelx-1.6.0}/scripts/check_docs.py +0 -0
  32. {stackhelx-1.1.4 → stackhelx-1.6.0}/scripts/check_metadata.py +0 -0
  33. {stackhelx-1.1.4 → stackhelx-1.6.0}/stack.example.yaml +0 -0
  34. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/__main__.py +0 -0
  35. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/cli.py +0 -0
  36. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/config.py +0 -0
  37. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/detect.py +0 -0
  38. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/docker.py +0 -0
  39. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/doctor.py +0 -0
  40. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/guardrails.py +0 -0
  41. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/history.py +0 -0
  42. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/mcp.py +0 -0
  43. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/ports.py +0 -0
  44. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/registry.py +0 -0
  45. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/runner.py +0 -0
  46. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/scripts.py +0 -0
  47. {stackhelx-1.1.4 → stackhelx-1.6.0}/stackhelx/tunnel.py +0 -0
  48. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/conftest.py +0 -0
  49. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_browse.py +0 -0
  50. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_cli.py +0 -0
  51. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_config.py +0 -0
  52. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_conftest.py +0 -0
  53. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_detect.py +0 -0
  54. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_guardrails.py +0 -0
  55. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_history.py +0 -0
  56. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_mcp.py +0 -0
  57. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_ports.py +0 -0
  58. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_registry.py +0 -0
  59. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_runner.py +0 -0
  60. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_scripts.py +0 -0
  61. {stackhelx-1.1.4 → stackhelx-1.6.0}/tests/test_tunnel.py +0 -0
  62. {stackhelx-1.1.4 → stackhelx-1.6.0}/uv.lock +0 -0
@@ -4,6 +4,28 @@ Formato de [Keep a Changelog](https://keepachangelog.com/es/1.1.0/).
4
4
  Versionado semántico: la superficie pública son los comandos del CLI, el
5
5
  esquema de `stack.yaml` y las rutas de la API local.
6
6
 
7
+ ## [1.6.0] - 2026-11-21
8
+
9
+ Salta de 1.1.4 a 1.6.0 porque los tags v1.2.0 a v1.5.2 ya existen en el repo, de la etapa en que se llamaba PortMaster; en PyPI, `stackhelx` pasa de 1.1.4 a 1.6.0.
10
+
11
+ ### Corregido
12
+
13
+ - **Error al cargar la lista (`web/`):** si `/api/state` falla, el cuerpo ya no se queda en "Cargando proyectos…": muestra la causa (error del servidor, sin conexión, token o petición) con un botón Reintentar, y `aria-busy` vuelve a falso. Si ya había tarjetas, se conservan y el encabezado avisa que los datos son viejos.
14
+ - **Foco y contraste (`web/`):** el resumen del modal MCP tenía el foco invisible (`--color-focus` no existía). Los bordes de botones, búsqueda, inputs y selects suben a 3:1 o más en los dos temas (antes ~1.7:1).
15
+ - Tuteo en todos los textos de la interfaz y en `server.py`; la entrada "Inicio" del selector de carpetas se traduce; el campo del token tiene nombre accesible.
16
+
17
+ ### Añadido
18
+
19
+ - **Conflictos de puerto (`web/`):** un puerto sale en rojo solo si dos proyectos lo declaran, con una nota que nombra al otro proyecto. Los demás puertos se muestran como dato, en latón.
20
+ - **Confirmación antes de detener un proceso (`web/`):** los cuatro puntos que matan un proceso piden confirmación nombrando proceso, pid y puerto. El botón se llama "Detener proceso", distinto de la ✕ que cierra el diálogo.
21
+ - `browse.py` marca la carpeta de inicio con `home: true` para que la interfaz la traduzca.
22
+
23
+ ### Cambiado
24
+
25
+ - **Acción principal según el estado (`web/`):** Start solo aparece en proyectos detenidos y Stop solo cuando hay algo propio que apagar. Un proyecto iniciado fuera de StackHelx dice "Iniciado fuera de StackHelx" y lleva al mapa de puertos, desde donde se detiene.
26
+ - **Interfaz sobria (`web/`):** sin sombras difusas, brillos ni el pulso infinito de "Procesos intrusos"; colores sueltos movidos a tokens. Las palabras salen de la monoespaciada, que queda para datos.
27
+ - En móvil, cada servicio ocupa una línea.
28
+
7
29
  ## [1.1.4] - 2026-10-31
8
30
 
9
31
  ### Corregido
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stackhelx
3
- Version: 1.1.4
3
+ Version: 1.6.0
4
4
  Summary: Local development environment orchestrator: ports, Docker, backend, and frontend with a single command
5
5
  Project-URL: Homepage, https://github.com/TicoraX/StackHelx
6
6
  Project-URL: Repository, https://github.com/TicoraX/StackHelx
@@ -0,0 +1,2 @@
1
+ __version__ = "1.6.0"
2
+
@@ -125,7 +125,7 @@ def markers(path: Path) -> list[str]:
125
125
  def roots() -> dict:
126
126
  """Punto de partida: la home del usuario y las unidades montadas."""
127
127
  seen = {str(Path.home())}
128
- entries = [{"name": "Inicio", "path": str(Path.home()), "markers": []}]
128
+ entries = [{"name": "Home", "home": True, "path": str(Path.home()), "markers": []}]
129
129
  try:
130
130
  partitions = psutil.disk_partitions(all=False)
131
131
  except OSError:
@@ -1212,7 +1212,7 @@ def create_app(token: str | None = None) -> FastAPI:
1212
1212
  with sessions_lock:
1213
1213
  session = sessions.get(pid)
1214
1214
  if session is None:
1215
- raise HTTPException(404, "ese stack no fue arrancado desde aca")
1215
+ raise HTTPException(404, "ese stack no fue arrancado desde aquí")
1216
1216
  if session.state != "running":
1217
1217
  raise HTTPException(409, "el stack no esta corriendo")
1218
1218
  if session.engine is None:
@@ -68,7 +68,7 @@ textarea {
68
68
  justify-content: space-between;
69
69
  gap: var(--space-sm) var(--space-lg);
70
70
  padding: var(--space-lg) var(--space-gutter) var(--space-md);
71
- border-bottom: var(--rule) solid var(--color-rule-strong);
71
+ border-bottom: var(--rule) solid var(--color-rule);
72
72
  }
73
73
 
74
74
  .wordmark {
@@ -189,9 +189,8 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
189
189
  margin-bottom: var(--space-lg);
190
190
  padding: var(--space-sm);
191
191
  background: var(--color-paper-2);
192
- border: var(--rule) solid var(--color-rule-strong);
192
+ border: var(--rule) solid var(--color-rule);
193
193
  border-radius: var(--radius);
194
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
195
194
  }
196
195
 
197
196
  .find__bar {
@@ -202,12 +201,13 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
202
201
  background: var(--color-paper);
203
202
  border: var(--rule) solid var(--color-rule-strong);
204
203
  border-radius: var(--radius);
205
- transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
204
+ transition: border-color var(--dur-fast) var(--ease-out);
206
205
  }
207
206
 
208
207
  .find__bar:focus-within {
209
- border-color: var(--color-ink-2);
210
- box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
208
+ border-color: var(--color-accent);
209
+ outline: 2px solid var(--color-accent);
210
+ outline-offset: 1px;
211
211
  }
212
212
 
213
213
  .find__icon {
@@ -235,7 +235,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
235
235
  .kbd {
236
236
  font-family: var(--font-mono);
237
237
  font-size: var(--text-xs);
238
- color: var(--color-ink-3);
238
+ color: var(--color-ink-2);
239
239
  background: var(--color-paper-3);
240
240
  border: var(--rule) solid var(--color-rule);
241
241
  border-radius: 4px;
@@ -293,7 +293,6 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
293
293
  background: var(--color-ink);
294
294
  color: var(--color-paper);
295
295
  border-color: var(--color-ink);
296
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
297
296
  }
298
297
 
299
298
  .chip--active:hover:not(:disabled) {
@@ -334,8 +333,27 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
334
333
  font-style: italic;
335
334
  }
336
335
 
336
+ .index__error {
337
+ display: flex;
338
+ flex-wrap: wrap;
339
+ align-items: center;
340
+ justify-content: space-between;
341
+ gap: var(--space-md);
342
+ padding: var(--space-md);
343
+ background: var(--color-bad-soft);
344
+ border: var(--rule) solid var(--color-bad-rule);
345
+ border-left: 3px solid var(--color-bad);
346
+ border-radius: var(--radius);
347
+ }
348
+
349
+ .index__error p {
350
+ margin: 0;
351
+ font-size: var(--text-sm);
352
+ color: var(--color-ink);
353
+ }
354
+
337
355
  .project {
338
- border: var(--rule) solid var(--color-rule-strong);
356
+ border: var(--rule) solid var(--color-rule);
339
357
  border-radius: var(--radius);
340
358
  padding: var(--space-md) var(--space-lg);
341
359
  background: var(--color-paper-2);
@@ -378,6 +396,18 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
378
396
  margin-left: auto;
379
397
  }
380
398
 
399
+ .project__outside {
400
+ display: inline-flex;
401
+ align-items: center;
402
+ gap: var(--space-xs);
403
+ font-size: var(--text-xs);
404
+ color: var(--color-ink-2);
405
+ }
406
+
407
+ .project__outside[hidden] {
408
+ display: none;
409
+ }
410
+
381
411
  .project__toggle {
382
412
  display: inline-flex;
383
413
  align-items: center;
@@ -480,10 +510,6 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
480
510
  border-color: var(--color-ink-3);
481
511
  }
482
512
 
483
- .editor__select:focus-visible {
484
- outline: none;
485
- border-color: var(--color-accent);
486
- }
487
513
 
488
514
 
489
515
  .project__error {
@@ -901,7 +927,6 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
901
927
  height: 6px;
902
928
  border-radius: 50%;
903
929
  background: var(--color-ok);
904
- box-shadow: 0 0 4px var(--color-ok);
905
930
  }
906
931
 
907
932
  .logs {
@@ -930,7 +955,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
930
955
  .history__table th,
931
956
  .history__table td {
932
957
  padding: var(--space-xs) var(--space-sm);
933
- border-bottom: var(--rule) solid var(--color-rule-strong);
958
+ border-bottom: var(--rule) solid var(--color-rule);
934
959
  }
935
960
 
936
961
  .history__table th {
@@ -1074,7 +1099,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1074
1099
  .enroll {
1075
1100
  margin-top: var(--space-xl);
1076
1101
  padding-top: var(--space-lg);
1077
- border-top: var(--rule) solid var(--color-rule-strong);
1102
+ border-top: var(--rule) solid var(--color-rule);
1078
1103
  }
1079
1104
 
1080
1105
  .enroll__label {
@@ -1126,9 +1151,9 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1126
1151
 
1127
1152
  .project__docker-warning {
1128
1153
  font-size: var(--text-xs);
1129
- color: oklch(50% 0.12 27);
1130
- background: oklch(58% 0.19 27 / 0.1);
1131
- border: 1px solid oklch(55% 0.12 27 / 0.3);
1154
+ color: var(--color-bad-ink);
1155
+ background: var(--color-bad-soft);
1156
+ border: 1px solid var(--color-bad-rule);
1132
1157
  padding: var(--space-xs) var(--space-sm);
1133
1158
  border-radius: var(--radius);
1134
1159
  margin-top: var(--space-xs);
@@ -1158,7 +1183,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1158
1183
  padding: 0;
1159
1184
  color: var(--color-ink);
1160
1185
  background: var(--color-paper-2);
1161
- border: var(--rule) solid var(--color-rule-strong);
1186
+ border: var(--rule) solid var(--color-rule);
1162
1187
  border-radius: var(--radius);
1163
1188
  }
1164
1189
 
@@ -1168,7 +1193,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1168
1193
  }
1169
1194
 
1170
1195
  .picker::backdrop {
1171
- background: oklch(20% 0.01 70 / 0.45);
1196
+ background: var(--color-scrim);
1172
1197
  }
1173
1198
 
1174
1199
  .picker__head {
@@ -1463,14 +1488,13 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1463
1488
  .orphans {
1464
1489
  margin-top: var(--space-xl);
1465
1490
  background: var(--color-paper);
1466
- border: var(--rule) solid var(--color-rule-strong);
1491
+ border: var(--rule) solid var(--color-rule);
1467
1492
  border-radius: var(--radius);
1468
1493
  overflow: hidden;
1469
- box-shadow: var(--shadow-sm);
1470
1494
  }
1471
1495
 
1472
1496
  .orphans[data-tone="bad"] {
1473
- border-color: oklch(55% 0.18 27 / 0.4);
1497
+ border-color: var(--color-bad-rule);
1474
1498
  }
1475
1499
 
1476
1500
  .orphans__heading {
@@ -1488,9 +1512,9 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1488
1512
  }
1489
1513
 
1490
1514
  .orphans[data-tone="bad"] .orphans__heading {
1491
- color: oklch(65% 0.2 27);
1492
- background: oklch(55% 0.18 27 / 0.1);
1493
- border-bottom-color: oklch(55% 0.18 27 / 0.25);
1515
+ color: var(--color-bad-ink);
1516
+ background: var(--color-bad-soft);
1517
+ border-bottom-color: var(--color-bad-rule);
1494
1518
  }
1495
1519
 
1496
1520
  .orphans__heading::before {
@@ -1503,14 +1527,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1503
1527
  }
1504
1528
 
1505
1529
  .orphans[data-tone="bad"] .orphans__heading::before {
1506
- background: oklch(65% 0.2 27);
1507
- box-shadow: 0 0 0 2px oklch(65% 0.2 27 / 0.25);
1508
- animation: orphan-pulse 1.8s ease-in-out infinite;
1509
- }
1510
-
1511
- @keyframes orphan-pulse {
1512
- 0%, 100% { opacity: 1; }
1513
- 50% { opacity: 0.35; }
1530
+ background: var(--color-bad);
1514
1531
  }
1515
1532
 
1516
1533
  .orphans__header {
@@ -1548,8 +1565,8 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1548
1565
  }
1549
1566
 
1550
1567
  .orphans[data-tone="bad"] .orphans__bar {
1551
- background: oklch(55% 0.18 27 / 0.1);
1552
- border-bottom-color: oklch(55% 0.18 27 / 0.25);
1568
+ background: var(--color-bad-soft);
1569
+ border-bottom-color: var(--color-bad-rule);
1553
1570
  }
1554
1571
 
1555
1572
  .orphans__actions {
@@ -1608,7 +1625,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1608
1625
  }
1609
1626
 
1610
1627
  .orphans[data-tone="bad"] .orphan:hover {
1611
- background: oklch(55% 0.12 27 / 0.07);
1628
+ background: var(--color-bad-soft);
1612
1629
  }
1613
1630
 
1614
1631
  /* Elegir cuales cerrar. Sale solo con dos o mas filas, porque con una sola el
@@ -1633,8 +1650,8 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1633
1650
  font-family: var(--font-mono);
1634
1651
  font-size: var(--text-xs);
1635
1652
  font-weight: 600;
1636
- color: oklch(65% 0.2 27);
1637
- background: oklch(55% 0.18 27 / 0.15);
1653
+ color: var(--color-cifra);
1654
+ background: var(--color-paper-3);
1638
1655
  padding: 0.15rem 0.4rem;
1639
1656
  border-radius: var(--radius);
1640
1657
  white-space: nowrap;
@@ -1655,9 +1672,21 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1655
1672
 
1656
1673
  /* Por que esta fila esta en la lista. Va entre el proceso y su linea de
1657
1674
  * comando, con el color de aviso: el dato no es del proceso, es del puerto. */
1675
+ .orphan__port[data-conflict="true"] {
1676
+ color: var(--color-bad-ink);
1677
+ background: var(--color-bad-soft);
1678
+ outline: 1px solid var(--color-bad-rule);
1679
+ outline-offset: -1px;
1680
+ }
1681
+
1682
+ .orphan__status {
1683
+ font-size: var(--text-xs);
1684
+ color: var(--color-ink-3);
1685
+ }
1686
+
1658
1687
  .orphan__claim {
1659
1688
  font-size: var(--text-xs);
1660
- color: var(--color-warn);
1689
+ color: var(--color-warn-ink);
1661
1690
  white-space: nowrap;
1662
1691
  overflow: hidden;
1663
1692
  text-overflow: ellipsis;
@@ -1675,9 +1704,9 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1675
1704
  .orphan__kill {
1676
1705
  font-size: var(--text-xs);
1677
1706
  padding: 0.3rem 0.6rem;
1678
- background: oklch(55% 0.18 27 / 0.15);
1679
- border: var(--rule) solid oklch(55% 0.18 27 / 0.4);
1680
- color: oklch(70% 0.2 27);
1707
+ background: transparent;
1708
+ border: var(--rule) solid var(--color-bad-rule);
1709
+ color: var(--color-bad-ink);
1681
1710
  border-radius: var(--radius);
1682
1711
  cursor: pointer;
1683
1712
  transition: background 0.15s ease, border-color 0.15s ease;
@@ -1685,19 +1714,17 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1685
1714
  }
1686
1715
 
1687
1716
  .orphan__kill:hover {
1688
- background: oklch(55% 0.18 27 / 0.3);
1689
- border-color: oklch(55% 0.18 27 / 0.7);
1717
+ background: var(--color-bad-soft);
1718
+ border-color: var(--color-bad);
1690
1719
  }
1691
1720
 
1692
1721
  /* mobile ------------------------------------------------------------------ */
1693
1722
 
1694
1723
  @media (max-width: 34rem) {
1724
+ /* Nombre, puerto y estado en una sola linea: con el estado en una fila propia
1725
+ cada servicio ocupaba dos y 13 servicios eran ~800 px de scroll. */
1695
1726
  .service {
1696
- grid-template-columns: minmax(0, 1fr) auto;
1697
- }
1698
-
1699
- .service__state {
1700
- grid-column: 1 / -1;
1727
+ grid-template-columns: minmax(0, 1fr) auto auto;
1701
1728
  }
1702
1729
 
1703
1730
  .service__metrics {
@@ -1726,29 +1753,20 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1726
1753
  * El ambar lo separa del rojo de intrusos sin gritar como un error, porque
1727
1754
  * abrirlo fue una decision deliberada y no una falla. */
1728
1755
  .tunnels {
1729
- border-color: oklch(70% 0.15 75 / 0.55);
1756
+ border-color: var(--color-warn-rule);
1730
1757
  }
1731
1758
 
1732
1759
  /* Con la caja de intrusos ya neutra en reposo, el encabezado heredado quedaba
1733
1760
  * gris. Esta seccion solo existe cuando hay puertos abiertos a internet, asi
1734
1761
  * que siempre lleva su acento: no tiene estado de reposo. */
1735
1762
  .tunnels .orphans__heading {
1736
- color: oklch(58% 0.14 75);
1737
- background: oklch(70% 0.15 75 / 0.12);
1738
- border-bottom-color: oklch(70% 0.15 75 / 0.3);
1763
+ color: var(--color-warn-ink);
1764
+ background: var(--color-warn-soft);
1765
+ border-bottom-color: var(--color-warn-rule);
1739
1766
  }
1740
1767
 
1741
1768
  .tunnels .orphans__heading::before {
1742
- background: oklch(65% 0.16 75);
1743
- box-shadow: 0 0 0 2px oklch(65% 0.16 75 / 0.25);
1744
- }
1745
-
1746
- .tunnels .orphan__port {
1747
- /* El fondo tambien: `.orphan__port` trae texto Y fondo rojos, asi que cambiar
1748
- solo el color dejaba un puerto ambar sobre un chip rojo dentro de una
1749
- seccion ambar. Un tunel abierto y un intruso no significan lo mismo. */
1750
- color: oklch(52% 0.13 75);
1751
- background: oklch(70% 0.15 75 / 0.15);
1769
+ background: var(--color-warn);
1752
1770
  }
1753
1771
 
1754
1772
  /* `.orphan__name` viene con `white-space: nowrap` y elipsis, que para un nombre
@@ -1963,7 +1981,7 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
1963
1981
  font-size: var(--text-xs);
1964
1982
  padding: 0.2rem 0.5rem;
1965
1983
  background: var(--color-paper-2);
1966
- border: var(--rule) solid var(--color-rule-strong);
1984
+ border: var(--rule) solid var(--color-rule);
1967
1985
  border-radius: 9999px;
1968
1986
  color: var(--color-ink-2);
1969
1987
  }
@@ -2008,3 +2026,18 @@ html[lang="es"] .masthead__lang-opt[data-lang-opt="es"] {
2008
2026
  color: var(--color-bad-ink);
2009
2027
  }
2010
2028
 
2029
+
2030
+ /* Mono es para lo que se copia o se compara. Una instruccion o un titulo son
2031
+ palabras: el placeholder y el titulo del selector van en el rol Leer. */
2032
+ .enroll__input::placeholder,
2033
+ .auth__input::placeholder {
2034
+ font-family: var(--font-body);
2035
+ }
2036
+
2037
+ .picker__path[data-title="true"] {
2038
+ font-family: var(--font-display);
2039
+ font-size: var(--text-lg);
2040
+ font-weight: 400;
2041
+ letter-spacing: -0.018em;
2042
+ color: var(--color-ink);
2043
+ }
@@ -167,7 +167,9 @@ async function api(path, options = {}) {
167
167
  token = "";
168
168
  promptAuthModal();
169
169
  // El detalle del servidor viene en espanol fijo; aca se sabe que paso.
170
- throw new Error(tr("invalid token", "token inválido"));
170
+ const rejected = new Error(tr("invalid token", "token inválido"));
171
+ rejected.status = 401;
172
+ throw rejected;
171
173
  }
172
174
 
173
175
  if (!response.ok) {
@@ -178,7 +180,9 @@ async function api(path, options = {}) {
178
180
  } catch {
179
181
  /* respuesta sin cuerpo JSON */
180
182
  }
181
- throw new Error(detail);
183
+ const failed = new Error(detail);
184
+ failed.status = response.status;
185
+ throw failed;
182
186
  }
183
187
  return response.json();
184
188
  }
@@ -212,6 +216,16 @@ function flash(message, tone) {
212
216
  }, 4500);
213
217
  }
214
218
 
219
+ /* Matar un proceso ajeno nunca es un clic suelto: se confirma nombrando proceso
220
+ * y puerto. `after` refresca la lista que lo mostraba. */
221
+ function killPort(button, target, after) {
222
+ if (!window.confirm(killConfirmText(target, currentLang))) return;
223
+ act(button, async () => {
224
+ await api(`/api/ports/${target.port}/kill`, { method: "POST" });
225
+ if (after) await after();
226
+ });
227
+ }
228
+
215
229
  async function act(button, work) {
216
230
  if (button.dataset.busy === "true") return;
217
231
  button.setAttribute("aria-disabled", "true");
@@ -458,7 +472,7 @@ function renderService(service, projectId) {
458
472
  kill.className = "btn btn--kill";
459
473
  kill.textContent = tr("Free", "Liberar");
460
474
  kill.addEventListener("click", () =>
461
- act(kill, () => api(`/api/ports/${service.port}/kill`, { method: "POST" })),
475
+ killPort(kill, { name: who.name, pid: who.pid, port: service.port }),
462
476
  );
463
477
  node.querySelector(".service__act").append(kill);
464
478
 
@@ -471,7 +485,7 @@ function renderService(service, projectId) {
471
485
  if (service.external) {
472
486
  text.title = tr(
473
487
  "Started outside StackHelx: it is listening, but there is no process here to stop",
474
- "Arrancado fuera de StackHelx: escucha, pero no hay un proceso de aca para apagar",
488
+ "Arrancado fuera de StackHelx: escucha, pero no hay un proceso de aquí para apagar",
475
489
  );
476
490
  }
477
491
  stateCell.dataset.tone = tone;
@@ -518,6 +532,10 @@ function buildCard(project) {
518
532
  });
519
533
  }
520
534
 
535
+ root.querySelector('[data-act="ports"]').addEventListener("click", () => {
536
+ ui.portsModal.showModal();
537
+ refreshPortsModal();
538
+ });
521
539
  root.querySelector('[data-act="up"]').addEventListener("click", (event) => {
522
540
  const profile = root.querySelector(".profile__select").value || null;
523
541
  act(event.currentTarget, () =>
@@ -995,7 +1013,7 @@ function refreshKillAllLabel() {
995
1013
  if (ui.orphansKillAll.dataset.armed === "true") return;
996
1014
  const elegidos = orphanPicks.size;
997
1015
  ui.orphansKillAll.textContent = elegidos
998
- ? tr(`Close ${elegidos}`, `Cerrar ${elegidos}`)
1016
+ ? tr(`Stop ${elegidos}`, `Detener ${elegidos}`)
999
1017
  : tr("Free all", "Liberar todos");
1000
1018
  }
1001
1019
 
@@ -1020,8 +1038,8 @@ ui.orphansKillAll.addEventListener("click", (event) => {
1020
1038
  button.dataset.armed = "true";
1021
1039
  const detalle = killAllSnapshot.map((o) => `:${o.port} (${o.name})`).join(", ");
1022
1040
  button.textContent = tr(
1023
- `Close ${killAllSnapshot.length}: ${detalle}?`,
1024
- `Cerrar ${killAllSnapshot.length}: ${detalle}?`,
1041
+ `Stop ${killAllSnapshot.length}: ${detalle}?`,
1042
+ `Detener ${killAllSnapshot.length}: ${detalle}?`,
1025
1043
  );
1026
1044
 
1027
1045
  if (killAllTimer !== null) clearTimeout(killAllTimer);
@@ -1104,7 +1122,7 @@ function updateCard(entry, project) {
1104
1122
  dockerWarn.textContent = project.docker_down
1105
1123
  ? tr(
1106
1124
  "Docker Desktop is closed — open it to start containers",
1107
- "Docker Desktop está cerrado — abrilo para arrancar los contenedores",
1125
+ "Docker Desktop está cerrado — ábrelo para arrancar los contenedores",
1108
1126
  )
1109
1127
  : "";
1110
1128
  dockerWarn.hidden = !project.docker_down;
@@ -1217,9 +1235,17 @@ function updateCard(entry, project) {
1217
1235
  // levantado desde la terminal publica su puerto y se ve "listo".
1218
1236
  // Lo arrancado por fuera no cuenta: no hay proceso nuestro que apagar.
1219
1237
  const algoVivo = live || project.services.some((s) => s.state !== "stopped" && !s.external);
1220
- root.querySelector('[data-act="up"]').disabled =
1221
- live || stopping || project.state === "invalid";
1222
- root.querySelector('[data-act="down"]').disabled = !algoVivo || stopping;
1238
+ // La accion primaria sigue al estado: Start solo con el proyecto detenido,
1239
+ // Stop solo si hay algo nuestro que apagar. Lo arrancado por fuera se detiene
1240
+ // desde el mapa de puertos, que nombra el proceso y pide confirmacion.
1241
+ const outside = project.state === "external";
1242
+ const up = root.querySelector('[data-act="up"]');
1243
+ const down = root.querySelector('[data-act="down"]');
1244
+ up.hidden = live || stopping || outside;
1245
+ up.disabled = project.state === "invalid";
1246
+ down.hidden = outside || !(algoVivo || stopping);
1247
+ down.disabled = stopping;
1248
+ root.querySelector(".project__outside").hidden = !outside;
1223
1249
 
1224
1250
  if (entry.logsOpen) {
1225
1251
  if (live && !entry.eventSource) {
@@ -1791,7 +1817,7 @@ async function refreshOrphans() {
1791
1817
  limpio.className = "orphan orphan--empty";
1792
1818
  limpio.textContent = tr(
1793
1819
  "None. Anything holding your ports was started by you or is a Docker container.",
1794
- "Ninguno. Lo que ocupa tus puertos lo arrancaste vos o es un contenedor de Docker.",
1820
+ "Ninguno. Lo que ocupa tus puertos lo arrancaste tú o es un contenedor de Docker.",
1795
1821
  );
1796
1822
  ui.orphansList.replaceChildren(limpio);
1797
1823
  return;
@@ -1862,11 +1888,10 @@ async function refreshOrphans() {
1862
1888
 
1863
1889
  const kill = document.createElement("button");
1864
1890
  kill.className = "orphan__kill";
1865
- kill.textContent = tr("Close", "Cerrar");
1891
+ kill.textContent = tr("Stop process", "Detener proceso");
1866
1892
  kill.type = "button";
1867
1893
  kill.addEventListener("click", () => {
1868
- act(kill, async () => {
1869
- await api(`/api/ports/${orphan.port}/kill`, { method: "POST" });
1894
+ killPort(kill, orphan, async () => {
1870
1895
  delete ui.orphansList.dataset.ids;
1871
1896
  await refreshOrphans();
1872
1897
  });
@@ -1961,6 +1986,28 @@ const ORPHAN_EVERY = 4;
1961
1986
  let orphanTick = 0;
1962
1987
  let refreshAbortController = null;
1963
1988
 
1989
+ function renderLoadError(message) {
1990
+ // El sondeo repite el fallo cada 2.5 s: si el bloque ya esta, solo se cambia
1991
+ // el texto, o el boton Reintentar perderia el foco en cada vuelta.
1992
+ const existing = ui.projects.querySelector(".index__error");
1993
+ if (existing) {
1994
+ existing.querySelector("p").textContent = message;
1995
+ return;
1996
+ }
1997
+ const box = document.createElement("div");
1998
+ box.className = "index__error";
1999
+ box.setAttribute("role", "alert");
2000
+ const text = document.createElement("p");
2001
+ text.textContent = message;
2002
+ const retry = document.createElement("button");
2003
+ retry.type = "button";
2004
+ retry.className = "btn";
2005
+ retry.textContent = tr("Retry", "Reintentar");
2006
+ retry.addEventListener("click", () => act(retry, async () => {}));
2007
+ box.append(text, retry);
2008
+ ui.projects.replaceChildren(box);
2009
+ }
2010
+
1964
2011
  async function refresh() {
1965
2012
  if (refreshAbortController) {
1966
2013
  refreshAbortController.abort();
@@ -1981,8 +2028,15 @@ async function refresh() {
1981
2028
  ui.connection.dataset.down = "false";
1982
2029
  } catch (error) {
1983
2030
  if (error.name === "AbortError") return;
1984
- ui.connection.textContent = `${tr("offline", "sin conexión")} · ${error.message}`;
2031
+ const kind = classifyLoadError(error);
2032
+ const text = loadErrorText(kind, error.message, currentLang);
2033
+ ui.connection.textContent =
2034
+ kind === "offline" ? text.head : `${text.head} · ${error.message}`;
1985
2035
  ui.connection.dataset.down = "true";
2036
+ ui.projects.setAttribute("aria-busy", "false");
2037
+ // Con tarjetas ya pintadas se conservan (datos viejos, y el encabezado avisa).
2038
+ // Sin ellas el cuerpo se quedaba en "Cargando" para siempre.
2039
+ if (cards.size === 0) renderLoadError(text.body);
1986
2040
  }
1987
2041
  await refreshHealth();
1988
2042
  orphanTick++;
@@ -2014,6 +2068,7 @@ async function browseTo(path, isHistoryAction = false) {
2014
2068
  here = data;
2015
2069
  ui.pickerPath.textContent =
2016
2070
  data.path || tr("Choose where to start", "Elige dónde empezar");
2071
+ ui.pickerPath.dataset.title = data.path ? "false" : "true";
2017
2072
  ui.pickerNote.hidden = !data.truncated;
2018
2073
  if (data.truncated) {
2019
2074
  ui.pickerNote.textContent = tr(
@@ -2047,7 +2102,7 @@ function entryRow(entry) {
2047
2102
 
2048
2103
  const name = document.createElement("span");
2049
2104
  name.className = "picker__name";
2050
- name.textContent = entry.name;
2105
+ name.textContent = entry.home ? tr("Home", "Inicio") : entry.name;
2051
2106
  row.append(name);
2052
2107
 
2053
2108
  if (entry.markers.length) {
@@ -2512,13 +2567,10 @@ function renderSystemPorts() {
2512
2567
  if (item.can_kill) {
2513
2568
  const killBtn = document.createElement("button");
2514
2569
  killBtn.className = "orphan__kill";
2515
- killBtn.textContent = tr("Close", "Cerrar");
2570
+ killBtn.textContent = tr("Stop process", "Detener proceso");
2516
2571
  killBtn.type = "button";
2517
2572
  killBtn.addEventListener("click", () => {
2518
- act(killBtn, async () => {
2519
- await api(`/api/ports/${item.port}/kill`, { method: "POST" });
2520
- await refreshPortsModal();
2521
- });
2573
+ killPort(killBtn, item, refreshPortsModal);
2522
2574
  });
2523
2575
  li.append(portTag, info, killBtn);
2524
2576
  } else {
@@ -2555,6 +2607,7 @@ async function refreshPortsModal() {
2555
2607
  items.push({
2556
2608
  port: service.port,
2557
2609
  label: `${project.name} · ${service.name}`,
2610
+ project: project.name,
2558
2611
  kind,
2559
2612
  openable: service.openable,
2560
2613
  url: service.url,
@@ -2567,6 +2620,19 @@ async function refreshPortsModal() {
2567
2620
  }
2568
2621
  }
2569
2622
 
2623
+ // Rojo solo para un choque real: el mismo puerto declarado por dos proyectos.
2624
+ const conflicts = portConflicts(items);
2625
+ for (const item of items) {
2626
+ if (!conflicts.has(item.port)) continue;
2627
+ item.conflictWith = [
2628
+ ...new Set(
2629
+ items
2630
+ .filter((o) => o.port === item.port && o.project && o.project !== item.project)
2631
+ .map((o) => o.project),
2632
+ ),
2633
+ ];
2634
+ }
2635
+
2570
2636
  for (const orphan of orphansData.orphans || []) {
2571
2637
  items.push({
2572
2638
  port: orphan.port,
@@ -2579,6 +2645,8 @@ async function refreshPortsModal() {
2579
2645
  }`,
2580
2646
  ),
2581
2647
  kind: tr("stray", "intruso"),
2648
+ name: orphan.name,
2649
+ pid: orphan.pid,
2582
2650
  isOrphan: true,
2583
2651
  });
2584
2652
  }
@@ -2604,6 +2672,7 @@ async function refreshPortsModal() {
2604
2672
  const portTag = document.createElement("span");
2605
2673
  portTag.className = "orphan__port";
2606
2674
  portTag.textContent = `:${item.port}`;
2675
+ if (item.conflictWith) portTag.dataset.conflict = "true";
2607
2676
 
2608
2677
  const info = document.createElement("div");
2609
2678
  info.className = "orphan__info";
@@ -2613,10 +2682,19 @@ async function refreshPortsModal() {
2613
2682
  name.textContent = item.label;
2614
2683
 
2615
2684
  const meta = document.createElement("div");
2616
- meta.className = "orphan__meta";
2685
+ meta.className = "orphan__status";
2617
2686
  meta.textContent = `${tr("Status", "Estado")}: ${item.kind}`;
2618
2687
 
2619
2688
  info.append(name, meta);
2689
+ if (item.conflictWith) {
2690
+ const clash = document.createElement("div");
2691
+ clash.className = "orphan__claim";
2692
+ clash.textContent = tr(
2693
+ `Conflict: also declared by ${item.conflictWith.join(" and ")}`,
2694
+ `Conflicto: también lo declara ${item.conflictWith.join(" y ")}`,
2695
+ );
2696
+ info.append(clash);
2697
+ }
2620
2698
 
2621
2699
  if (item.openable) {
2622
2700
  const actLink = document.createElement("a");
@@ -2629,13 +2707,10 @@ async function refreshPortsModal() {
2629
2707
  } else if (item.isOrphan) {
2630
2708
  const killBtn = document.createElement("button");
2631
2709
  killBtn.className = "orphan__kill";
2632
- killBtn.textContent = tr("Close", "Cerrar");
2710
+ killBtn.textContent = tr("Stop process", "Detener proceso");
2633
2711
  killBtn.type = "button";
2634
2712
  killBtn.addEventListener("click", () => {
2635
- act(killBtn, async () => {
2636
- await api(`/api/ports/${item.port}/kill`, { method: "POST" });
2637
- await refreshPortsModal();
2638
- });
2713
+ killPort(killBtn, item, refreshPortsModal);
2639
2714
  });
2640
2715
  li.append(portTag, info, killBtn);
2641
2716
  } else {
@@ -368,6 +368,10 @@
368
368
  class="enroll__input auth__input"
369
369
  id="auth-token-input"
370
370
  type="password"
371
+ autocomplete="off"
372
+ data-en-aria="Access token"
373
+ data-es-aria="Token de acceso"
374
+ aria-label="Access token"
371
375
  data-en-placeholder="Paste token here..."
372
376
  data-es-placeholder="Pega el token aquí..."
373
377
  placeholder="Paste token here..."
@@ -406,6 +410,10 @@
406
410
  <a class="btn btn--open project__open" target="_blank" rel="noopener noreferrer" hidden data-en="Open ↗" data-es="Abrir ↗">
407
411
  Open ↗
408
412
  </a>
413
+ <span class="project__outside" hidden>
414
+ <span data-en="Started outside StackHelx" data-es="Iniciado fuera de StackHelx">Started outside StackHelx</span>
415
+ <button class="btn btn--quiet" type="button" data-act="ports" data-en="Stop it in the port map →" data-es="Deténlo en el mapa de puertos →">Stop it in the port map →</button>
416
+ </span>
409
417
  <button class="btn btn--primary" type="button" data-act="up" data-en="Start" data-es="Arrancar">Start</button>
410
418
  <button class="btn" type="button" data-act="down" data-en="Stop" data-es="Apagar">Stop</button>
411
419
  <button
@@ -574,6 +582,7 @@
574
582
  </li>
575
583
  </template>
576
584
 
585
+ <script src="/static/logic.js"></script>
577
586
  <script src="/static/app.js"></script>
578
587
  </body>
579
588
  </html>
@@ -0,0 +1,70 @@
1
+ /* Logica pura de la interfaz: sin DOM, sin red, sin estado. Vive aparte de
2
+ * app.js para poder probarla con `node` (tests/test_web_logic.py). */
3
+
4
+ /* Que paso al cargar el estado. `error.status` lo pone `api()` cuando hubo
5
+ * respuesta HTTP; sin status y con TypeError es que `fetch` no llego al servidor. */
6
+ function classifyLoadError(error) {
7
+ const status = error && error.status;
8
+ if (status === 401) return "auth";
9
+ if (status >= 500) return "server";
10
+ if (status) return "request";
11
+ if (error instanceof TypeError) return "offline";
12
+ return "unexpected";
13
+ }
14
+
15
+ function loadErrorText(kind, detail, lang) {
16
+ const es = lang === "es";
17
+ switch (kind) {
18
+ case "offline":
19
+ return {
20
+ head: es ? "sin conexión" : "offline",
21
+ body: es
22
+ ? "Sin conexión con StackHelx. ¿Sigue corriendo `stackhelx serve`?"
23
+ : "No connection to StackHelx. Is `stackhelx serve` still running?",
24
+ };
25
+ case "server":
26
+ return {
27
+ head: es ? "error del servidor" : "server error",
28
+ body: es
29
+ ? `El servidor respondió con un error: ${detail}`
30
+ : `The server answered with an error: ${detail}`,
31
+ };
32
+ case "auth":
33
+ return {
34
+ head: es ? "token inválido" : "invalid token",
35
+ body: es
36
+ ? "El token de acceso no es válido. Pégalo de nuevo."
37
+ : "The access token is not valid. Paste it again.",
38
+ };
39
+ default:
40
+ return {
41
+ head: es ? "error" : "error",
42
+ body: es ? `No se pudo cargar: ${detail}` : `Could not load: ${detail}`,
43
+ };
44
+ }
45
+ }
46
+
47
+ /* Puertos declarados por mas de un proyecto distinto. `items` son filas del
48
+ * mapa: { port, project }. Dos servicios del mismo proyecto no son conflicto. */
49
+ function portConflicts(items) {
50
+ const owners = new Map();
51
+ for (const { port, project } of items) {
52
+ if (!port || !project) continue;
53
+ if (!owners.has(port)) owners.set(port, new Set());
54
+ owners.get(port).add(project);
55
+ }
56
+ return new Set([...owners].filter(([, set]) => set.size > 1).map(([port]) => port));
57
+ }
58
+
59
+ /* Texto de la confirmacion antes de matar un proceso: nombra proceso y puerto. */
60
+ function killConfirmText({ name, pid, port }, lang) {
61
+ const who = name || (lang === "es" ? "proceso desconocido" : "unknown process");
62
+ const withPid = pid ? `${who} (pid ${pid})` : who;
63
+ return lang === "es"
64
+ ? `¿Detener ${withPid} en el puerto ${port}?`
65
+ : `Stop ${withPid} on port ${port}?`;
66
+ }
67
+
68
+ if (typeof module !== "undefined") {
69
+ module.exports = { classifyLoadError, loadErrorText, portConflicts, killConfirmText };
70
+ }
@@ -18,10 +18,14 @@
18
18
  estetica: por debajo de 54% de luminosidad el texto chico deja de leerse. */
19
19
  --color-ink-3: oklch(54% 0.010 60);
20
20
  --color-rule: oklch(89% 0.009 82);
21
- --color-rule-strong: oklch(82% 0.011 82);
21
+ /* rule-strong es el borde de los CONTROLES (botones, campos, chips): 3:1 sobre
22
+ el papel, que es lo que WCAG 1.4.11 pide para ubicarlos. Medido: 3.77 sobre
23
+ paper-2 y 3.23 sobre paper-3. Los filetes decorativos usan --color-rule. */
24
+ --color-rule-strong: oklch(60% 0.011 82);
22
25
 
23
26
  /* un solo acento, arcilla, usado en menos del 5% de la pantalla */
24
27
  --color-accent: oklch(52% 0.13 42);
28
+ --color-focus: var(--color-accent);
25
29
  --color-accent-soft: oklch(92% 0.035 42);
26
30
 
27
31
  /* estados. Verde apagado y no neon: esto es un panel, no un semaforo.
@@ -38,6 +42,11 @@
38
42
  --color-warn-ink: oklch(50% 0.115 75);
39
43
  --color-bad-ink: oklch(48% 0.155 28);
40
44
  --color-bad-rule: oklch(78% 0.07 28);
45
+ --color-warn-soft: oklch(94% 0.04 75);
46
+ --color-warn-rule: oklch(78% 0.09 75);
47
+ /* Valores medidos, no estados: puertos, pid, cifras. Latón, nunca rojo. */
48
+ --color-cifra: oklch(50% 0.10 75);
49
+ --color-scrim: oklch(20% 0.01 70 / 0.45);
41
50
 
42
51
  /* tipografia: tres roles, cero descargas. Ver la nota en app.css. */
43
52
  --font-display: ui-serif, Georgia, "Times New Roman", serif;
@@ -86,7 +95,7 @@
86
95
  --color-ink-2: oklch(74% 0.009 85);
87
96
  --color-ink-3: oklch(63% 0.009 85);
88
97
  --color-rule: oklch(31% 0.009 70);
89
- --color-rule-strong: oklch(39% 0.010 70);
98
+ --color-rule-strong: oklch(56% 0.010 70);
90
99
 
91
100
  --color-accent: oklch(72% 0.12 45);
92
101
  --color-accent-soft: oklch(34% 0.05 45);
@@ -99,5 +108,8 @@
99
108
  --color-warn-ink: var(--color-warn);
100
109
  --color-bad-ink: var(--color-bad);
101
110
  --color-bad-rule: oklch(44% 0.09 28);
111
+ --color-warn-soft: oklch(30% 0.05 78);
112
+ --color-warn-rule: oklch(46% 0.08 78);
113
+ --color-cifra: oklch(80% 0.11 78);
102
114
  }
103
115
  }
@@ -694,7 +694,8 @@ def test_browse_sin_ruta_con_oserror_en_particiones_no_falla(client, monkeypatch
694
694
  cuerpo = client.get("/api/browse").json()
695
695
  assert cuerpo["path"] == ""
696
696
  assert len(cuerpo["entries"]) >= 1
697
- assert cuerpo["entries"][0]["name"] == "Inicio"
697
+ # El nombre es neutro; la interfaz lo traduce al idioma elegido.
698
+ assert cuerpo["entries"][0]["home"] is True
698
699
 
699
700
 
700
701
  def test_browse_lista_solo_carpetas(client, tmp_path):
@@ -0,0 +1,57 @@
1
+ """Logica pura de la interfaz (`web/logic.js`), ejecutada con node de verdad.
2
+
3
+ No hay navegador en la suite: el JS con decisiones (que error es cada fallo,
4
+ que puertos chocan, que dice la confirmacion de matar) vive en `logic.js` sin
5
+ DOM justamente para poder afirmarlo aca. Sin node se salta, no se finge.
6
+ """
7
+
8
+ import json
9
+ import shutil
10
+ import subprocess
11
+ from pathlib import Path
12
+
13
+ import pytest
14
+
15
+ LOGIC = Path(__file__).resolve().parent.parent / "stackhelx" / "web" / "logic.js"
16
+
17
+ pytestmark = pytest.mark.skipif(shutil.which("node") is None, reason="node no esta instalado")
18
+
19
+
20
+ def node_eval(expr: str):
21
+ script = f"const L = require({json.dumps(str(LOGIC))}); console.log(JSON.stringify({expr}));"
22
+ out = subprocess.run(["node", "-e", script], capture_output=True, text=True, encoding="utf-8", check=True)
23
+ return json.loads(out.stdout)
24
+
25
+
26
+ def test_un_500_no_se_presenta_como_sin_conexion():
27
+ """El bug: `offline · boom` para una respuesta 500 y el cuerpo en "Cargando"."""
28
+ kinds = node_eval(
29
+ "[{status:500}, {status:503}, {status:401}, {status:404}, new TypeError('x'), new SyntaxError('y')]"
30
+ ".map(L.classifyLoadError)"
31
+ )
32
+ assert kinds == ["server", "server", "auth", "request", "offline", "unexpected"]
33
+
34
+ server = node_eval("L.loadErrorText('server', 'boom', 'en')")
35
+ offline = node_eval("L.loadErrorText('offline', '', 'en')")
36
+ assert "boom" in server["body"]
37
+ assert "offline" not in server["head"]
38
+ assert offline["head"] == "offline"
39
+ assert node_eval("L.loadErrorText('offline', '', 'es')")["head"] == "sin conexión"
40
+
41
+
42
+ def test_choque_de_puertos_solo_entre_proyectos_distintos():
43
+ """El 3000 de Decepticon y de WineSpa chocan; dos servicios del mismo proyecto no."""
44
+ chocan = node_eval(
45
+ "[...L.portConflicts(["
46
+ "{port:3000, project:'Decepticon'}, {port:3000, project:'WineSpa'},"
47
+ "{port:4000, project:'Decepticon'}, {port:4000, project:'Decepticon'},"
48
+ "{port:5173, project:'a'}, {port:9, project:null}])]"
49
+ )
50
+ assert chocan == [3000]
51
+
52
+
53
+ def test_la_confirmacion_de_matar_nombra_proceso_y_puerto():
54
+ en = node_eval("L.killConfirmText({name:'Orca.exe', pid:20352, port:6768}, 'en')")
55
+ es = node_eval("L.killConfirmText({name:'node.exe', pid:null, port:4391}, 'es')")
56
+ assert "Orca.exe" in en and "20352" in en and "6768" in en
57
+ assert "node.exe" in es and "4391" in es and "pid" not in es
@@ -1,2 +0,0 @@
1
- __version__ = "1.1.4"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes