Skip to content

Feature/UI ux enhancements - #20

Merged
uxabix merged 29 commits into
developfrom
feature/ui-ux-enhancements
Nov 15, 2026
Merged

uxabix merged 29 commits into
developfrom
feature/ui-ux-enhancements

Conversation

@uxabix

@uxabix uxabix commented Nov 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

uxabix added 25 commits May 19, 2026 14:13
…ools.

Login and registration show labels, password rules, and one generic credential error. The match foreign key is fools again so admin ordering matches the app, while the database column stays game_id.
New accounts stay inactive until the confirmation link is opened, and that switch cannot be turned off when DEBUG is false. Password reset does not reveal whether an address exists, new usernames are short and case-insensitive, and registration, resend, and reset share a five-per-hour cap per IP and per address.
The nickname is shown once, with a link to the current match, the lobby, or the lobby list. Finished games, wins, losses, and win rate are on the page, and a player with no games is not shown a zero win rate. Changing an email still requires the current password. Changing a password emails the same reset link as the sign-in form.
Each public lobby shows its size, deck, and whether it is full, and the list updates as soon as one changes. Creating a lobby starts closed, asks for a password only when the room is private, and asks before leaving a lobby the player is already in. Joining another lobby asks the same way.
Bots sit in when the owner starts, cannot sign in, and choose moves through a replaceable strategy. The built-in one attacks, defends, throws in, takes, or passes the attack when transfer is allowed, always with the cheapest card the rule permits.
… and keep the hand in place when the table updates.
…the right player, and keep the seats, history, and a new deal with whoever is still at the table.
…s they are dealt, light only a legal drop, and refuse a take after the table is already beaten.
…deck cannot deal six cards to every seat, and free bot chairs when the match ends.
…hen two players pass the attack, let a bot throw on a beaten rank, and keep the phone menu and table usable.
…hen every person is ready, and pass the room to whoever sat down first.
Allow hosts to update gameplay rules while a lobby is waiting, with seat and deck validation and readiness reset on changes. Record updates as system chat notices and expose the settings editor in the lobby UI.
Keep dragged cards selected during drag operations and show visual error feedback when a play or defense is invalid. Handle drops consistently so invalid actions can display a clear message.
Keep extra attack rows within the felt without vertical scrolling, and adjust pile and card sizing and positioning for medium-width screens.
… table on a phone.

Surrender ends the match and returns the lobby to waiting without removing that player. Direct, lobby, and table chat share one paged history with a read mark, username search, and a public player page. On the table, the log and chat sit on the felt, and the phone controls, opponents, and hand sit closer together.
…ward the center, and keep side seats level with the felt.

On a phone, tighten the lobby list and the space under that summary, and drop the empty-deck label.
Make chat screens fit the viewport, improve mobile layouts and controls, and add client-side inbox filtering that preserves the query across navigation. Update template tests and include scripts and captured footage for a product demo.
@uxabix
uxabix requested a review from Viton8 November 8, 2026 10:58
@uxabix uxabix self-assigned this Nov 8, 2026
@uxabix uxabix added the enhancement New feature or request label Nov 8, 2026

@Viton8 Viton8 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅

Comment thread .gitignore Outdated
# Static and media
staticfiles/
static/
/static/ # only root-level static/, if you ever add one

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
/static/ # only root-level static/, if you ever add one
/static/ # only root-level static/

Comment on lines +1 to +5
/**
* Login and registration forms: field checks, password rules, show/hide, submit state.
* Server-side validation remains the source of truth. This script only
* explains failures earlier and does not block paste or password managers.
*/

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
/**
* Login and registration forms: field checks, password rules, show/hide, submit state.
* Server-side validation remains the source of truth. This script only
* explains failures earlier and does not block paste or password managers.
*/
/**
* Login and registration forms: field checks, password rules, submit state.
* This script only adds local checks in addition to server validation.
*/

