Skip to content

[feat] Scaffold the mobile web app at /m (1/12) - #5679

Open
ardaerzin wants to merge 9 commits into
mainfrom
feat/mobile-app-scaffold
Open

[feat] Scaffold the mobile web app at /m (1/12)#5679
ardaerzin wants to merge 9 commits into
mainfrom
feat/mobile-app-scaffold

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Agenta has no mobile experience. The desktop app shows a "works better on larger screens" overlay on a phone, and the agent product now has a reason to be reachable from one: a cloud agent can pause for approval while you are away from your desk.

This is the first of a 12-PR stack that adds a minimal mobile web app at /m. It contains the scaffold only. No screens, no data, nothing user-reachable yet: the app renders a placeholder, and the container that serves it does not start unless you ask for it.

What this adds

A new web/mobile workspace package: a Next.js Pages Router app with basePath: "/m" and standalone output, served behind Traefik at /m alongside the desktop app. It shares the desktop's SuperTokens cookie session because it is the same origin.

Styling comes from shadcn/ui on Tailwind v4, and the colors are not a second palette. scripts/generate-shadcn-tokens.ts reads the existing source of truth, web/oss/src/styles/theme/palette.ts, and emits src/styles/theme.generated.css (committed, checked in CI). Change a color in palette.ts and mobile follows.

