Skip to content

Android app: native screens for the whole CRM, plus web and API support - #59

Merged
Axoineo merged 4 commits into
mainfrom
feat/android-app
Nov 19, 2026
Merged

Axoineo merged 4 commits into
mainfrom
feat/android-app

Conversation

@Axoineo

@Axoineo Axoineo commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What this is

The Android app's v1.1 work, saved from local and brought up to date with main:

  • App (dikho-mobile): native sign-in that owns the session (ADR 0013), Clients, Leads, Sales and Purchase orders, Vendors, Users, Settings, Live Assist on phones (ADR 0014), the WhatsApp inbox, dashboard, campaigns, contacts and templates, Phone contacts, and the whole Email Hub (overview, inbox, analytics, campaigns, templates, consent, Email settings). Every drawer entry is now a native screen. Google's mailbox connection opens in the phone's browser and its return is finished by the app.
  • Web: hands those routes to the app when it runs inside it (older app versions keep the web pages), the WhatsApp analytics dashboard, contact import review, the tax invoice page, Live Assist picture frames.
  • API: a retried campaign send reuses its campaign (request id), send-batch takes the template from the campaign row, WhatsApp analytics with a daily cache, inbox paging for the app.

The merge with main is described in its commit message (main's contact import and file-first wizard kept; this branch's request id, paging and send-batch rule kept).

Must happen in this order

  1. D1 migration 0013_android_inbox.sql on the remote database (owner runs it). The API reads its tables.
  2. Deploy the API (npm run deploy:api).
  3. Merge this PR, which deploys the website through Cloudflare Pages.
  4. Only then build and publish an APK. The production signing key does not exist yet; public/.well-known/assetlinks.json needs its fingerprint for the Gmail return to open the app on Android 12+.

Checked

  • npm run check after the merge: lint, 343 tests, build, secret scan, all passing.
  • App: flutter analyze clean, 392 tests passing (main changed nothing under dikho-mobile).
  • Android 16 emulator against the local fake backend: email 10 of 10, settings 6 of 6, earlier assist 7 of 7, signin 6 of 6, orders 6 of 6.

Not checked

  • No real phone, no production data, no real WhatsApp, email or Google sends.
  • Routes, RLS and Storage have no automated coverage.
  • The older WebView scenarios (native, web, files, layout, walk, upgrade) still open web pages from the drawer, which no longer has any; they need rewriting when the WebView is removed.

🤖 Generated with Claude Code

Axoineo and others added 3 commits November 19, 2026 13:12
…API support

Saved from local work so it is not lost; not yet reviewed as a PR.

Android app (dikho-mobile): native sign-in owning the session, Clients, Leads,
Sales and Purchase orders, Vendors, Users, Settings, Live Assist on phones,
the WhatsApp inbox, dashboard, campaigns, contacts and templates, Phone
contacts, and the whole Email Hub (inbox, overview, analytics, campaigns,
templates, consent, Email settings with Google's return finished in the app).
Every drawer entry is now a native screen.

Web and API: page handoffs to native screens, the shell bridge, WhatsApp
analytics, campaign send request ids, contact import, the tax invoice page,
Live Assist picture frames. D1 migration 0013 is NOT applied.

Docs: ADRs 0012 to 0014, ANDROID.md, the v1.1 task log, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved:
- Contact import (lib, review screen, tests): main's finished version.
- Campaign wizard: main's file-first wizard, plus this branch's request id on
  the first Send so a retried send stays one campaign.
- Campaigns API: this branch's request id handling, and send-batch taking the
  template from the campaign row rather than the request.
- WhatsApp Contacts: this branch's paging as you scroll (main has none).
- CHANGELOG and TESTING: both sides' entries, repeats removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T08:08:34.812725Z 5eb58b5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying dikho with  Cloudflare Pages  Cloudflare Pages

Latest commit: b34bafc
Status: ✅  Deploy successful!
Preview URL: https://075eed0d.dikho.pages.dev
Branch Preview URL: https://feat-android-app.dikho.pages.dev

View logs

….2, vite 8.3.8, postcss-selector-parser 6.1.6, source-map-js 1.2.3

Replaces Dependabot PRs #56, #57, #58, #32, #30 and #27 with one tested change.
npm audit --omit=dev: 0 vulnerabilities; npm run check passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5eb58b5743

ℹ️ 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".


const prepared = await prepareTemplate(c, choice)
if (prepared.refusal) return prepared.refusal
if (existing && await sentTemplateRecently(db, existing.id, choice.name)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Claim direct sends before calling Meta

If two staff send the same template to a new phone before either Meta call returns, both requests can find no existing conversation, so this duplicate check is skipped. The conversation is created only after Meta accepts a send, allowing both calls to send and bill the number despite the two-minute duplicate check. Add an atomic per-phone/template claim before sending.

AGENTS.md reference: src/api/AGENTS.md:L33-L33

Useful? React with 👍 / 👎.

Comment on lines +518 to +519
const earlier = campaign ? null : await c.env.DB.prepare('SELECT id FROM campaigns WHERE request_id = ?').bind(requestId).first()
const campaignId = campaign?.id ?? earlier?.id

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor recorded halts on initial-send retries

When the first /send batch hits a campaign-wide Meta halt and the response is lost, postWithRetry replays the same requestId; this branch reuses the campaign but falls through to claimRecipients without checking recordedHalt(). finishBatch() deleted claims for recipients not attempted before the halt, so the replay can reclaim them and issue more messages even though the halt says to stop (e.g. 131048). Return the stored halted response or check the recorded halt before sending a retried initial batch.

AGENTS.md reference: src/api/AGENTS.md:L33-L33

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant