Repository navigation
Recipe book in the Sheet section; phone-friendly top bar with real user avatar - #37
Merged
Merged
Conversation
/recipes lists recipes as picture cards; /recipes/<slug> shows the picture, an ingredient checklist and numbered steps. Recipes are plain data in src/safe_family/urls/recipes_data.py (copy a block to add one), pictures in static/recipes/. One example recipe with its own SVG picture. The Sheet page gets a separate Recipes section below Calculators, and the Sheet nav item stays active on the recipe pages. tests/test_recipes.py validates the hand-edited data (fields, unique slugs, pictures exist) and the pages (login, list, detail, 404, no picture, empty list). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CKZWtPcMA8pSrVvGGwno21
The bar was one fixed row (brand, eight links, user), so on a phone it made every page about 660px wide and scroll sideways. - Up to 900px: brand and user stay on the first row; the links move to a full-width second row that wraps. - Up to 480px: the links form a balanced grid (4 + 3) and the ZZUSE mark and user name text are hidden (the avatar shows the initial), keeping the first row on one line. Desktop is unchanged. Checked at 320, 360, 390, 430, 768 and 1280px on the Sheet, recipe, notes, blog and calculator pages, logged in as admin and logged out: no page is wider than the screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CKZWtPcMA8pSrVvGGwno21
The avatar always showed 'M' and the name was empty: the template read session.user_name, which login never sets (same for session.role, so the GAME MASTER badge never appeared). A context processor now looks up the logged-in user per request (get_current_username) and gives the template their username, initial and admin flag; admin still requires the configured ADMIN_IDENTITY, as elsewhere. A missing user or a database error falls back to '?' instead of failing the page. Logout moves from the menu to the user area. On phones the six links fit on one row from 320px up (tighter spacing under 340px), the badge gives way to an accent ring on the admin's avatar, and the 4-column grid is gone. Checked at 320-1280px as admin and as a normal user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CKZWtPcMA8pSrVvGGwno21
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recipe book (Sheet section, separate from the calculators)
/recipeslists recipes as picture cards (title, summary, time, servings, tags)./recipes/<slug>shows the picture, an ingredient checklist, numbered steps and an optional tip.src/safe_family/urls/recipes_data.py. To add one, copy a block. Pictures go insrc/safe_family/static/recipes/. Ships with one example (Tomato and Egg Stir-Fry) and its own SVG picture.tests/test_recipes.pychecks the hand-edited data: required fields, a valid slug, no duplicate slugs, list types, and that each picture file exists. It also covers the pages: login, list, detail, 404, no picture, empty list.Top bar on phones
Real user in the top bar
session.user_name, which login never sets.session.rolehad the same problem, so the GAME MASTER badge never appeared.inject_nav_userinapp.py) now looks up the logged-in user per request, so each user gets their own initial and name.ADMIN_IDENTITY, the same rule as the admin checks elsewhere.?rather than failing the page.Testing
pytest: 346 passed, total coverage 84% (above the 80% gate).ruff check .is clean.tests/test_nav_user.py: per-user initials, Logout placement, the admin badge, an admin claim for the wrong identity being ignored, a missing user, a database error, logged out.Deploying
docker compose up -d --build app. Templates, CSS and the recipe data are built into the app image.Generated by Claude Code