Three rules are lint-enforced rather than documented, because both are easy to violate by habit:

  • No antd, no @ant-design/*, no Lexical. The app is shadcn-only.
  • No app-layer imports. @/oss/*, @agenta/oss and @agenta/ee are banned; data comes from the @agenta/* packages.
  • One component per file, exported with a name matching the file.

The dev compose service is opt-in behind --with-mobile. It originally rode the existing with-web profile and started automatically, but a live run showed the second Next dev server pushing an 8GB Docker VM into OOM-killing the main web app's first Turbopack compile (dmesg-confirmed next-server kills at ~4.5GB RSS). Running both dev servers wants a 12GB+ VM, so it does not start unless you opt in.

Tests / notes

  • pnpm --filter @agenta/mobile types:check and lint (which includes the generated-token freshness check) pass.
  • Deployed to the local EE dev stack and confirmed /m serves through Traefik while the desktop app keeps working at /.
  • The production gh Dockerfile is added here but not wired into the release build. That happens in a later PR in the stack, so this one cannot affect production images.
  • The desktop app is untouched apart from three lines: the two dev Dockerfiles copy the new workspace manifest, and entrypoint.sh mirrors __env.js into the mobile app's public dir when that directory exists.

What to QA

Nothing user-visible ships here. If you want to see it run:

  • bash ./hosting/docker-compose/run.sh --ee --dev --with-mobile --build, then open http://localhost/m. You get a placeholder page.
  • Regression: open http://localhost/ in the same browser. The desktop app loads and your session still works.
  • Regression: run the same command without --with-mobile. The web-mobile container does not start and the desktop app is unaffected.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. Feature Request New feature or request Frontend labels Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 4, 2026 7:27pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an initial mobile web app available at /m.
    • Added a themed mobile scaffold with light/dark mode support, reusable buttons, loading placeholders, and responsive styling.
    • Added smooth motion patterns that respect reduced-motion preferences.
    • Added development and production container support for the mobile app.
  • Documentation

    • Added mobile architecture, styling, motion, and development guidance.

Walkthrough

The pull request adds a mobile Next.js workspace under web/mobile, with shared UI, theme, motion, and runtime foundations. It also adds workspace tasks, Docker images, Compose services, runtime configuration handling, and mobile development guidance.

Changes

Mobile application foundation

Layer / File(s) Summary
Mobile conventions and workflow
.agents/skills/mobile-*, .claude/skills/mobile-*, web/mobile/AGENTS.md, web/mobile/CLAUDE.md
Defines mobile structure, state handling, motion, theming, shadcn/ui usage, package restrictions, and development commands.
Mobile workspace and build configuration
web/mobile/package.json, web/mobile/next.config.ts, web/mobile/eslint.config.mjs, web/mobile/tsconfig.json, web/mobile/components.json, web/mobile/postcss.config.mjs, web/mobile/next-env.d.ts, web/mobile/.gitignore, web/package.json, web/pnpm-workspace.yaml, web/turbo.json
Adds the mobile package, workspace scripts, Turbo tasks, Next.js settings, TypeScript settings, lint rules, PostCSS, shadcn metadata, and generated-file exclusions.
Mobile UI, theme, and runtime scaffold
web/mobile/scripts/generate-shadcn-tokens.ts, web/mobile/src/styles/globals.css, web/mobile/src/lib/*, web/mobile/src/components/ui/*, web/mobile/src/pages/*
Adds palette-based theme generation, light and dark styles, reduced-motion presets, shared UI primitives, theme initialization, runtime environment loading, and the placeholder home route.
Development and production container integration
hosting/docker-compose/{ee,oss}/docker-compose.dev.yml, web/{ee,oss}/docker/Dockerfile.dev, web/mobile/docker/Dockerfile.gh, web/entrypoint.sh
Adds mobile development services, cache volumes, Docker image contents, a production multi-stage image, /m routing, and conditional runtime configuration copying.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the mobile web app scaffold and its /m route.
Description check ✅ Passed The description directly explains the mobile app scaffold, routing, styling, development service, validation, and current scope.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mobile-app-scaffold

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.agents/skills/mobile-app-structure/SKILL.md (1)

52-53: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Run filtered mobile commands from web/.

Both skill files omit the workspace directory for pnpm --filter commands. Add the directory in both instructions.

  • .agents/skills/mobile-app-structure/SKILL.md#L52-L53: Prefix both filtered commands with From web/, or use an explicit --dir web form.
  • .agents/skills/mobile-shadcn-conventions/SKILL.md#L35-L35: Prefix token generation with From web/; keep web/mobile/ for the shadcn CLI instructions.

Based on learnings, run mobile commands from the documented web/ workspace. As per path instructions, web/mobile/AGENTS.md documents commands from web/.

Source: Learnings

🧹 Nitpick comments (2)
.agents/skills/mobile-app-structure/SKILL.md (1)

39-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify the data boundary.

This rule permits “thin fetchers in lib/”. web/mobile/AGENTS.md says data and state come from @agenta/* packages only. Confirm that a lib/ fetcher may only wrap an @agenta/* client, then state that restriction here.

Proposed clarification
- components get data via hooks from `@agenta/*` packages or thin fetchers in `lib/`.
+ components get data via hooks from `@agenta/*` packages. Thin fetchers in
+ `lib/` may only wrap those package clients.

As per path instructions, web/mobile/AGENTS.md limits data and state to @agenta/* packages.

web/mobile/eslint.config.mjs (1)

22-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the plugin's recommended preset instead of two manually-picked rules.

eslint-plugin-react-hooks 7.1.1 bundles compiler-aware rules (purity, refs, set-state-in-effect, immutability, static-components, and more) in its recommended/recommended-latest flat presets, enabled by default. Manually setting only rules-of-hooks and exhaustive-deps skips all of these.

Spread the preset so the mobile app gets full React 19/compiler-aware Hooks linting:

♻️ Proposed refactor
 const config = [
     eslint.configs.recommended,
     ...tseslint.configs.recommended,
     ...tseslint.configs.stylistic,
+    reactHooks.configs.flat.recommended,
     {
         plugins: {
             import: importPlugin,
             "react-hooks": reactHooks,
         },
         rules: {
             ...
-            "react-hooks/rules-of-hooks": "error",
-            "react-hooks/exhaustive-deps": "warn",
             "`@typescript-eslint/no-explicit-any`": "error",

Ask on the web to confirm the exact rule set shipped in reactHooks.configs.flat.recommended for the pinned ^7.1.1 version before applying, since presets evolve between minor releases.

Also applies to: 60-61


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e7a7cb19-8be6-4367-a72a-4f487fd490c9

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9206e and 6534e92.

⛔ Files ignored due to path filters (2)
  • web/mobile/src/styles/theme.generated.css is excluded by !**/*.generated.*
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .agents/skills/mobile-app-structure/SKILL.md
  • .agents/skills/mobile-motion-patterns/SKILL.md
  • .agents/skills/mobile-shadcn-conventions/SKILL.md
  • .claude/skills/mobile-app-structure
  • .claude/skills/mobile-motion-patterns
  • .claude/skills/mobile-shadcn-conventions
  • hosting/docker-compose/ee/docker-compose.dev.yml
  • hosting/docker-compose/oss/docker-compose.dev.yml
  • web/ee/docker/Dockerfile.dev
  • web/entrypoint.sh
  • web/mobile/.gitignore
  • web/mobile/AGENTS.md
  • web/mobile/CLAUDE.md
  • web/mobile/components.json
  • web/mobile/docker/Dockerfile.gh
  • web/mobile/eslint.config.mjs
  • web/mobile/next-env.d.ts
  • web/mobile/next.config.ts
  • web/mobile/package.json
  • web/mobile/postcss.config.mjs
  • web/mobile/public/.gitkeep
  • web/mobile/scripts/generate-shadcn-tokens.ts
  • web/mobile/src/components/ui/button.tsx
  • web/mobile/src/components/ui/skeleton.tsx
  • web/mobile/src/lib/motion/presets.ts
  • web/mobile/src/lib/utils.ts
  • web/mobile/src/pages/_app.tsx
  • web/mobile/src/pages/_document.tsx
  • web/mobile/src/pages/index.tsx
  • web/mobile/src/styles/globals.css
  • web/mobile/tsconfig.json
  • web/oss/docker/Dockerfile.dev
  • web/package.json
  • web/pnpm-workspace.yaml
  • web/turbo.json

