Spaces:
Sleeping
Sleeping
Update to v0.2.44: UI, spinner, docs, and instructions
Browse files- Bump version to 0.2.44 BASIC in code and docs; update "Last Updated" dates
- Add "SKILLS" section to copilot-instructions.md for tool/skill listing before actions
- Refine DOM manipulation guidance and spinner removal logic (no window.parent fallback)
- Pass new parameter to CustomSpinner for initial load
- Update README changelog and reorganize previous entries for clarity
- .github/copilot-instructions.md +7 -0
- README.md +14 -10
- battlewords/__init__.py +1 -1
- battlewords/ui.py +1 -1
- battlewords/ui_helpers.py +2 -12
- claude.md +2 -2
- pyproject.toml +1 -1
- specs/basic.mdx +2 -2
- specs/requirements.mdx +2 -2
- specs/specs.mdx +2 -2
.github/copilot-instructions.md
CHANGED
|
@@ -19,6 +19,13 @@
|
|
| 19 |
## Animation Effects
|
| 20 |
- For text animation effects, use a custom text animation solution instead of `streamlit-extras let_it_rain`, focusing on falling direction only; no need to implement bottom-to-top animation.
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
## Project-Specific Rules
|
| 23 |
- Remove AI generation of wordlists and audio system from the basic codebase
|
| 24 |
- Keep challenge mode/HF storage and PWA support in the basic codebase
|
|
|
|
| 19 |
## Animation Effects
|
| 20 |
- For text animation effects, use a custom text animation solution instead of `streamlit-extras let_it_rain`, focusing on falling direction only; no need to implement bottom-to-top animation.
|
| 21 |
|
| 22 |
+
## DOM Manipulation
|
| 23 |
+
- Prefer minimal DOM fixes that target the existing root element/class relationship directly, e.g., selecting `#root` when it carries the `bw-spinner-active` class instead of redesigning the logic.
|
| 24 |
+
- Avoid using `window.parent` in iframe-related cleanup; use `document` and the current iframe DOM context directly, especially in `remove_spinner()`.
|
| 25 |
+
|
| 26 |
+
## SKILLS
|
| 27 |
+
"Before acting, list all available skills/tools. Check if any directly solves the task. If none fit, explicitly state the missing skill and how to acquire/create it (e.g. via code, new tool, or external resource). Only then execute or request the needed action."
|
| 28 |
+
|
| 29 |
## Project-Specific Rules
|
| 30 |
- Remove AI generation of wordlists and audio system from the basic codebase
|
| 31 |
- Keep challenge mode/HF storage and PWA support in the basic codebase
|
README.md
CHANGED
|
@@ -19,21 +19,20 @@ tags:
|
|
| 19 |
|
| 20 |
> **This project is used by [huggingface.co](https://huggingface.co/spaces/Surn/Battlewords) as a demonstration of interactive word games in Python.**
|
| 21 |
|
| 22 |
-
**Current Version:** 0.2.
|
| 23 |
**Branch:** `basic`
|
| 24 |
-
**Last Updated:** 2026-
|
| 25 |
|
| 26 |
Battlewords is a vocabulary learning game inspired by classic Battleship mechanics. The objective is to discover hidden words on a grid, earning points for strategic guessing before all letters are revealed.
|
| 27 |
|
| 28 |
## Recent Changes
|
|
|
|
|
|
|
|
|
|
| 29 |
version 0.2.43 (basic)
|
| 30 |
- Update streamlit to 1.56.0 for improved security
|
| 31 |
- Fix bug where Hall of Fantastics entries were not saving correctly due to missing `entry_type` in JSON schema
|
| 32 |
|
| 33 |
-
version 0.2.42 (basic)
|
| 34 |
-
- Add Hall of Fantastics (weekly Fantastic runs saved and viewable at ?page=fantastic)
|
| 35 |
-
- Fantastic runs (scores 42–45) can be saved to a weekly HF-backed leaderboard using Wrdler-style folders under `games/leaderboards/weekly/<ISO-week>/<wordlist>-<mode>-0-fantastic/settings.json`
|
| 36 |
-
- Game-over dialog now prompts Fantastic/Legendary qualifiers to save; Hall of Legends ranking numbers no longer show emoji medals (emojis retained for Hall of Fantastics)
|
| 37 |
|
| 38 |
File naming convention for Hall of Fantastics
|
| 39 |
|
|
@@ -54,10 +53,10 @@ version 0.2.41 (basic)
|
|
| 54 |
- Persist Hall entries using HF-backed Wrdler-compatible JSON schema
|
| 55 |
- Minor UI: move leaderboard/hall routing to query-param `?page=hall` and integrate Hall save into Game Over dialog
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
|
| 62 |
- version 0.2.39 (basic)
|
| 63 |
- UI refinements for smooth game over and overlay transitions
|
|
@@ -223,6 +222,11 @@ docker run -p8501:8501 battlewords
|
|
| 223 |
|
| 224 |
## Changelog
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
- version 0.2.37 (basic)
|
| 227 |
- Removed Challenge Mode / Share Links / Remote Storage (HF)
|
| 228 |
- Removed PWA support
|
|
|
|
| 19 |
|
| 20 |
> **This project is used by [huggingface.co](https://huggingface.co/spaces/Surn/Battlewords) as a demonstration of interactive word games in Python.**
|
| 21 |
|
| 22 |
+
**Current Version:** 0.2.44 BASIC
|
| 23 |
**Branch:** `basic`
|
| 24 |
+
**Last Updated:** 2026-05-21
|
| 25 |
|
| 26 |
Battlewords is a vocabulary learning game inspired by classic Battleship mechanics. The objective is to discover hidden words on a grid, earning points for strategic guessing before all letters are revealed.
|
| 27 |
|
| 28 |
## Recent Changes
|
| 29 |
+
version 0.2.44 (basic)
|
| 30 |
+
- UI Imporovements and refinements
|
| 31 |
+
|
| 32 |
version 0.2.43 (basic)
|
| 33 |
- Update streamlit to 1.56.0 for improved security
|
| 34 |
- Fix bug where Hall of Fantastics entries were not saving correctly due to missing `entry_type` in JSON schema
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
File naming convention for Hall of Fantastics
|
| 38 |
|
|
|
|
| 53 |
- Persist Hall entries using HF-backed Wrdler-compatible JSON schema
|
| 54 |
- Minor UI: move leaderboard/hall routing to query-param `?page=hall` and integrate Hall save into Game Over dialog
|
| 55 |
|
| 56 |
+
version 0.2.40 (basic)
|
| 57 |
+
- Fix missing submit button error
|
| 58 |
+
- UI refinements for smoother radar/grid rendering and transitions
|
| 59 |
+
- Fix Game Over Close button behavior
|
| 60 |
|
| 61 |
- version 0.2.39 (basic)
|
| 62 |
- UI refinements for smooth game over and overlay transitions
|
|
|
|
| 222 |
|
| 223 |
## Changelog
|
| 224 |
|
| 225 |
+
- version 0.2.42 (basic)
|
| 226 |
+
- Add Hall of Fantastics (weekly Fantastic runs saved and viewable at ?page=fantastic)
|
| 227 |
+
- Fantastic runs (scores 42–45) can be saved to a weekly HF-backed leaderboard using Wrdler-style folders under `games/leaderboards/weekly/<ISO-week>/<wordlist>-<mode>-0-fantastic/settings.json`
|
| 228 |
+
- Game-over dialog now prompts Fantastic/Legendary qualifiers to save; Hall of Legends ranking numbers no longer show emoji medals (emojis retained for Hall of Fantastics)
|
| 229 |
+
|
| 230 |
- version 0.2.37 (basic)
|
| 231 |
- Removed Challenge Mode / Share Links / Remote Storage (HF)
|
| 232 |
- Removed PWA support
|
battlewords/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
__version__ = "0.2.
|
| 2 |
__all__ = ["models", "generator", "logic", "ui", "modules"]
|
|
|
|
| 1 |
+
__version__ = "0.2.44 BASIC"
|
| 2 |
__all__ = ["models", "generator", "logic", "ui", "modules"]
|
battlewords/ui.py
CHANGED
|
@@ -1623,7 +1623,7 @@ def run_app():
|
|
| 1623 |
# Show spinner on initial load
|
| 1624 |
if not st.session_state.get("initial_page_loaded", False):
|
| 1625 |
spinner_placeholder = st.empty()
|
| 1626 |
-
with CustomSpinner(spinner_placeholder, "Initial Load..."):
|
| 1627 |
st.session_state["initial_page_loaded"] = True
|
| 1628 |
|
| 1629 |
# Basic branch: game page
|
|
|
|
| 1623 |
# Show spinner on initial load
|
| 1624 |
if not st.session_state.get("initial_page_loaded", False):
|
| 1625 |
spinner_placeholder = st.empty()
|
| 1626 |
+
with CustomSpinner(spinner_placeholder, "Initial Load...", 0.85):
|
| 1627 |
st.session_state["initial_page_loaded"] = True
|
| 1628 |
|
| 1629 |
# Basic branch: game page
|
battlewords/ui_helpers.py
CHANGED
|
@@ -444,20 +444,10 @@ def remove_spinner(duration_s: float = 0.5) -> None:
|
|
| 444 |
<script>
|
| 445 |
(function() {{
|
| 446 |
try {{
|
| 447 |
-
var
|
| 448 |
-
var
|
| 449 |
-
var el = doc.getElementById('bw-spinner-active');
|
| 450 |
-
if ((!root || !el) && window.parent && window.parent !== window) {{
|
| 451 |
-
try {{
|
| 452 |
-
var parentDoc = window.parent.document;
|
| 453 |
-
root = root || parentDoc.getElementById('root');
|
| 454 |
-
el = el || parentDoc.getElementById('bw-spinner-active');
|
| 455 |
-
doc = parentDoc;
|
| 456 |
-
}} catch (e) {{}}
|
| 457 |
-
}}
|
| 458 |
if (!el) return;
|
| 459 |
window.setTimeout(function() {{
|
| 460 |
-
try {{ el.remove(); }} catch (e) {{ /* no-op */ }}
|
| 461 |
try {{
|
| 462 |
if (root) root.classList.remove('bw-spinner-active');
|
| 463 |
}} catch (e) {{ /* no-op */ }}
|
|
|
|
| 444 |
<script>
|
| 445 |
(function() {{
|
| 446 |
try {{
|
| 447 |
+
var root = document.getElementById('root');
|
| 448 |
+
var el = root && root.classList.contains('bw-spinner-active') ? root : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
if (!el) return;
|
| 450 |
window.setTimeout(function() {{
|
|
|
|
| 451 |
try {{
|
| 452 |
if (root) root.classList.remove('bw-spinner-active');
|
| 453 |
}} catch (e) {{ /* no-op */ }}
|
claude.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
| 3 |
## Project Overview
|
| 4 |
Battlewords is a vocabulary learning game inspired by Battleship mechanics, built with Streamlit and Python. Players reveal cells on a 12×12 grid to discover hidden words.
|
| 5 |
|
| 6 |
-
**Current Version:** 0.2.
|
| 7 |
**Branch:** `basic`
|
| 8 |
-
**Last Updated:** 2026-
|
| 9 |
**Repository:** https://github.com/Oncorporation/Battlewords.git
|
| 10 |
|
| 11 |
This file describes the intended scope of the `basic` branch only.
|
|
|
|
| 3 |
## Project Overview
|
| 4 |
Battlewords is a vocabulary learning game inspired by Battleship mechanics, built with Streamlit and Python. Players reveal cells on a 12×12 grid to discover hidden words.
|
| 5 |
|
| 6 |
+
**Current Version:** 0.2.44 BASIC
|
| 7 |
**Branch:** `basic`
|
| 8 |
+
**Last Updated:** 2026-05-21
|
| 9 |
**Repository:** https://github.com/Oncorporation/Battlewords.git
|
| 10 |
|
| 11 |
This file describes the intended scope of the `basic` branch only.
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[project]
|
| 2 |
name = "battlewords"
|
| 3 |
-
version = "0.2.
|
| 4 |
description = "Battlewords vocabulary game (basic branch)"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12,<3.13"
|
|
|
|
| 1 |
[project]
|
| 2 |
name = "battlewords"
|
| 3 |
+
version = "0.2.44"
|
| 4 |
description = "Battlewords vocabulary game (basic branch)"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12,<3.13"
|
specs/basic.mdx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
# Battlewords: Basic Branch Requirements
|
| 2 |
|
| 3 |
-
**Current Version:** 0.2.
|
| 4 |
**Branch:** `basic`
|
| 5 |
-
**Last Updated:** 2026-
|
| 6 |
|
| 7 |
This document defines the “basic” version scope for Battlewords on the `basic` branch. It intentionally limits features to a minimal, default-settings single-player experience.
|
| 8 |
|
|
|
|
| 1 |
# Battlewords: Basic Branch Requirements
|
| 2 |
|
| 3 |
+
**Current Version:** 0.2.44 BASIC
|
| 4 |
**Branch:** `basic`
|
| 5 |
+
**Last Updated:** 2026-05-21
|
| 6 |
|
| 7 |
This document defines the “basic” version scope for Battlewords on the `basic` branch. It intentionally limits features to a minimal, default-settings single-player experience.
|
| 8 |
|
specs/requirements.mdx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
# Battlewords: Implementation Requirements
|
| 2 |
|
| 3 |
-
**Current Version:** 0.2.
|
| 4 |
**Branch:** `basic`
|
| 5 |
-
**Last Updated:** 2026-
|
| 6 |
|
| 7 |
This document captures the implementation requirements for the **basic** branch only (single-player, default settings, one play experience).
|
| 8 |
|
|
|
|
| 1 |
# Battlewords: Implementation Requirements
|
| 2 |
|
| 3 |
+
**Current Version:** 0.2.44 BASIC
|
| 4 |
**Branch:** `basic`
|
| 5 |
+
**Last Updated:** 2026-05-21
|
| 6 |
|
| 7 |
This document captures the implementation requirements for the **basic** branch only (single-player, default settings, one play experience).
|
| 8 |
|
specs/specs.mdx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
# Battlewords Game Requirements
|
| 2 |
|
| 3 |
-
**Current Version:** 0.2.
|
| 4 |
**Branch:** `basic`
|
| 5 |
-
**Last Updated:** 2026-
|
| 6 |
|
| 7 |
## Overview
|
| 8 |
Battlewords is inspired by the classic Battleship game, but uses words instead of ships. The objective is to discover hidden words on a grid, earning points for strategic guessing before all letters are revealed.
|
|
|
|
| 1 |
# Battlewords Game Requirements
|
| 2 |
|
| 3 |
+
**Current Version:** 0.2.44 BASIC
|
| 4 |
**Branch:** `basic`
|
| 5 |
+
**Last Updated:** 2026-05-21
|
| 6 |
|
| 7 |
## Overview
|
| 8 |
Battlewords is inspired by the classic Battleship game, but uses words instead of ships. The objective is to discover hidden words on a grid, earning points for strategic guessing before all letters are revealed.
|