Commit Graph

74 Commits

Author SHA1 Message Date
Frank Schwenk
dc1d9a23a9 feat(#28): add continue arrow and auto-advance in BreakOrder step
- Auto-advance when selecting first breaker for Winnerbreak and 2-player Wechselbreak
- Keep auto-advance after choosing second for 3-player Wechselbreak
- Add explicit right arrow to continue manually based on current selection

Refs #28
2025-10-30 11:51:36 +01:00
Frank Schwenk
a11d41f934 feat(#28): place breaker indicator inline to the right of player name
- Indicator now renders after the name, inline, sized to 1em height
- Tooltip/aria-label remains “Break”

Refs #28
2025-10-30 11:47:46 +01:00
Frank Schwenk
1bd9919b6b feat(#28): add break rule & order to games and UI
- Types: add BreakRule, break metadata to StandardGame, extend NewGameData/steps
- NewGame: add BreakRule and BreakOrder steps with auto-advance
- NewGameScreen: wire new steps into flow
- GameService: set up defaults, persist break order, compute next breaker on +1
- GameDetail: show breaker indicator; treat -1 as undo equivalent

Backfill defaults for existing games via service logic.

Refs #28
2025-10-30 11:34:26 +01:00
Frank Schwenk
147906af59 refactor: remove toast notifications from game detail
- Delete Toast component and styles
- Remove all toast usage from GameDetail

Simplifies UX and eliminates transient notifications.

Refs #26
2025-10-30 11:05:27 +01:00
Frank Schwenk
634d012097 fix(ui): prevent winner modal icons from clipping
Increase top padding, set overflow visible, and position decorative icons inside container so emojis are fully visible.

Refs #26
2025-10-30 10:50:24 +01:00
Frank Schwenk
301d5b131c feat(ux): auto-advance on game type and race selection
- Step 4: selecting a game type immediately advances to step 5
- Step 5: selecting Endlos or a quick-pick number immediately finalizes race-to

Improves flow by removing an extra click. No changes to validation.

Refs #26
2025-10-30 10:41:38 +01:00
Frank Schwenk
4c8b0cfed7 refactor(css): remove global :focus outline styles in index.css\n\nFocus rings were visually distracting for this app context; removed the global *:focus rule. Component-level focus where needed can be handled locally.\n\nRefs #26 2025-10-30 10:36:47 +01:00
Frank Schwenk
31ed600c97 fix(build): remove stray CSS brace causing esbuild minify warning
Fix unexpected '}' in src/styles/index.css after .btn--secondary:hover.\nEliminates Vite/esbuild css-syntax-error during production build.\n\nRefs #26
2025-10-30 10:34:30 +01:00
Frank Schwenk
d016868ff2 feat(ux): autofocus name inputs on new game steps\n\nFocus Player 1/2/3 inputs on mount and place caret at end for faster entry.\n\nNo behavior changes beyond focus; adheres to accessibility with native focus.\n\nRefs #26 2025-10-30 10:15:30 +01:00
Frank Schwenk
89300bc021 fix(ui): align delete icon inline in game list
Apply game-item grid layout to game list rows and switch to two-column layout (1fr auto) so the delete action has a fixed-width slot on the right.

Keeps existing delete button and accessibility attributes; prevents layout stretch.
No behavioral changes beyond layout; click targets unchanged.

Refs #26
2025-10-30 10:04:11 +01:00
Frank Schwenk
de502741e7 Merge github/main into main (resolve .gitea to upstream) 2025-10-30 09:44:14 +01:00
Frank Schwenk
8085d2ecc8 feat(storage): migrate to IndexedDB with localStorage fallback and async app flow
- Add IndexedDB service with schema, indexes, and player stats
- Migrate GameService to async IndexedDB and auto-migrate from localStorage
- Update hooks and App handlers to async; add error handling and UX feedback
- Convert remaining JSX components to TSX
- Add test utility for IndexedDB and migration checks
- Extend game types with sync fields for future online sync
2.0.2
2025-10-30 09:36:17 +01:00
Frank Schwenk
e89ae1039d fix: prevent endlos games from ending immediately on first score
- Change endlos raceTo from 0 to Infinity to prevent automatic completion
- Update NewGame component to handle Infinity values properly
- Add Infinity checks in game completion and winner logic
- Fix game progress calculation for endless games

Fixes issue where selecting 'endlos' mode would end the match
immediately when any player scored their first point.
2025-10-28 16:44:57 +01:00
Frank Schwenk
8bbe3b9b70 refactor: consolidate game components and add toast notifications
- Remove EndlosGame support and GameDetail141.jsx component
- Add Toast notification system with CSS styling
- Refactor GameCompletionModal with enhanced styling
- Improve GameDetail component structure and styling
- Add BaseLayout.astro for consistent page structure
- Update gameService with cleaner logic
- Enhance global styles and remove unused constants
- Streamline navigation components
2025-10-28 16:30:39 +01:00
Frank Schwenk
d1e1616faa Merge pull request #2 from froxxxy/cursor/fix-ui-flaws-for-tablet-aesthetics-5dab
Fix ui flaws for tablet aesthetics
2025-06-24 14:03:44 +02:00
Cursor Agent
6058de5103 Refactor UI with design system, tablet optimization, and enhanced styling 2025-06-24 12:02:35 +00:00
Frank Schwenk
eb005b1c05 Merge pull request #1 from froxxxy/cursor/refactor-project-for-reusability-and-best-practices-b090
Refactor project for reusability and best practices
2025-06-24 13:46:13 +02:00
Cursor Agent
6f626c9977 Refactor BSC Score to Astro, TypeScript, and modular architecture 2025-06-24 11:44:19 +00:00
Frank Schwenk
bcf793b9e3 fix(14-1): re-rack logic, turn button label, and foul input
- Re-rack logic fixed to accumulate and score correctly
- Turn switch button now shows two opposing arrows (⇄)
- Two foul buttons replaced by a single 'Foul -1' button styled like re-rack, can be pressed multiple times

Refs #26
2025-06-24 11:06:20 +02:00
Frank Schwenk
e6a5dcebbe feat(14-1): manual turn change and input accumulation
- Turns are now only changed by a big, prominent button
- Players can make multiple inputs (balls left, fouls, re-rack) before changing turns
- Players can change turn with no input (0 balls potted, 0 foul)
- All actions are accumulated in local state and finalized on turn change
- No automatic turn changes remain

Refs #26
2025-06-24 11:01:28 +02:00
Frank Schwenk
c6557dc050 feat(14-1): show sum of foul points per player per round in log table
- Table now groups turns into rounds (Aufnahmen) and displays sum of all foul points (including penalties) for each player in each round
- Improves clarity and accuracy of move log for 14/1

Refs #26
2025-06-24 10:53:37 +02:00
Frank Schwenk
b8bc3f8a5c fix(14-1): remove '0' ball button from end-of-turn grid
- The '0' button is no longer shown in the 'Bälle am Ende der Aufnahme' grid
- Only buttons for 1–15 balls are now available, matching real game scenarios

Refs #26
2025-06-24 10:40:28 +02:00
Frank Schwenk
ed552b3fbe style(14-1): make active player highly visible in game view
- Active player card now features thick, glowing orange border, strong background highlight, left accent bar, and animated pulse
- Player name and score have increased contrast for unmistakable visibility

Refs #26
2025-06-24 10:39:21 +02:00
Frank Schwenk
f0a91724d2 fix(14-1): correct re-rack scoring and table reset
- Player score incremented by (balls on table before re-rack + balls added - 15)
- Balls on table always set to 15 after re-rack
- Log entry includes all relevant details for traceability

Refs #26
2025-06-24 10:36:51 +02:00
Frank Schwenk
7d4cc30e97 style(new-game): restrict player color backgrounds to player input steps
- Only player input containers use the new color backgrounds, borders, and shadows
- Game type selection and other steps are visually unaffected
- Ensures clear, consistent player association without UI side effects

Refs #26
2025-06-24 10:17:58 +02:00
Frank Schwenk
592ba57286 fix(ui): prevent auto keyboard popup on player select
- Removed autoFocus from player input fields in new game creation
- Prevents on-screen keyboard from opening automatically on mobile

Refs #26
2025-06-24 10:13:30 +02:00
Frank Schwenk
0b5fa3f697 style(ui): make 'Neues Spiel' button visually prominent
- Increased size, padding, and border radius of the button
- Changed background to bold orange with white text
- Added a plus icon before the text
- Added drop shadow and modern hover effect for emphasis

Refs #26
2025-06-24 10:10:38 +02:00
Frank Schwenk
0247c7d384 feat(new-game): dynamic race-to quick picks and defaults for 14/1
- Passes selected game type to RaceToStep in App.jsx
- RaceToStep now shows quick pick values 60, 70, 80, 90, 100 (default 80) for 14/1, 1–9 (default 5) for others
- Number input always displays the default if none selected, updates on game type change
- Updates .gitea to reference issue #26 for traceability

Refs #26
2025-06-24 10:08:07 +02:00
Frank Schwenk
68434f885d feat(game-14.1): Implement undo, forfeit, log, and stats
- Implements a robust undo feature using a state stack.
- Adds a 'Forfeit' button to allow a player to concede the game.
- Introduces a 'Game Log' to track all turns, fouls, and re-racks.
- Calculates and displays post-game statistics (highest run, avg. pots/turn).
- All changes are related to issue #21.
2025-06-22 11:05:51 +02:00
Frank Schwenk
aa5ef1c5b2 feat(14.1): Implement foul system
Implements a comprehensive foul system for the 14.1 game mode as per issue #20.

- **`src/components/GameDetail141.jsx`**

    - Adds `handleFoul` function to manage standard (-1pt) and break (-2pt) fouls.

    - Implements logic for the 3-consecutive-foul rule, applying a -15pt penalty.

    - Adds foul counters and a visual warning for players with 2 consecutive fouls.

    - Resets the consecutive foul counter on a legal (non-foul) turn.

- **`src/components/GameDetail.module.css`**

    - Adds styles for foul buttons (`.foul-btn`).

    - Adds styles for the foul counter indicator (`.foul-indicator`) and warning (`.foul-warning`).

This commit fulfills the requirements for issue #20. The `.gitea` file is left unstaged as it points to the next issue to be worked on.
2025-06-22 10:43:21 +02:00
Frank Schwenk
6a25c18153 feat(game-14-1): Implement re-rack logic and scoring hooks
Implements the re-rack functionality and prepares the scoring system for foul integration, as detailed in issue #19.

- Adds '+14' and '+15' re-rack buttons to the game view.
- Creates a  function to update the number of balls on the table.
- Modifies the  function to accept an optional  argument, preparing it for the next phase of development.

Closes #19
2025-06-20 16:07:38 +02:00
Frank Schwenk
a71c65852d feat(game-14-1): Implement phase 1 foundation
Implements the foundational UI and logic for the 14.1 Endless game mode, as detailed in issue #18.

- Adds a new  component to handle the specific game view.
- Introduces a modal within the game view to select the starting player.
- Replaces text input with a button grid for selecting remaining balls.
- Updates  to correctly initialize the 14.1 game state.

Closes #18
2025-06-20 15:35:38 +02:00
Frank Schwenk
875e9c8795 feat: Implement rematch functionality
Refs #17

Adds a 'Rematch' button to the game completion modal.

Introduces a 'handleRematch' function in 'App.jsx' to create a new game with the same players and settings as the previous game.

The 'onRematch' handler is passed down to the 'GameCompletionModal' component.

Adds '.gitea' to '.gitignore' to prevent tracking local issue context.
2025-06-20 13:35:42 +02:00
Frank Schwenk
429d479f69 feat: Implement score increment on click and cleanup CSS
- Implemented score increment functionality directly on the score display in GameDetail.jsx.

- Deleted obsolete ValidationModal.module.css to finalize style consolidation.

- This resolves all outstanding tasks for the refactor and adds a minor feature enhancement.

- Closes #1
2025-06-20 13:01:30 +02:00
Frank Schwenk
dbc173f57b feat: optimize player selection for touch input
- Increases the number of quick-pick buttons from 4 to 10.
- Adds a '...' button that appears when more than 10 players exist in history.
- Clicking '...' opens a scrollable modal listing all past players for easy selection.
- This provides a much faster player selection flow on touch devices.

Closes #4
2025-06-20 11:03:37 +02:00
Frank Schwenk
b466dd2a0a feat: complete wizard navigation for all steps
- Adds forward navigation arrows to the 'Game Type' and 'Race To' steps in the new game wizard.
- Unifies navigation logic across all five steps.
- Users can now review their selections before proceeding.

Closes #11
2025-06-20 10:44:27 +02:00
Frank Schwenk
14fd711858 refactor: Update Race To step UI and logic
- Renames 'Offen' to 'Endlos' and moves it to a separate line.
- Extends quick-pick buttons to include 1-9.
- Removes 'Custom' button and makes numeric input always visible.
- Updates placeholder text for the custom input.
- Closes #10
2025-06-20 10:23:14 +02:00
Frank Schwenk
1c77661dbc feat: Implement Game Type selection step
- Adds the 'GameTypeStep' to the new game wizard.
- Features large, touch-friendly buttons for selecting game types.
- Selection automatically proceeds to the next step.
- Includes progress indicator and back navigation.
- Closes #9
2025-06-20 10:16:13 +02:00
Frank Schwenk
47554cdd27 feat: Implement Player 3 input step
- Implemented the third step of the new game creation wizard for Player 3's name input.
- The step is optional and includes a 'Skip' button.
- Includes autosuggestions from player history and quick-pick buttons.
- Aligned styling and layout with previous steps, including fixes for button alignment.
- Closes #8
2025-06-20 10:10:32 +02:00
Frank Schwenk
a2b618ce16 feat(wizard): Player 2 step and multi-step navigation
- Add Player2Step component for player 2 name input
- Implement multi-step wizard logic in App.jsx
- Player 1/2 steps now allow forward/back navigation
- Left arrow on Player 2 returns to Player 1, not abort
- Prepare placeholders for further steps

Closes #7
2025-06-18 20:59:05 +02:00
Frank Schwenk
76ef005cda feat(wizard): Player 1 step UI overhaul
- Quick-pick now advances to next step
- Added clear (×) icon to input field
- Replaced navigation buttons with large left/right arrows
- All controls are touch-friendly and visually prominent

Closes #6
2025-06-18 20:48:28 +02:00
Frank Schwenk
d1379985f3 refactor: deduplicate modal/button styles and enforce global utility usage
- Consolidated all modal-related styles into Modal.module.css; ValidationModal.module.css is now deprecated
- All main action/navigation buttons in NewGame and GameDetail use global .btn/.nav-buttons utility classes
- Removed duplicate utility classes from component CSS files
- Fixed .fullscreenToggle class naming for consistency
- Cleaned up component CSS to only contain component-specific styles
- Updated GameCompletionModal to use shared modal styles

This ensures DRY, maintainable, and consistent styling across the app.
2025-06-06 16:42:11 +02:00
Frank Schwenk
209df5d9f2 refactor: apply Astro, Preact, and general best practices to src
- Refactored all components in src/components to:
  - Use arrow function components and prop destructuring
  - Add JSDoc for all exported components
  - Improve accessibility (aria-labels, roles, etc.)
  - Use correct key usage in lists
  - Add comments for non-obvious logic
  - Use modern event handler patterns and memoization where appropriate
- Refactored src/pages/index.astro:
  - Removed <html>, <head>, and <body> (should be in layout)
  - Used semantic <main> for main content
  - Kept only necessary imports and markup
- Refactored src/styles/index.css:
  - Removed duplicate rules
  - Ensured only global resets/utilities are present
  - Added comments for clarity
  - Ensured no component-specific styles are present
  - Used consistent formatting

Brings the codebase in line with modern Astro and Preact best practices, improves maintainability, accessibility, and code clarity.
2025-06-06 16:28:57 +02:00
Frank Schwenk
7cb79f5ee3 fix: modal overlay and game screen styling
- Move modal overlay CSS to global stylesheet for reliable overlay behavior
- Render GameCompletionModal outside main container for true overlay effect
- Refactor GameCompletionModal to use global overlay and local content styles
- Fix player score layout, color, and button styling on game detail screen
- Add global .modal and .modal.show classes to index.css
- Clean up CSS modules for modal content and responsive design

Fixes #<issue_number>
2025-06-06 15:56:04 +02:00
Frank Schwenk
d81c375f1e feat(new-game): prefill with last game, add clear-all button
- New Game form is now prefilled with the last created game's values
- Added 'Felder leeren' (Clear All) button at the top to reset all fields
- Improves speed and UX for repeated game entry

Refs #1
2025-06-06 13:11:03 +02:00
Frank Schwenk
c845b0cb51 refactor(new-game): modernize UI, remove player selects
- Refactored New Game screen to use a modern, card-like, dark-themed layout
- Removed select dropdowns for previous players, now only datalist+input for player names
- Updated paddings, backgrounds, borders, and font sizes for a visually consistent, modern look
- No logic changes, only markup and style

Refs #1
2025-06-06 12:54:13 +02:00
Frank Schwenk
b44b013f58 refactor: move filter bar to GameList and fix button styling
- Moved filter button bar from App.jsx to GameList.jsx for better separation of concerns.
- Updated GameList to accept filter/setFilter props and render the filter bar internally.
- Moved .new-game-button styles to global CSS for consistent styling.
- Ensured filter button styles remain in GameList.module.css.
- Improves modularity and UI consistency.
2025-06-06 12:22:55 +02:00
Frank Schwenk
8384d08393 refactor: migrate UI to Preact components and remove legacy Astro/JS
- Replaced all .astro components with .jsx Preact components and added corresponding CSS modules.
- Updated index.astro to use the new App Preact component; removed legacy script and Astro imports.
- Deleted obsolete .astro component files and main JS logic (src/scripts/index.js, public/scripts/index.js).
- Updated astro.config.mjs for Preact integration.
- Updated package.json and package-lock.json to include @astrojs/preact and preact.
- Updated tsconfig.json for Preact JSX support.
- Refactored index.css to keep only global resets and utility styles.
- All changes relate to Gitea issue #1 (refactor to astro app).

Migrates the UI from Astro/vanilla JS to a modular Preact component architecture, removing all legacy code and aligning the project with modern best practices.
Refs #1
2025-06-06 11:58:29 +02:00
Frank Schwenk
de07d6e7a2 refactor: modularize screens, styles, and logic
- Split monolithic index.astro into Astro components for each screen and modal
- Moved all styles to src/styles/index.css
- Moved all JS logic to src/scripts/index.js and public/scripts/index.js
- Updated event wiring and removed inline handlers for best practice
- Ensured all components and scripts are integrated and functional

Refs #1
2025-06-05 19:51:01 +02:00
Frank Schwenk
38916b026d Commit staged changes 2025-06-05 18:27:02 +02:00