Comment thread hosting/docker-compose/ee/docker-compose.dev.yml
Comment thread web/mobile/docker/Dockerfile.gh
Comment thread web/mobile/next.config.ts
output: "standalone",
reactStrictMode: true,
pageExtensions: ["ts", "tsx"],
productionBrowserSourceMaps: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg '(^|/)web/mobile/next.config\.ts$|(^|/)package\.json$|(^|/)pnpm-lock\.yaml$' || true

echo "== next config =="
cat -n web/mobile/next.config.ts

echo "== package scripts/dependencies relevant =="
if [ -f web/mobile/package.json ]; then cat -n web/mobile/package.json; fi
if [ -f web/package.json ]; then cat -n web/package.json; fi

echo "== source map settings in repo =="
rg -n "productionBrowserSourceMaps|next-sourcemap|source maps|sourcemaps|Production" web mobile .github 2>/dev/null || true

Repository: Agenta-AI/agenta

Length of output: 14562


Disable production browser source maps unless authorized tracking requires them.

Setting productionBrowserSourceMaps: true embeds source comments in client-ready JavaScript and creates source map artifacts, which can expose implementation details. If you need source maps for error tracking, upload them only to an authorized error tracking service and keep this option disabled for client delivery.

Proposed fix
-    productionBrowserSourceMaps: true,
+    productionBrowserSourceMaps: false,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
productionBrowserSourceMaps: true,
productionBrowserSourceMaps: false,

@ardaerzin
ardaerzin force-pushed the feat/mobile-app-scaffold branch from 6534e92 to 39a672d Compare August 3, 2026 10:46
@ardaerzin

Copy link
Copy Markdown
Contributor Author

Verified all three against the code. Two were real and are fixed at the root; one I am not taking.

1. Greedy PathPrefix(/m) — real, fixed. Confirmed against the compose files: the rule was PathPrefix(/m) and the desktop router is PathPrefix(/), so /mfoo would have reached the mobile container. Now Path(/m) || PathPrefix(/m/) in both the ee and oss dev files, with the priority comment corrected (the new rule is still longer than the catch-all, so it still wins on rule length). No production compose file carried the rule, so the change is dev-only.

2. Missing edition public dirs in the gh image — real, and it exposed a stack problem. The fix existed on the full branch but sat 28 commits later, which put it in PR 4 of this stack. So this PR really did ship an image whose container exits on start, and no reviewer of this PR could have known PR 4 repairs it.

I fixed the cause rather than appending a patch: the repair is now folded into the commit that introduced the Dockerfile, so it never existed as a broken state. I audited the rest of the branch for the same shape (a later lane repairing an earlier lane) and this was the only case that shipped a genuinely broken state; the others are ordinary iteration on files an earlier lane introduced.