Comment on lines +215 to +240
setRule("length", value.length >= minLength ? "met" : (showFailures ? "unmet" : "idle"));
setRule("numeric", /^[0-9]+$/.test(value) ? (showFailures ? "unmet" : "idle") : "met");
if (tooSimilar(value)) setRule("similar", showFailures ? "unmet" : "idle");
else if (identityParts().length) setRule("similar", "met");
else setRule("similar", "idle");
}
var sameAsServer = password && password.value === initial[passwordKey] && serverMessages[passwordKey];
if (sameAsServer) applyServerRules();
else setRule("common", "pending");
}

function applyServerRules() {
var messages = []
.concat(serverMessages[passwordKey] || [])
.concat(serverMessages[confirmKey] || []);
var text = messages.join(" ").toLowerCase();
if (!text) return;
if (text.indexOf("too short") !== -1 || text.indexOf("at least") !== -1) setRule("length", "unmet");
if (text.indexOf("entirely numeric") !== -1 || text.indexOf("only numbers") !== -1) setRule("numeric", "unmet");
if (text.indexOf("too similar") !== -1 || text.indexOf("less similar") !== -1) setRule("similar", "unmet");
if (text.indexOf("too common") !== -1 || text.indexOf("common password") !== -1) setRule("common", "unmet");
}

