You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03f0e54
Browse filesBrowse the repository at this point in the historyBrowse files
-`src/app/`: routes. `sign-in.tsx`; `(tabs)/` with one route group per tab: Debate, Prepare, Practice, Library, You; the form sheets `debates.tsx` (switcher), `new-debate.tsx`, `delete-account.tsx`, `add-link.tsx`, `new-note.tsx` and `source/[id].tsx`; and `ask.tsx`, `generate.tsx`, `case/[id].tsx`, `attack/index.tsx` and `attack/[id].tsx`, full screen above the tabs. All are declared in the root `_layout.tsx`. `(prepare)/coming/[tool].tsx` and `(practice)/soon/[tool].tsx` stand in for tools not in the app yet.
20
+
-`src/app/`: routes. `sign-in.tsx`; `(tabs)/` with one route group per tab: Debate, Prepare, Practice, Library, You; the form sheets `debates.tsx` (switcher), `new-debate.tsx`, `delete-account.tsx`, `add-link.tsx`, `new-note.tsx` and `source/[id].tsx`; and `ask.tsx`, `generate.tsx`, `case/[id].tsx`, `attack/`, `brainstorm/` and `factoids/` (each a form `index.tsx` and a document `[id].tsx`), full screen above the tabs. All are declared in the root `_layout.tsx`. `(prepare)/coming/[tool].tsx` (Flowchart) and `(practice)/soon/[tool].tsx` stand in for tools not in the app yet.
21
21
-`src/components/`: shared UI. `app-tabs.tsx` uses native tabs; `app-tabs.web.tsx` draws the mock's tab bar for the web preview.
22
22
-`src/lib/`: auth (`auth.tsx`), the Supabase client, session storage (AES key in SecureStore, ciphertext in AsyncStorage) and i18n. `debates.ts`, `settings.tsx`, `subscription.ts` and `account.ts` read and write the website's tables the way its stores do (`src/lib/stores/debate-store.ts`, `settings-store.ts`, `src/hooks/use-subscription.ts`, `src/lib/account.ts`), so the app and the website share one Current Debate and one set of settings. Change them together with the website code they mirror.
23
23
-`sources.ts` mirrors the session store's `addSource` and `removeSource` and `src/lib/source-import.ts`. The Library always shows the Current Debate, also in one-off mode, as on the website. Adding a file (the website parses files in the browser) and Scan pages are not in the app yet.
24
24
- Ask mirrors `src/lib/ai/streaming.ts` and `askChat` in `src/lib/ai/client.ts`: `ask.ts` sends the requests (plain questions stream from `ai-stream` through `expo/fetch`; with Citations, Web search, Pros/Cons or Argument map on, the whole answer comes from `ai`, because `ai-stream` refuses those options), `ai-request.ts` holds the shared POST with the website's headers, timeout and error kinds, `feature-config.ts` reads each tool's model from `user_settings.feature_configs`, `context-request.ts` builds the Current Debate context with the website's default selection and pins, and `chats.ts` saves finished exchanges to `chats` and `messages`. The SSE parser is shared in `packages/core/src/ai/sse.ts`. `markdown.ts` reads answers, because react-markdown needs the DOM.
25
25
- Generate and Attack mirror `generateCase` and `attackCase` in `src/lib/ai/client.ts` and the session store's `recordResult`: `results.ts` sends the requests through `ai-request.ts`, checks the output with the website's transform (moved to `packages/core/src/ai/generate-output.ts`), keeps researched sources in the debate's Auto-saved folder (`packages/core/src/ai/discovered-sources.ts`), saves the server's source rankings onto the Library sources a result used (`packages/core/src/ai/source-assessments.ts`, also for Ask's whole answers), says when the server shortened the input, and saves rows to `cases` and `attacks`. `motion.ts` and `motion-gate.ts` are the website's motion gate. `open-results.ts` holds results made in this session, so one-off work and failed saves still open as documents. It and the last Generate and Attack forms live in `session-memory.ts`, which the auth provider clears on every account change, including sign-out. `components/document.tsx` draws results as documents (mock 03); Brainstorm and Factoids reuse it. Export renders `export-html.ts` to a PDF with expo-print and shares it (`export.ts`); the web preview cannot print, so `export.web.ts` keeps the HTML and copied text on `window` for the screenshot script. Word export and Google Docs are not in the app.
26
-
- One-off mode is session-only and never written, as on the website. The switcher turns it on with or without a Current Debate, and `OneOffNotice` shows it on the Debate tab, Prepare, Ask, Library, Generate and Attack (through `WorkingIn`). The Debate tab, Prepare and Library still list the Current Debate's work in one-off mode, as the website's home does. Students prepare both sides of a motion, so a debate has no side: the Debate tab's In favor / Against toggle only chooses which side's work it shows, using the website's rule (`'both'` counts for either side, neutral and side-less work for neither). It starts on In favor and is never stored.
26
+
- Brainstorm and Factoids mirror `brainstorm` and `factoids` in `src/lib/ai/client.ts` and their pages, through the same `results.ts`: the brainstorm transform and the verified-factoid selection live in `packages/core/src/ai/brainstorm-output.ts` and `factoids-output.ts`, rows go to `brainstorms` and `factoids`. Brainstorm has the motion gate; Factoids, like Attack, follows the Current Debate and saves with side `neutral`. A factoid's bookmark saves it to the Current Debate's `Factoids` folder, and a search suggestion reopens the Factoids form with that query. `prepareToolHref` in `components/prepare-tools.ts` is where both tabs open a tool.
27
+
- One-off mode is session-only and never written, as on the website. The switcher turns it on with or without a Current Debate, and `OneOffNotice` shows it on the Debate tab, Prepare, Ask, Library and the Generate, Attack, Brainstorm and Factoids forms (through `WorkingIn`). The Debate tab, Prepare and Library still list the Current Debate's work in one-off mode, as the website's home does. Students prepare both sides of a motion, so a debate has no side: the Debate tab's In favor / Against toggle only chooses which side's work it shows, using the website's rule (`'both'` counts for either side, neutral and side-less work for neither). It starts on In favor and is never stored.
27
28
-`src/theme/`: colours from the mocks and the website's dark palette, Inter fonts.
28
29
-`scripts/screenshots.ts`: web-export screenshots. `scripts/render-tab-icons.ts` redraws the tab bar PNGs.
// A made-up brainstorm in the shape the model returns (Top 5), before the website's transform.
323
+
constFAKE_BRAINSTORM={
324
+
needsMoreInfo: false,
325
+
topFive: [
326
+
{rank: 1,whyTop: 'It turns a convenience debate into a health one.',idea: {id: 'a',title: 'Cleaner air for children',description: 'Traffic fumes peak at school gates; closing centres to cars cuts them where children walk.',side: 'pro',strength: 'strong',tradeoffs: ['Needs air-quality data'],relatedTo: []}},
327
+
{rank: 2,whyTop: 'Shops are the opposition’s strongest group.',idea: {id: 'b',title: 'Footfall helps local shops',description: 'People on foot stop more often than drivers passing through.',side: 'pro',strength: 'moderate',tradeoffs: ['Evidence varies by city size'],relatedTo: []}},
328
+
{rank: 3,whyTop: 'Pre-empts the fairness attack.',idea: {id: 'c',title: 'Who loses access',description: 'Carers, disabled drivers and night-shift workers rely on cars.',side: 'con',strength: 'strong',tradeoffs: [],relatedTo: []}},
329
+
{rank: 4,whyTop: 'A cheap, concrete mechanism.',idea: {id: 'd',title: 'Faster buses',description: 'Empty streets let buses keep to their timetable.',side: 'pro',strength: 'moderate',tradeoffs: [],relatedTo: []}},
330
+
{rank: 5,whyTop: 'Frames the debate on space, not cars.',idea: {id: 'e',title: 'Street space as a public good',description: 'Parking takes space that could be parks or cafés.',side: 'neutral',strength: 'weak',tradeoffs: ['Abstract for some judges'],relatedTo: []}},
331
+
],
332
+
nextSteps: ['Find one city that closed its centre and measured the air','Prepare an answer on exemptions'],
333
+
warningsAndTradeoffs: ['The footfall evidence comes from large cities.'],
334
+
};
335
+
// Made-up factoids: three verified, one unverified that the website's selection drops.
336
+
constFAKE_FACTOIDS={
337
+
factoids: [
338
+
{id: 'f1',shortClaim: 'Asthma admissions fell after a city centre closed to cars',keyFigure: '−12% in two years',context: 'A made-up city compared admissions before and after its car-free zone.',limitations: 'One city; other changes happened at the same time.',citation: {title: 'Clean Streets Review',publisher: 'Example Health Institute',date: '2024',url: 'https://example.org/clean-streets',verified: 'verified'},howToUse: 'Lead with it in the first argument.',relevanceScore: 92},
339
+
{id: 'f2',shortClaim: 'Shops in pedestrian streets report more visits',keyFigure: '+18% footfall',context: 'Counts on three streets before and after closure.',limitations: 'Weekday counts only.',citation: {title: 'Footfall Study',publisher: 'Example Retail Council',date: '2023',url: 'https://example.org/footfall',verified: 'verified'},howToUse: 'Answer the shopkeepers’ objection.',relevanceScore: 81},
340
+
{id: 'f3',shortClaim: 'Buses ran closer to their timetable',keyFigure: '4 minutes saved per trip',context: 'Average delay on routes through the centre.',limitations: 'Peak hours only.',citation: {title: 'Transit Report',publisher: 'Example Transport Board',url: 'https://example.org/transit-report',verified: 'verified'},howToUse: 'Use it for the access argument.',relevanceScore: 74},
0 commit comments