Repository navigation
Add the Debate tab, debate switcher and You tab to the app - #125
Conversation
The app reads and writes debates, current_debates and user_settings the way the website's stores do, so both share one Current Debate and one set of settings. One-off mode stays session-only, as on the website. The debate side is kept on the device, because debates has no side column. The interface language and theme follow the account's saved choice. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Debate tab follows mock 01: the Current debate pill, the motion as the title, the side control, counts of sources, results and rounds, the Spar against the AI card, the Prepare tiles and recent work. Tools and results open the existing placeholders until their screens land. The pill opens the switcher from mock 02 as a native form sheet: search, the debates with their source counts, one-off mode and New debate. New debate takes a motion, side and format and makes the debate current. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
You shows the plan and today's AI usage, computed as the website's useSubscription does; the interface language, AI output language and theme, written to user_settings so the website shows the same; and the account, with deletion through the account Edge Function behind the website's typed confirmation. Download my data is left for later, since it needs file sharing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The screenshot script now captures the Debate tab, the switcher, the new-debate form, the empty state and You. It answers the app's user_settings reads with each run's language and the System theme, so the account's saved choices do not override the locale under test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Hungarian "Folyamatábra" did not fit its Prepare tile, so the tiles are tighter and the label shrinks to fit on iOS. The one-off icon tile used the segment colour, which matches the card in dark mode; it now uses the line colour, as in mock 02. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
|
Product decision from Adam on the In favor / Against toggle: debaters prepare both sides and usually don't know which one they will speak, so the app will not store or sync a "your side". The toggle becomes a view of the debate's pro and con preparation (results filtered by side, with the website's rule for results tagged 'both'), the Spar card drops "you speak Pro", and Sparring will ask for a side when a round starts. The device-stored side in this PR is being removed in a follow-up commit on this branch before merge. |
Students prepare both sides of a motion and rarely know theirs in advance, so the Debate tab no longer stores a side per debate. Its In favor / Against toggle now only chooses which side's results and recent work it shows, using the website's rule: 'both' counts for either side, neutral and side-less work for neither. Sources and rounds stay whole-debate counts. The toggle starts on In favor for each debate and is never stored. The new-debate sheet loses its side field, and the Spar card shows the format and that the side is picked when the round starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d them Creating or switching a debate now reads the signed-in account when the student acts and, if the account changed while the write ran, leaves the screen alone instead of showing the result to the next account. Overlapping refreshes carry a sequence number, so only the latest one lands. Every debate read, count and recent-work query, and the activity update on a switch, also filter on the user as defence in depth behind row level security. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The website reads an empty user_settings.feature_configs as a row that was never saved and replaces its language and theme with the browser's. The app now writes the website's default feature configs with its first save while the row has none, filtered on the empty object so configs saved meanwhile stay. The default builder moves to @debatelab/core so both clients write the same value, and a test feeds such a row through the website's hydration. Each save bumps a per-key version. A load keeps the local value of any key saved after it started, and a failed save rolls back only its own key, and only while it is still that key's latest save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The delete sheet printed the server's English message under the translated heading. It now shows the heading and a translated hint that the account is still there, and logs the raw message to the console. The website maps no deletion errors, so there are no cases to translate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the app saved a student's first setting it filled the empty feature_configs with the non-Pro default model. The website would have used the Pro default for a student with Pro access, and it never upgrades configs once they are saved, so a Pro student who first saved in the app kept the weaker model on the website. The Pro access check now lives in @debatelab/core (ai/pro-access.ts) and both the website's settings store and the app use it. The app reads the tier, grace period and subscriptions on that first save and picks DEFAULT_PRO_MODEL when the check passes. If the check can't be read, it writes only the changed column and leaves configs empty, so the next save tries again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex review r1 (gpt-6.1-sol, head 4391026): 7 findings. I checked each against the code and all 7 were real. All are fixed as of 23aab53.
There was also a product change: the In favor / Against toggle is now a pro/con prep view, and nothing is stored (df9c998). Local checks at 23aab53 (GitHub Actions is billing-blocked, so none of this ran in CI): lint, typecheck, Not proven: the race fixes rest on reading the code, and the app-side settings write has not run against real PostgREST because staging writes were not allowed. Codex r2 at 23aab53 is running. 🤖 Generated with Claude Code |
Saves now go through one queue per provider, so the last choice made is the last write even when an earlier save's Pro-access lookup is slower. A save queued before an account switch is dropped and never touches the new account's state. When feature_configs may be empty and Pro access can't be read, the save now writes nothing and fails, so the You tab rolls the setting back and shows its save error. Writing the column alone let the website discard the choice on its next hydrate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed save rolled back to the value on screen when it started, which could be another unconfirmed choice. The app now keeps, per setting, the value last loaded or saved successfully and rolls back to that. Saves, loads and debate writes were guarded by user ID, so work started before signing out and back in as the same account still landed. They now check an owner generation that is bumped on every owner change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex review rounds 2 to 4 (gpt-6.1-sol)
Accepted, not fixed:
Local checks at 89bb34c (GitHub Actions starts no jobs on this account because of billing): lint, typecheck, Merging into 🤖 Generated with Claude Code |




Second piece of milestone 1 from plans/2026-10-08-native-ios-app.md: the Debate tab built to mock 01, the debate switcher sheet built to mock 02, a new-debate sheet, and the You tab. Targets
feat/native-ios.What the app now does:
accountEdge Function.One account everywhere: the app reads and writes
debates,current_debatesanduser_settingsas the website's stores do (its first settings save also fills the website's default model settings, the Pro ones for Pro students, so the website keeps the phone's choices), so switching a debate or changing the language on the phone shows up on the website. One-off mode lives in memory, as on the website.Not in this PR: "Download my data" (needs file sharing, later), deleting a debate from the switcher (the mock has no control for it), and offline reading (PR 7).
Checks, run locally on Node 22.23.2 at the final head because GitHub Actions starts no jobs on this account (billing):
npm run verifyexit 0 (276 Vitest tests, 30 collaboration, 333 Deno, build, service-worker, 30 Chromium smoke). Mobile typecheck,eslint apps/mobileand knip exit 0. Each of the five commits typechecks and lints on its own after a freshnpm ci.date-fns, pure JavaScript and already in the root tree.3b-test-motions: create two debates, switch between them, toggle one-off mode, change language, output language and theme and readuser_settingsback, reload in Hungarian with dark mode applied, then restore. Every test debate is deleted and the seed account is back to its recorded state. A deletion request with the wrong confirmation returned 400 and deleted nothing.Not proven here: the native form sheet, keyboard avoidance and the iOS switch on a real iPhone, the Hungarian Flowchart tile shrinking to fit (the web preview can't shrink text, so it truncates there), and a full account deletion (the seed account is never deleted). Those are milestone checks on Adam's phone.
🤖 Generated with Claude Code