Skip to content

Rediseño, i18n y mejoras de partida - #4

Merged
freddysae0 merged 2 commits into
masterfrom
feat/rediseno-i18n
Oct 22, 2026
Merged

freddysae0 merged 2 commits into
masterfrom
feat/rediseno-i18n

Conversation

@freddysae0

Copy link
Copy Markdown
Owner

Qué incluye

  • Interfaz de partida nueva: asientos, dock de decisiones y registro.
  • Landing y reglas rediseñadas, con traducción es/en.
  • Iconos de acciones dibujados a partir de los de las cartas, con tooltip (efecto, personaje y quién la bloquea), y un panel de reglas dentro de la partida.
  • Reconexión: el navegador recuerda tu asiento en cada sala. Cerrar la pestaña y volver a abrir el enlace te devuelve a la partida. Antes respondía "Esta partida ya ha empezado".
  • Carrusel de la landing: sin barra, arrastrable con el ratón y con margen correcto en móvil.
  • Footer: iconos de GitHub y LinkedIn.

Pruebas

  • tsc, lint y vitest, limpios.
  • Probado en el navegador con Playwright: partida de 2 jugadores, tooltip, panel de reglas, vista móvil, arrastre del carrusel, y cerrar y reabrir la pestaña en mitad de la partida.
  • next build de producción en Docker: todas las rutas responden.

🤖 Generated with Claude Code

- Nueva interfaz de partida (asientos, dock de decisiones, registro) y
  landing/reglas rediseñadas con traducción es/en.
- Iconos propios para las acciones, basados en los de las cartas, con
  tooltip (efecto, personaje y quién la bloquea) y panel de reglas
  dentro de la partida.
- Reconexión: el navegador recuerda el asiento por sala, así que cerrar la
  pestaña y volver a abrir el enlace devuelve a la partida.
- Carrusel de cartas de la landing sin barra de scroll, arrastrable con el
  ratón y con margen correcto en móvil.
- Footer con iconos de GitHub y LinkedIn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T20:08:42.880682Z a25c54f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a25c54f3e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shared/useCoupSocket.ts Outdated
Comment on lines +49 to +50
const tabKey = `${PLAYER_ID_KEY}:${room}`;
let id = sessionStorage.getItem(tabKey);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Migrate the existing session identity before generating a new one

When a player refreshes an ongoing game after this deployment, their existing identity is still stored under coup-player-id, but this function only reads coup-player-id:<room>. With no remembered seats yet, it generates a different ID and sends that in the join message, losing the player's existing seat and preventing reconnection to the started game. Preserve the legacy session ID when initializing the room-specific identity so upgrading does not strand active players.

Useful? React with 👍 / 👎.

Comment thread shared/useCoupSocket.ts Outdated
Comment on lines +35 to +39
/** Another open tab of this browser is sitting in that seat right now. */
function isSeatHeld(id: string) {
const beat = Number(localStorage.getItem(LOCK_PREFIX + id));

return Date.now() - beat < LOCK_STALE_MS;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid reclaiming seats solely because their heartbeat expired

If an open game tab is backgrounded and its timers are throttled or suspended for more than 12 seconds, its seat becomes eligible for reuse even though that tab has not left. Opening the same room in another tab then selects the original player's ID and joins as that player instead of creating a separate seat. The original tab also retains that ID in session storage, so resuming it does not resolve the collision. Seat reclamation needs an ownership check that distinguishes a closed tab from a temporarily suspended one rather than relying solely on this short heartbeat timeout.

Useful? React with 👍 / 👎.

Comment thread app/game/[...slug]/page.tsx Outdated
Comment on lines +28 to +29
if (err.code && FATAL.has(err.code)) setFatal(text);
else addToast({ title: text, color: "danger", timeout: 3500 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain fatal-error handling for responses without a code

When the server rejects a join with a message-only error such as Game already started, this now displays a temporary toast and leaves the page showing Joining room… indefinitely instead of the rejection page. Both ServerMessage and SocketError still explicitly allow code to be absent, and the previous handler recognized these fatal messages without a code. Keep that fallback until coded errors are required by the protocol so compatible server responses still provide a usable failure state.

Useful? React with 👍 / 👎.

- La reserva de asiento usa la Web Locks API en lugar de un latido en
  localStorage: una pestaña en segundo plano con los temporizadores
  ralentizados o congelados conserva su asiento, y solo al cerrarse lo
  libera. Una pestaña duplicada recibe su propio asiento.
- Se reutiliza el id por pestaña de versiones anteriores (coup-player-id),
  así quien recargue tras actualizar no pierde su sitio.
- Los rechazos sin código de error (servidores antiguos) vuelven a mostrar
  la pantalla de error en lugar de quedarse en "Entrando en la sala…".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@freddysae0
freddysae0 merged commit 26079db into master Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant