Skip to content

Keep signed-out food logs neutral - #24

Merged
xrpbanks merged 4 commits into
mainfrom
fix/neutral-signed-out-food-log
Aug 29, 2026
Merged

Keep signed-out food logs neutral#24
xrpbanks merged 4 commits into
mainfrom
fix/neutral-signed-out-food-log

Conversation

@xrpbanks

Copy link
Copy Markdown
Contributor

Summary

  • start the food-log area in a neutral signed-out state
  • do not request private logs during the public page mount
  • announce authentication once, only after /api/identity/me confirms the session
  • retain the existing transport-error path when the backend is unavailable

Why

A cold or unavailable backend must not turn the optional private log into a confusing public error, and private logs should load only after identity is confirmed.

Release gate

Merge only after repository, frontend, backend and WordPress release checks pass. Then deploy and verify signed-out, signed-in, logout and cold-start behavior.

Start with a neutral sign-in state and wait for the authenticated identity event before loading private food logs.
Emit one authenticated event from refreshCurrentUser so private food logs load only after identity is confirmed, without duplicate reloads.
Copilot AI lite review requested due to automatic review settings August 29, 2026 23:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the frontend’s signed-out experience so the food-log area starts in a neutral state and avoids fetching private log data during the public page mount, only loading logs after authentication is confirmed via /api/identity/me.

Changes:

  • Centralize/authenticate the auth-state announcement so it fires after a successful /api/identity/me response.
  • Initialize the food-log UI in a signed-out neutral state and remove the automatic logs fetch on mount.
  • Rely on the auth-state change event to trigger private log loading instead of fetching logs unconditionally.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/components/XamanLoginPanel.tsx Moves announceAuthState(true) to the /api/identity/me success path to ensure auth is announced only after session confirmation.
frontend/components/FoodSearchPlaceholder.tsx Starts the log UI in a signed-out neutral state and removes the mount-time fetchLogs() call to avoid requesting private logs on public load.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/components/FoodSearchPlaceholder.tsx
Comment thread frontend/components/XamanLoginPanel.tsx
Bind identity refreshes to their owning login or bridge lifecycle before announcing global auth state.
Remove the signed-out status as soon as authenticated log loading begins; restore it on a 401 response.
@xrpbanks
xrpbanks merged commit c511902 into main Aug 29, 2026
4 checks 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.

2 participants