Repository navigation
Fix agent opening on profile - #1218
Conversation
WalkthroughAdds ignore rules for Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as Mobile User
participant App as Web App
participant Dock as Docked.handleReady
participant Panels as Panels Manager
participant Chat as Chat Panel
User->>App: open app
App->>Dock: handleReady()
Note over Dock: Mobile-specific ordering & activation
Dock->>Panels: compute orderedTabs (non-chat first)
Dock->>Panels: for each tab -> setActive(id)?
alt no active tabs
Dock->>Panels: get("chat")?
Panels-->>Chat: activate (optional)
end
Dock->>Panels: setOpenPanels(initialPanels)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (1 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing touches
🧪 Generate unit tests
Comment |
Deploying chat with
|
| Latest commit: |
4adfc73
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://613ce8a7.chat-46r.pages.dev |
| Branch Preview URL: | https://gui-fix-mobile-agent-chat.chat-46r.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/src/components/dock/index.tsx (1)
168-175: Bug: Set.prototype.isSubsetOf doesn’t exist; equality always throwsThis breaks panel tracking on layout changes.
-const equals = (a: Set<string>, b: Set<string>) => { - if (a.size !== b.size) { - return false; - } - - return a.isSubsetOf(b) && b.isSubsetOf(a); -}; +const equals = (a: Set<string>, b: Set<string>) => { + if (a.size !== b.size) return false; + for (const v of a) { + if (!b.has(v)) return false; + } + return true; +};
🧹 Nitpick comments (6)
.cursorindexingignore (1)
2-3: Scope the ignore pattern to repo root for precisionAnchoring avoids accidentally ignoring nested .specstory folders outside the root.
- .specstory/** + /.specstory/**apps/web/index.css (2)
201-205: Add momentum scrolling on iOS SafariSmoother horizontal scroll on mobile.
.dv-tabs-container .dv-scrollable { overflow-x: auto; + -webkit-overflow-scrolling: touch; }
107-110: Duplicate rule for .one-tab .dv-scrollableSame rule appears twice; keep one.
- .one-tab .dv-scrollable { - @apply grow-0!; - }Also applies to: 198-200
apps/web/src/components/dock/index.tsx (2)
150-159: Avoid Array.prototype.findLast for wider browser supportDockview runs in browsers where findLast may be missing.
- const targetGroup = api.groups.findLast((group) => !group.locked); + const targetGroup = + // Safari ≤16 fallback: prefer last unlocked group + (api.groups as any)?.findLast?.((g: any) => !g.locked) ?? + [...(api.groups as any[])].reverse().find((g: any) => !g.locked);If you target only modern browsers, feel free to skip. Otherwise, confirm your minimum browser matrix.
262-284: Remove ts-expect-error by typing the event listener correctlyKeeps strictness without suppressions.
- const handleMessage = (event: CustomEvent<Message>) => { - const { type, payload } = event.detail; + const handleMessage = (evt: Event) => { + const { type, payload } = (evt as CustomEvent<Message>).detail; const panel = api.getPanel(payload.id); if (panel) { if (type === "toggle") { panel.api.close(); } else if (type === "open") { panel.api.updateParameters(payload.params || {}); panel.api.setActive(); } } else { addPanel(payload, api, isMobile); } }; - - // @ts-expect-error - I don't really know how to properly type this - channel.addEventListener("message", handleMessage); + channel.addEventListener("message", handleMessage); return () => { - // @ts-expect-error - I don't really know how to properly type this - channel.removeEventListener("message", handleMessage); + channel.removeEventListener("message", handleMessage); };apps/web/vite.config.ts (1)
27-27: Gate 0.0.0.0 binding via env to reduce accidental exposureKeeps convenience while avoiding unintended LAN exposure.
- server: { host: "0.0.0.0", port: 3000, allowedHosts: [".deco.host"] }, + server: { + host: process.env.VITE_DEV_HOST ?? "0.0.0.0", + port: Number(process.env.VITE_DEV_PORT ?? 3000), + allowedHosts: [".deco.host"], + },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.cursorindexingignore(1 hunks).gitignore(1 hunks)apps/web/index.css(1 hunks)apps/web/src/components/dock/index.tsx(1 hunks)apps/web/vite.config.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
apps/web/**
📄 CodeRabbit inference engine (.cursor/rules/structure.mdc)
Place the main application UI (Vite SPA) under /apps/web
Files:
apps/web/index.cssapps/web/src/components/dock/index.tsxapps/web/vite.config.ts
{apps/web,packages/ui}/**/*.{tsx,jsx,css}
📄 CodeRabbit inference engine (.cursor/rules/structure.mdc)
Use Tailwind CSS v4 for styling
Files:
apps/web/index.cssapps/web/src/components/dock/index.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/data-flow.mdc)
**/*.{ts,tsx}: MCP tools must use Zod schemas for input and, when applicable, output validation
Register tools with server.registerTool providing description, inputSchema.shape, and optional outputSchema.shape
In every MCP tool handler, perform authorization checks first and then call context.resourceAccess.grant() before business logic
Name tools using the {RESOURCE}_{ACTION} pattern (e.g., AGENTS_CREATE, THREADS_LIST)
Group related tools into typed collections (e.g., GLOBAL_TOOLS, WORKSPACE_TOOLS) and export them as const
Always check workspace/team access before executing operations that touch workspace resources
Return proper authorization errors and handle forbidden operations explicitly
**/*.{ts,tsx}: Use functional and declarative programming patterns; avoid classes
Favor iteration and modularization to adhere to DRY and avoid duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Organize files so each file contains only related content (components, subcomponents, helpers, static content, types)
Favor named exports for functions
Prefer interfaces over types for object shapes
Avoid enums; use maps instead for better type safety and flexibility
Use the function keyword for pure functions to benefit from hoisting and clarity
Files:
apps/web/src/components/dock/index.tsxapps/web/vite.config.ts
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/data-flow.mdc)
**/*.tsx: Use the shared KEYS object to construct consistent React Query keys
Use useSuspenseQuery for critical data fetching hooks
Implement optimistic updates for mutations and provide rollback on error via onMutate/onError
After successful mutations, update relevant caches with setQueryData (e.g., entity detail and list keys)
Leverage React Query’s built-in request deduplication instead of manual throttling
Use parallel queries where appropriate to reduce total load time
**/*.tsx: Use functional React components with TypeScript interfaces
Prefer using UI components from @deco/ui (packages/ui) instead of custom duplicates
Memoize expensive computations in components using useMemo
Memoize objects and arrays (e.g., defaultValues) to keep stable references
Use useDeferredValue for search inputs to keep typing responsive
Follow MCP data-access patterns (e.g., useAgents, useIntegrations) with proper loading/error states
Always use design-system form components from @deco/ui when building forms
Prefer react-hook-form with schema validation (e.g., zod) over useState for form state
Avoid prop drilling in forms; share via context/provider pattern
Apply Single Responsibility Principle: split monolithic components into focused subcomponents
Design for composability and reusability of UI components
In hooks’ dependency arrays, ensure stable references; avoid inline object/array/function literals
Memoize options/objects used in dependencies (e.g., via useMemo)
Handle loading, error, and empty states consistently for data-driven views
Extract complex conditional/rendering logic into components instead of IIFEs inside JSX
Files:
apps/web/src/components/dock/index.tsx
{apps/web,packages/ui}/**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/structure.mdc)
Build UI components with React 19
Files:
apps/web/src/components/dock/index.tsx
apps/web/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (apps/web/.cursor/rules/posthog-integration.mdc)
apps/web/**/*.{js,jsx,ts,tsx}: Use each feature flag in as few places as possible; if a flag must appear at multiple callsites, explicitly flag this for careful developer review
Gate any flag-dependent code behind checks that verify the flag’s values are valid and expected
If a custom person or event property is referenced in two or more files or at two or more callsites in the same file, centralize the keys in an enum (TS) or const object (JS)
Files:
apps/web/src/components/dock/index.tsxapps/web/vite.config.ts
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/.cursor/rules/posthog-integration.mdc)
In TypeScript, store feature flag names in an enum with members written UPPERCASE_WITH_UNDERSCORE and use a consistent naming convention
Files:
apps/web/src/components/dock/index.tsxapps/web/vite.config.ts
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/data-flow.mdc)
Log authorization failures to aid debugging and auditing
Files:
apps/web/vite.config.ts
apps/web/vite.config.ts
📄 CodeRabbit inference engine (.cursor/rules/structure.mdc)
Configure and maintain the Vite build setup for the web app in apps/web/vite.config.ts
Files:
apps/web/vite.config.ts
🧠 Learnings (1)
📚 Learning: 2025-09-02T13:58:26.946Z
Learnt from: CR
PR: deco-cx/chat#0
File: .cursor/rules/structure.mdc:0-0
Timestamp: 2025-09-02T13:58:26.946Z
Learning: Applies to apps/web/vite.config.ts : Configure and maintain the Vite build setup for the web app in apps/web/vite.config.ts
Applied to files:
apps/web/vite.config.ts
🔇 Additional comments (2)
apps/web/index.css (1)
201-205: LGTM: horizontal scrolling enabled for tabsThis should improve mobile tab navigation.
.gitignore (1)
42-43: LGTM: ignore SpecStory artifactsNo runtime impact; helpful to keep the repo clean.
Stale editor config from 2024 (last touched in #1218); the paths it excluded no longer exist in the repo.
…5579) * chore: delete the dead auth-config.json tail and the stray EFS RFC Auth moved to AUTH_* environment variables (auth-env.ts) — core/config.ts even warns that a config-file 'auth' key is ignored. Nothing reads auth-config.json anymore, but its tail survived everywhere: - auth-config.json at the repo root: snuck in via #5575 (a sandbox-daemon PR), tracked ever since, read by nothing. Deleted. - apps/api/auth-config.example.json, tests/resilience/auth-config.test.json: referenced by nothing. Deleted. - .github/workflows/e2e.yml wrote the file before every run — for nothing. Step deleted. - .cursor/worktrees.json copied a file that does not exist. Line deleted. - apps/api/src/auth/index.ts's header claimed the exact opposite of reality ('file-based, not environment variables'). Fixed, with the .gitignore entry, the AGENTS.md config line, and config.example.json's pointer. - deploy/helm/studio/README.md documented a configmap-auth.yaml template that does not exist in templates/. Section removed, following ones renumbered. efs-spec.md (an L2 golden-cache RFC draft) also landed at the root in #5575. Deleted — it was never referenced by anything in the repo. Not touched: decostudio-alias/ stays at the root on purpose — it is the published npm alias (decostudio → decocms) with its own publish workflow, and it must stay OUT of the workspaces globs so its 'decocms': '*' dependency resolves against the registry instead of being workspace-linked. spec/001.md's auth-config mentions are a historical design document and were left alone. * docs(helm): stop documenting authConfig values the chart renders to nothing The chart has had no template consuming .Values.configMap.authConfig or secret.authConfigSecretName since configmap-auth.yaml was deleted (#3048, env-var auth) — but the README and examples/secrets-example.yaml kept documenting both, including a second Secret with camelCase keys (googleClientId, resendApiKey) the server never reads. This is an active trap: the real prod values in deco-apps-cd carry a full authConfig block (google, resend, magic-link) that renders to nothing — auth there actually works because the ExternalSecret feeds AUTH_* keys via envFrom. README now shows the real mechanism (AUTH_* in meshConfig/Secret, schema in apps/api/src/auth/auth-env.ts) and the example Secret carries AUTH_* keys. * chore(api): delete apps/api/spec — a stale v1 design document 001.md described the file-based auth-config.json design that #3048/#5120 replaced with AUTH_* env vars, plus a pre-split architecture; nothing links to it except its README entry and one step of the add-mcp-tools skill, both removed (the skill's 'Document in Spec' step told contributors to document new tools in a file that described a system that no longer exists). monitoring-share-plugin.md was referenced by nothing at all. * chore: delete .cursorindexingignore Stale editor config from 2024 (last touched in #1218); the paths it excluded no longer exist in the repo.

before
after
Summary by CodeRabbit
New Features
Bug Fixes
Chores