docs: restore env example and document mock api flag#27
Conversation
|
I reproduced the failure path locally with VITE_USE_MOCK_API=false and a real /api/dataset 500 response. The error state renders correctly and Retry works. It looks like the blank screen was environment-specific or related to a different runtime state. I kept the follow-up issue open for further investigation. |
martian56
left a comment
There was a problem hiding this comment.
The docs themselves are good. The README section is clear, it correctly states mock is the default and HTTP is the opt-in, and restoring .env.example addresses exactly the note I left on #22. Two things to fix before this merges, both quick.
-
Remove 'Closes #25'. Issue #25 is the blank-screen-on-fetch-failure bug, the real one where the whole app goes blank when the dataset request fails. This PR only touches docs, it does not fix that. If it merges with 'Closes #25' in the body, GitHub auto-closes the bug and we lose track of a live, still-broken issue. Change it to 'Relates to #25' or just drop the line, and leave #25 open until the render bug is actually fixed.
-
The .env.example value works against us right now, inline. It ships VITE_USE_MOCK_API=false, so anyone who does the usual
cp .env.example .envlands in HTTP mode, which is precisely the path that currently blanks the screen on any failure (#25). Until #25 is fixed, the example should keep people on the safe default.
Fix those two and this is a clean merge. Nice that you filed #25 to track the render bug separately, that was the right move.
| @@ -0,0 +1 @@ | |||
| VITE_USE_MOCK_API=false No newline at end of file | |||
There was a problem hiding this comment.
Shipping this as false means copying .env.example into .env opts you straight into the HTTP path, which is the one that blanks the screen on any failure today (#25). Two cleaner options: set it to true so a copy keeps the safe mock default, or comment it out with a note, like # VITE_USE_MOCK_API=false # set false to use the HTTP dataset API; defaults to mock. The second documents the flag without flipping anyone into the buggy path by default. Also add a trailing newline, the file currently ends without one.
martian56
left a comment
There was a problem hiding this comment.
Both points addressed, clean. Closes #25 is out of the body so the blank-screen bug stays open and tracked, and .env.example now comments the flag out with a note explaining the default, so copying it keeps the safe mock path instead of opting into the failure path. Trailing newline is there too. The README section reads well. Docs only, nothing to run. Good to merge.
What does this change?
Restores the
.env.examplefile and documents theVITE_USE_MOCK_APIflag in the README.This makes it clear that:
VITE_USE_MOCK_API=falseArea
Screenshots
N/A
Checklist
bun run typecheck && bun run buildinapps/web(for frontend changes)