3. productionBrowserSourceMaps — not taking this one. web/oss/next.config.ts:18 sets the same flag. Mobile is matching the app, not introducing a policy. Turning it off here alone would leave the two apps inconsistent for no gain, and if the repo wants to stop publishing browser source maps that is a deliberate decision for both apps in its own PR.

Also rebased onto current main, so this is no longer behind.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-5679.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-5679-f67bfff
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-08-04T19:42:52.116Z

@ardaerzin

Copy link
Copy Markdown
Contributor Author

The four failing acceptance checks here are not from this PR. They are the repo-wide preview outage, and I traced the mechanism in case it helps whoever owns #5650.

What fails: every acceptance job dies in oss/tests/pytest/utils/accounts.py:36 with Expected 200, got 401: {"detail":{"message":"Unauthorized"}} — the harness cannot mint an ephemeral account against /admin/simple/accounts/, so nothing downstream runs.

Not specific to this stack. The 14 - check PR preview workflow has zero successes in its last 60 runs, and three unrelated non-draft PRs fail identically today, including wp4-clone-cutover — the branch doing the clone-mode cutover itself. The PRs that look green are drafts: the workflow gates every job on !github.event.pull_request.draft, so it never runs for them.

Mechanism. RAILWAY_PREVIEW_MODE was flipped to clone at 07:59 today, and every failure starts after that. The two modes do not carry secrets the same way:

  • Legacy (43-railway-deploy.yml, "Deploy preview environment", if: inputs.mode != 'clone') passes the full secret set into the deploy script, including AGENTA_AUTH_KEY: ${{ secrets.AGENTA_TEST_OSS_AUTH_KEY }}, which configure.sh then applies to the services.
  • Clone (same file, "Verify clone preview environment", if: inputs.mode == 'clone') passes only PR_NUMBER and IMAGE_TAG. It verifies an environment that 41-railway-setup.yml created via environmentCreate ... sourceEnvironmentId ... skipInitialDeploys, and neither step applies AGENTA_AUTH_KEY.

So the cloned environment runs with whatever the template environment carries, while 44-railway-tests.yml authenticates with secrets.AGENTA_TEST_OSS_AUTH_KEY. When those differ, every admin call is 401 — exactly the symptom.

Where a fix would go: either have the clone path apply the same secret set the legacy deploy does (the configure.sh call already accepts AGENTA_AUTH_KEY), or confirm environmentCreate copies the template's service variables and that the template holds the same key the tests use.

I have not changed any of it. It is not this stack's code, it is blocking other people's PRs too, and I cannot exercise Railway plumbing locally to verify a fix.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

Production browser source maps: not taking here, and it is not a mobile decision.

productionBrowserSourceMaps: true is set in web/mobile/next.config.ts because it is set in web/oss/next.config.ts. The mobile app mirrors the desktop app's build config rather than inventing its own. Both serve the same origin, so turning it off for /m alone would not reduce what a deployment exposes; it would only make the two apps disagree.

If the repo wants source maps off in production, that is one change to both configs plus a decision about how errors get symbolicated afterward. That belongs to whoever owns the OSS build config, not to the PR that scaffolds a second Next app.

Worth noting the finding is about disclosure, not a vulnerability: the maps expose the same TypeScript already published in this open-source repo.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a8594b8-41d7-4d50-8b96-5d72966c7c9d

📥 Commits

Reviewing files that changed from the base of the PR and between a8ad264 and b0ee688.

