Main#3
Conversation
…-creation-tool Add TapApp Studio no-code AI app builder prototype
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbb8b76ec9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| function extractJson(text) { | ||
| const match = text.match(/\{[\s\S]*\}/); |
There was a problem hiding this comment.
Parse the last JSON object instead of greedy brace span
extractJson currently matches from the first { to the last } in the entire model response, which breaks when the response contains any earlier brace pair before the actual payload. In this file, the Hugging Face prompt itself includes literal JSON in inputs, and generated_text responses can include prompt text, so this parser can consistently produce an invalid slice and force the fallback template even when the model returned usable JSON.
Useful? React with 👍 / 👎.
| ] | ||
| }; | ||
|
|
||
| let state = JSON.parse(localStorage.getItem("tapapp-state") || "null") || defaultState; |
There was a problem hiding this comment.
Guard persisted state parsing against malformed localStorage
Startup parses tapapp-state with a bare JSON.parse and no recovery path, so any malformed value (for example from prior builds, manual edits, or storage corruption) throws before the UI can render. This makes the whole app unusable until storage is manually cleared, so the parse should be wrapped and fall back to defaultState on failure.
Useful? React with 👍 / 👎.
No description provided.