function passwordMessage(value, showFailures) {
if (!value) return "Enter a password.";
if (value.length > maxLength) return "Use " + maxLength + " characters or fewer.";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

value.length counts UTF-16 code units, while the server-side len(password) in Python counts Unicode code points. As a result, a valid password—for example, one containing 65 emoji—will be incorrectly rejected in the browser as exceeding the 128-character limit. The minimum-length indicator can also be inaccurate. Use a code-point count, such as Array.from(value).length, for both length checks.

Comment thread fools/services.py Outdated
Comment on lines +1 to +15
"""Business logic for multiplayer Durak (podkidnoy).

This module owns lobby lifecycle, dealing from the shared card pool, table
phases (build / defend / between), and persistence updates on existing Django
models. It also triggers WebSocket broadcasts via :mod:`fools.realtime`.

Typical flow:
#. Players create or join a lobby, toggle ready, owner calls ``start_game``.
#. Attacker opens from ``between`` into ``build``. While the wave is on the table,
the defender may ``defend`` or ``take_table`` at any time; the attacker and
other players may still ``play_attack`` (throw-ins) in parallel—no separate
``defend`` phase gate. ``take_table`` only declares the take: the cards move
after every player who can still throw in confirms with ``pass_throw``.
#. After the table is fully beaten, attacker ``bito`` discards and rotates roles.
"""

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
"""Business logic for multiplayer Durak (podkidnoy).
This module owns lobby lifecycle, dealing from the shared card pool, table
phases (build / defend / between), and persistence updates on existing Django
models. It also triggers WebSocket broadcasts via :mod:`fools.realtime`.
Typical flow:
#. Players create or join a lobby, toggle ready, owner calls ``start_game``.
#. Attacker opens from ``between`` into ``build``. While the wave is on the table,
the defender may ``defend`` or ``take_table`` at any time; the attacker and
other players may still ``play_attack`` (throw-ins) in parallel—no separate
``defend`` phase gate. ``take_table`` only declares the take: the cards move
after every player who can still throw in confirms with ``pass_throw``.
#. After the table is fully beaten, attacker ``bito`` discards and rotates roles.
"""
"""Business logic for Fool's Arena.
This module owns lobby lifecycle, dealing from the shared card pool, table
phases (build, defend, between), and persistence updates on existing Django
models. It also triggers WebSocket broadcasts via fools.realtime.
Typical flow:
#. Players create or join a lobby, toggle ready, owner calls ``start_game``.
#. Attacker opens from ``between`` into ``build``. While the wave is on the table,
the defender may ``defend`` or ``take_table`` at any time; the attacker and
other players may still ``play_attack`` (throw-ins) in parallel—no separate
``defend`` phase gate. ``take_table`` only declares the take: the cards move
after every player who can still throw in confirms with ``pass_throw``.
#. After the table is fully beaten, attacker ``bito`` discards and rotates roles.
"""

Comment thread fools/services.py Outdated
Comment on lines +46 to +54
from chat.services import (
broadcast_chat_message,
get_lobby_chat,
message_payload,
record_lobby_notice,
remove_user_from_lobby_chat,
)
from fools.card_catalog import ensure_playing_cards_for_deck_size
from fools.realtime import broadcast_game, broadcast_lobby, broadcast_lobby_list

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
from chat.services import (
broadcast_chat_message,
get_lobby_chat,
message_payload,
record_lobby_notice,
remove_user_from_lobby_chat,
)
from fools.card_catalog import ensure_playing_cards_for_deck_size
from fools.realtime import broadcast_game, broadcast_lobby, broadcast_lobby_list
from fools.card_catalog import ensure_playing_cards_for_deck_size
from fools.realtime import broadcast_game, broadcast_lobby, broadcast_lobby_list
from chat.services import (
broadcast_chat_message,
get_lobby_chat,
message_payload,
record_lobby_notice,
remove_user_from_lobby_chat,
)

Comment thread fools/admin.py Outdated

def compatibility_display(self, obj):
"""Display game compatibility information.
"""Display fools compatibility information.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
"""Display fools compatibility information.
"""Display game compatibility information.

Comment thread fools/admin.py Outdated
"""Admin interface for the GameDeck model.

Basic management interface for game deck cards with position tracking.
Basic management interface for fools deck cards with position tracking.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
Basic management interface for fools deck cards with position tracking.
Basic management interface for game deck cards with position tracking.

Comment thread fools/admin.py Outdated
"""Admin interface for the Turn model.

Management interface for game turns with move tracking.
Management interface for fools turns with move tracking.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
Management interface for fools turns with move tracking.
Management interface for game turns with move tracking.

Comment thread fools/static/fools/js/chat_thread.js Outdated
@@ -0,0 +1,368 @@
/**
* Shared chat history: grouping, stick-to-bottom, older pages, and read marks.
* Direct chats, the lobby, and the table all use this so those parts match.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
* Direct chats, the lobby, and the table all use this so those parts match.
* Direct messages, the lobby chat, and the game chat all use this so those parts match.

Comment thread fools/static/fools/js/chat_thread.js Outdated
Comment on lines +112 to +120
var grouped = previous
&& kind !== "system"
&& previous.kind !== "system"
&& sender
&& sender === previous.sender
&& !isNaN(sent.getTime())
&& !isNaN(previous.sent.getTime())
&& sent.getTime() - previous.sent.getTime() < GROUP_MS
&& sent.getTime() >= previous.sent.getTime();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Suggested change
var grouped = previous
&& kind !== "system"
&& previous.kind !== "system"
&& sender
&& sender === previous.sender
&& !isNaN(sent.getTime())
&& !isNaN(previous.sent.getTime())
&& sent.getTime() - previous.sent.getTime() < GROUP_MS
&& sent.getTime() >= previous.sent.getTime();
var hasPrevious = !!previous;
var notSystem = hasPrevious
&& kind !== "system" && previous.kind !== "system";
var sameUser = hasPrevious
&& sender && sender === previous.sender;
var sameTimeGroup = hasPrevious
&& !isNaN(sent.getTime())
&& !isNaN(previous.sent.getTime())
&& sent.getTime() - previous.sent.getTime() < GROUP_MS
&& sent.getTime() >= previous.sent.getTime();
var grouped = notSystem
&& sameUser && sameTimeGroup;

@uxabix uxabix left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Ok

Give messages distinct sent_at values so ordering tests do not depend on identical timestamps.
The workflow was forcing production settings, so pytest ignored the in-memory cache and channel layer and tried to resolve the Docker host redis.
@uxabix
uxabix merged commit 0a9a0f8 into develop Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants