Add env-gated control for Google Sheets vocab writes (default-on)#13
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
MaheeGamage
June 14, 2026 07:33
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
MaheeGamage
marked this pull request as ready for review
June 14, 2026 07:35
Contributor
There was a problem hiding this comment.
Pull request overview
Adds environment-controlled gating for vocabulary persistence to Google Sheets so the app can be used in “read-only” mode without writing new vocab rows, while keeping default-on behavior.
Changes:
- Introduces shared env parsing for save enablement (
NEXT_PUBLIC_VOCAB_SAVING_ENABLED, optional server overrideVOCAB_SAVING_ENABLED). - Skips client save calls and short-circuits the server
POST /api/vocabwhen saving is disabled. - Updates docs/tracking files and restores a committed
.env.local.example.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/modules/vocab-store/vocabSavingFlag.ts | Centralized default-on env flag parsing for client/server save gating. |
| src/modules/vocab-store/saveVocab.ts | Client-side early return when vocab saving is disabled. |
| src/app/api/vocab/route.ts | Server-side POST early return when saving is disabled. |
| README.md | Documents the two env flags and clarifies build-time vs server override usage. |
| .project/tasks/task-006_google-sheets-adapter.md | Marks task status/step completion and logs the save-toggle implementation. |
| .project/overview.md | Updates task-006 status to in-review in project overview. |
| .gitignore | Un-ignores .env.local.example so it can be committed. |
| .env.local.example | Adds example env file including auth vars and save-toggle vars. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+71
to
+73
| - 2026-06-13: Added env save-toggle (`NEXT_PUBLIC_VOCAB_SAVING_ENABLED`, optional server | ||
| override `VOCAB_SAVING_ENABLED`) with default-on behavior. When disabled, client skips | ||
| save requests and server POST short-circuits safely. |
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.
Task 006 still had one open item: allow reading without writing vocabulary rows to Google Sheets. This PR adds an environment-controlled save gate with default-on behavior and updates task/docs to reflect completion.
Save gating (client + server)
NEXT_PUBLIC_VOCAB_SAVING_ENABLEDcontrols client-side save calls.VOCAB_SAVING_ENABLEDprovides server-side runtime override forPOST /api/vocab.POST /api/vocabnow short-circuits with{ ok: true, skipped: 'disabled' }when saving is disabled.Shared flag parsing
vocabSavingFlag.tsto centralize env parsing and falsey values (0 | false | no | off) and avoid duplicated logic.Config + docs
.env.local.examplewith auth vars plus save-toggle vars.in-reviewand checked off the pending env-toggle step in project tracking.