⛔ Files ignored due to path filters (2)
  • web/mobile/src/styles/theme.generated.css is excluded by !**/*.generated.*
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .agents/skills/mobile-app-structure/SKILL.md
  • .agents/skills/mobile-motion-patterns/SKILL.md
  • .agents/skills/mobile-shadcn-conventions/SKILL.md
  • .claude/skills/mobile-app-structure
  • .claude/skills/mobile-motion-patterns
  • .claude/skills/mobile-shadcn-conventions
  • hosting/docker-compose/ee/docker-compose.dev.yml
  • hosting/docker-compose/oss/docker-compose.dev.yml
  • web/ee/docker/Dockerfile.dev
  • web/entrypoint.sh
  • web/mobile/.gitignore
  • web/mobile/AGENTS.md
  • web/mobile/CLAUDE.md
  • web/mobile/components.json
  • web/mobile/docker/Dockerfile.gh
  • web/mobile/eslint.config.mjs
  • web/mobile/next-env.d.ts
  • web/mobile/next.config.ts
  • web/mobile/package.json
  • web/mobile/postcss.config.mjs
  • web/mobile/public/.gitkeep
  • web/mobile/scripts/generate-shadcn-tokens.ts
  • web/mobile/src/components/ui/button.tsx
  • web/mobile/src/components/ui/skeleton.tsx
  • web/mobile/src/lib/motion/presets.ts
  • web/mobile/src/lib/utils.ts
  • web/mobile/src/pages/_app.tsx
  • web/mobile/src/pages/_document.tsx
  • web/mobile/src/pages/index.tsx
  • web/mobile/src/styles/globals.css
  • web/mobile/tsconfig.json
  • web/oss/docker/Dockerfile.dev
  • web/package.json
  • web/pnpm-workspace.yaml
  • web/turbo.json
🚧 Files skipped from review as they are similar to previous changes (31)
  • web/entrypoint.sh
  • web/mobile/CLAUDE.md
  • .claude/skills/mobile-app-structure
  • web/pnpm-workspace.yaml
  • web/oss/docker/Dockerfile.dev
  • web/turbo.json
  • web/mobile/src/lib/utils.ts
  • hosting/docker-compose/oss/docker-compose.dev.yml
  • web/mobile/.gitignore
  • web/mobile/package.json
  • .agents/skills/mobile-motion-patterns/SKILL.md
  • web/mobile/src/pages/_app.tsx
  • web/mobile/src/pages/index.tsx
  • web/package.json
  • web/mobile/next.config.ts
  • web/mobile/scripts/generate-shadcn-tokens.ts
  • hosting/docker-compose/ee/docker-compose.dev.yml
  • .agents/skills/mobile-shadcn-conventions/SKILL.md
  • web/ee/docker/Dockerfile.dev
  • .agents/skills/mobile-app-structure/SKILL.md
  • .claude/skills/mobile-motion-patterns
  • web/mobile/src/components/ui/skeleton.tsx
  • web/mobile/docker/Dockerfile.gh
  • web/mobile/src/components/ui/button.tsx
  • web/mobile/postcss.config.mjs
  • web/mobile/tsconfig.json
  • .claude/skills/mobile-shadcn-conventions
  • web/mobile/next-env.d.ts
  • web/mobile/components.json
  • web/mobile/src/lib/motion/presets.ts
  • web/mobile/AGENTS.md

Comment on lines +99 to +115
...(includePrettierRule
? {
"prettier/prettier": [
"error",
{
printWidth: 100,
tabWidth: 4,
useTabs: false,
semi: false,
bracketSpacing: false,
},
],
}
: {}),
},
},
...(includePrettierRule ? [eslintPluginPrettier] : []),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Confirm that the recommended config currently follows the custom rule.
rg -n -C 3 '"prettier/prettier"|eslintPluginPrettier' web/mobile/eslint.config.mjs

Repository: Agenta-AI/agenta

Length of output: 887


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- file excerpt ---\n'
sed -n '1,150p' web/mobile/eslint.config.mjs

printf '\n--- lint/config package versions or lock entries ---\n'
if [ -f web/package.json ]; then
  node -e "const p=require('./web/package.json'); console.log({eslint:p.dependencies?.eslint||p.devDependencies?.eslint, eslintPluginPrettier:p.dependencies?.['eslint-plugin-prettier']||p.devDependencies?.['eslint-plugin-prettier']})"
fi
if [ -f pnpm-lock.yaml ]; then
  rg -n "eslint(@|/)|eslint-plugin-prettier" pnpm-lock.yaml | head -80
fi

Repository: Agenta-AI/agenta

Length of output: 245


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- file excerpt ---'
sed -n '1,150p' web/mobile/eslint.config.mjs

printf '%s\n' ''
printf '%s\n' '--- lint/config package versions or lock entries ---'
if [ -f web/package.json ]; then
  node -e "const p=require('./web/package.json'); console.log(JSON.stringify({eslint:p.dependencies?.eslint||p.devDependencies?.eslint, eslintPluginPrettier:p.dependencies?.['eslint-plugin-prettier']||p.devDependencies?.['eslint-plugin-prettier']}, null, 2))"
fi
if [ -f pnpm-lock.yaml ]; then
  rg -n "eslint(@|/)|eslint-plugin-prettier" pnpm-lock.yaml | head -80
fi

printf '%s\n' ''
printf '%s\n' '--- static ordering check ---'
python3 - <<'PY'
from pathlib import Path
text = Path('web/mobile/eslint.config.mjs').read_text()
line = 0
events = []
for i, ch in enumerate(text, 1):
    if ch == '\n':
        line += 1
    if '"prettier/prettier"' in text[max(0, text.rfind('\n',0,i-1)):i]:
        events.append(('prettier/rule', i))
    if 'eslintPluginPrettier' in text[i:i+100]:
        events.append(('eslintPluginPrettier', i))
for event in events:
    print(event)

# Find first line of each relevant token.
for token in ['eslintPluginPrettier', '"prettier/prettier"']:
    idx = text.find(token)
    print(token, idx, text[:idx].count('\n') + 1 if idx >= 0 else None)
PY

Repository: Agenta-AI/agenta

Length of output: 10006


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- resolve recommended preset contents ---'
node - <<'JS'
try {
  const preset = require('eslint-plugin-prettier/recommended')
  console.log(JSON.stringify(preset, (key, value) => {
    if (key === 'meta' && typeof value === 'object' && value !== null) return '[meta]'
    if (key === 'configs') return '[configs]'
    return value
  }, 2))
} catch (err) {
  console.log(err && err.message ? err.message : err)
}
JS

Repository: Agenta-AI/agenta

Length of output: 298


🌐 Web query:

eslint-plugin-prettier recommended preset prettier/prettier rule options

💡 Result:

The eslint-plugin-prettier provides a recommended configuration, plugin:prettier/recommended, which simplifies setup by including both the plugin itself and eslint-config-prettier [1][2][3]. This preset performs three main actions: 1. Enables the prettier/prettier rule, which reports formatting issues as ESLint errors [1][3]. 2. Disables specific ESLint rules that are known to conflict with Prettier (e.g., arrow-body-style and prefer-arrow-callback) [1][3]. 3. Enables eslint-config-prettier to turn off other ESLint rules that may conflict with Prettier's formatting [1][4][3]. The prettier/prettier rule itself accepts two optional arguments [2][3]: First Option: An object representing Prettier configuration options (e.g., {"parser": "flow"}). These options override any settings defined in your.prettierrc file [2][3]. Second Option: An object containing specific plugin-level settings: - usePrettierrc (default: true): When set to false, it prevents the plugin from loading your Prettier configuration file [2][3]. - fileInfoOptions: Options passed to Prettier's getFileInfo function, which determines if a file should be formatted (useful, for example, to include node_modules) [2][3]. Example configuration: { "rules": { "prettier/prettier": [ "error", { "singleQuote": true }, { "usePrettierrc": false } ] } } While using a plugin to run Prettier as a linter rule was common practice in the past, the Prettier maintainers now generally recommend running Prettier directly via the CLI (e.g., prettier --check.) or via editor integration, as running it as an ESLint rule can be slower and cause unnecessary editor noise [5].

Citations:


Do not include the shared mobile ESLint config in the review.

The mobile config must not import or mirror web/packages/eslint.config.mjs; this creates a circular/shared ESLint config instead of an isolated mobile config.

Listing `inputs` for `@agenta/mobile#build` replaces Turbo's default file selection rather than
adding to it, so the task hashed only `src`, `public` and four config files. `package.json` was
not among them: a dependency bump changed nothing the cache could see, and CI would serve a build
made against the old dependency tree.

`$TURBO_DEFAULT$` restores every tracked file in the package as the base, with tests and
markdown removed since neither reaches the bundle. Verified by hash: editing
`web/mobile/package.json` moves `@agenta/mobile#build` from f7a97e16 to 9aa1f06c, where before it
did not move at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Request New feature or request Frontend size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant