Commit Graph

87 Commits

Author SHA1 Message Date
Daniel Klein
ed2bf680ba fix: hide setup banner if any custom providers are configured (#1756)
Fixes #1108

## Summary
The "Setup AI Access" banner was not being hidden when custom providers
were configured. This was because the `isAnyProviderSetup()` function
only checked hardcoded cloud providers and didn't account for custom
providers.

## Changes
Updated `useLanguageModelProviders.ts` to check for configured custom
providers in addition to the hardcoded cloud providers.

## Test plan
- Configure a custom provider without setting up any cloud providers
- Verify that the "Setup AI Access" banner is now hidden

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Hide the "Setup AI Access" banner when any provider is configured,
including custom providers. Fixes a logic gap where only hardcoded cloud
providers were checked.

- **Bug Fixes**
- Extend isAnyProviderSetup to check custom providers from query data
(by id).
- Banner no longer shows when a custom provider is configured without
cloud providers.

<sup>Written for commit 2ecef7aac52da0b4d43c69fc5d3afb7bafa5706a.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-18 20:19:36 -08:00
Mohamed Aziz Mejri
2a7f5a8909 feat: multi-component-selector (#1728)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds multi-component selection in the preview and sends all selected
components to chat for targeted edits. Updates overlays, UI, and IPC to
support arrays, smarter context focusing, and cross-platform path
normalization.

- **New Features**
- Select multiple components in the iframe; selection mode stays active
until you deactivate it.
- Show a scrollable list of selections with remove buttons and a Clear
all; remove from the list or click an overlay in the preview to
deselect. Sending clears all overlays.
- Separate hover vs selected overlays with labels on hover; overlays
persist after deactivation and re-position on layout changes/resizes.
- Chat input and streaming now send selectedComponents; server builds
per-component snippets and focuses their files in smart context.

- **Migration**
- Replace selectedComponentPreviewAtom with
selectedComponentsPreviewAtom (ComponentSelection[]).
- ChatStreamParams now uses selectedComponents; migrate any
single-selection usages.
  - previewIframeRefAtom added for clearing overlays from the parent.

<sup>Written for commit da0d64cc9e9f83fbf4b975278f6c869f0d3a8c7d.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-13 13:26:41 -08:00
Will Chen
c50527b4c0 Security Panel MVP (#1660)
TODOs:

- [x] Add documentation
- [x] e2e tests: run security review, update knowledge, and fix issue
- [x] more stringent risk rating


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces a new Security mode with a Security Review panel that runs
reviews, edits rules, parses findings via IPC, and supports fixing
issues, with tests and prompt/runtime support.
> 
> - **UI/Preview Panel**:
> - Add `security` preview mode to `previewModeAtom` and ActionHeader
(Shield button).
> - New `SecurityPanel` showing findings table (sorted by severity), run
review, fix issue flow, and edit `SECURITY_RULES.md` dialog.
>   - Wire into `PreviewPanel` content switch.
> - **Hooks**:
>   - `useSecurityReview(appId)`: fetch latest review via IPC.
> - `useStreamChat`: add `onSettled` callback to invoke refreshes after
streams.
> - **IPC/Main**:
> - `security_handlers`: `get-latest-security-review` parses
`<dyad-security-finding>` from latest assistant message.
>   - Register handler in `ipc_host`; expose channel in `preload`.
>   - `ipc_client`: add `getLatestSecurityReview(appId)`.
> - `chat_stream_handlers`: detect `/security-review`, use dedicated
system prompt, optionally append `SECURITY_RULES.md`, suppress
Supabase-not-available note in this mode.
> - **Prompts**:
> - Add `SECURITY_REVIEW_SYSTEM_PROMPT` with structured finding output.
> - **Supabase**:
> - Enhance schema query to include `rls_enabled`, split policy
`using_clause`/`with_check_clause`.
> - **E2E Tests**:
> - New `security_review.spec.ts` plus snapshots and fixture findings;
update test helper for `security` mode and findings table snapshot.
> - Fake LLM server streams security findings for `/security-review` and
increases batch size.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5022d01e22a2dd929a968eeba0da592e0aeece01. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-29 17:32:52 -07:00
Will Chen
133ca57628 Support Supabase branches (#1394)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Adds Supabase database branch selection per app, with a new schema field
and UI to choose a branch after connecting a project. Resets branch when
changing or disconnecting the project to keep state consistent.

- **New Features**
  - Added apps.supabase_branch_id column.
- Branch dropdown in SupabaseConnector shown after a project is
connected; selection persists and triggers app refresh.
- New state and hooks: supabaseBranchesAtom, loadBranches(projectId),
setAppBranch(branchId).
- IPC endpoints: supabase:list-branches and supabase:set-app-branch;
setting/unsetting project also clears the branch.

- **Migration**
- Apply drizzle migration 0013_supabase_branch.sql to add the
supabase_branch_id column (defaults to null).

<!-- End of auto-generated description by cubic. -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds Supabase database branch selection per app, including parent
project tracking, new IPC endpoints, UI dropdown, and an accompanying DB
migration with e2e tests.
> 
> - **Database**:
> - Add `apps.supabase_parent_project_id` via migration
`drizzle/0015_complete_old_lace.sql`; snapshot and journal updated.
> - **IPC/Main**:
> - New `supabase:list-branches` handler and management client
`listSupabaseBranches` (real API + test stubs).
> - Update `supabase:set-app-project` to accept `{ projectId,
parentProjectId?, appId }`; unset clears both IDs.
> - `get-app` resolves `supabaseProjectName` using
`supabase_parent_project_id` when present.
> - **Types & Client**:
> - Add `SupabaseBranch`, `SetSupabaseAppProjectParams`, and
`App.supabaseParentProjectId`; expose `listSupabaseBranches` and updated
`setSupabaseAppProject` in `ipc_client` and preload whitelist.
> - **UI/Hooks**:
> - Supabase UI: branch dropdown in `SupabaseConnector` with
`loadBranches`, selection persists via updated `setAppProject`.
> - State: add `supabaseBranchesAtom`; `useSupabase` gets `branches`,
`loadBranches`, new param shape for `setAppProject`.
>   - TokenBar/ChatInput: add `data-testid` for token bar and toggle.
> - **Supabase Context (tests)**:
> - Test build returns large context for `test-branch-project-id` to
validate branch selection.
> - **E2E Tests**:
> - Add `supabase_branch.spec.ts` and snapshot verifying branch
selection affects token usage.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
33054278db8396b4371ed6e8224105cb5684b7ac. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-14 15:34:42 -07:00
Will Chen
9691c9834b Support concurrent chats (#1478)
Fixes #212 


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Add concurrent chat support with per-chat state, chat activity UI, IPC
per-chat handling, and accompanying tests.
> 
> - **Frontend (Chat concurrency)**
> - Replace global chat atoms with per-chat maps:
`chatMessagesByIdAtom`, `isStreamingByIdAtom`, `chatErrorByIdAtom`,
`chatStreamCountByIdAtom`, `recentStreamChatIdsAtom`.
> - Update `ChatPanel`, `ChatInput`, `MessagesList`,
`DyadMarkdownParser`, and `useVersions` to read/write per-chat state.
> - Add `useSelectChat` to centralize selecting/navigating chats; wire
into `ChatList`.
> - **UI**
> - Add chat activity popover: `ChatActivityButton` and list; integrate
into `preview_panel/ActionHeader` (renamed from `PreviewHeader`) and
swap in `TitleBar`.
> - **IPC/Main**
> - Send error payloads with `chatId` on `chat:response:error`; update
`ipc_client` to route errors per chat.
> - Persist streaming partial assistant content periodically; improve
cancellation/end handling.
> - Make `FileUploadsState` per-chat (`addFileUpload({chatId,fileId},
...)`, `clear(chatId)`, `getFileUploadsForChat(chatId)`); update
handlers/processors accordingly.
> - **Testing**
> - Add e2e `concurrent_chat.spec.ts` and snapshots; extend helpers
(`snapshotMessages` timeout, chat activity helpers).
> - Fake LLM server: support `tc=` with options, optional sleep delay to
simulate concurrency.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9035f30b73a1f2e5a366a0cac1c63411742b16f3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-09 10:51:01 -07:00
Will Chen
b1e82ba5de Better spawn error message (#1434)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Structure preview errors with source-aware messaging/UI and enhance
local/Docker spawn error diagnostics and logging.
> 
> - **Frontend**:
> - **Error model**: Change `previewErrorMessageAtom` from `string` to
`{ message, source }` to distinguish `preview-app` vs `dyad-app` errors.
> - **Preview UI**: Update `ErrorBanner` in
`components/preview_panel/PreviewIframe.tsx` to use `error.message`,
show an "Internal Dyad error" chip for `dyad-app`, conditional tip text,
and hide AI fix for non-`preview-app` errors; use `cn` helper.
> - **Error propagation**: Wrap iframe and build errors via
`setErrorMessage({ message, source: "preview-app" })`; adjust AI prompt
to use `errorMessage.message`.
> - **Hooks**:
> - `useRunApp`: On run/stop/restart failures, set `{ message, source:
"dyad-app" }` in `previewErrorMessageAtom`.
> - **Backend**:
> - `ipc/handlers/app_handlers.ts`: Improve spawn failure handling for
local node and Docker: capture stderr as strings, collect error details
(`message`, `code`, `errno`, `syscall`, `path`, `spawnargs`), log with
context, and throw enriched error messages.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4135b04e19431dd53848c3266e5211e4c9df6aa2. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-10-07 16:37:43 -07:00
Mohamed Aziz Mejri
423a95ed81 implementing favorite apps feature (#1410)
This PR implements favorite apps feature and addresses issue #827 
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a favorite apps feature with a star toggle in the sidebar.
Favorites are grouped separately and persisted, with optimistic UI
updates and e2e tests.

- **New Features**
- Added isFavorite to the apps schema and an IPC handler
(add-to-favorite) to toggle and persist the state.
  - Updated AppList to show “Favorite apps” and “Other apps” sections.
- Introduced AppItem component with a star button; uses
useAddAppToFavorite for optimistic updates and toasts.
  - Added Playwright tests to verify favoriting and unfavoriting.

- **Migration**
- Run DB migrations to add the apps.is_favorite column (defaults to 0).

<!-- End of auto-generated description by cubic. -->
2025-10-06 12:44:18 -07:00
Md Rakibul Islam Rocky
29d8421ce9 Enhance Azure configuration handling and UI updates (#1289)
# Changes 

- Update Azure configuration components to manage API key and resource
name settings.
- Improve visibility of conThis pull request introduces a redesigned
Azure provider settings UI and refactors the logic for configuring Azure
OpenAI credentials, both in the frontend and supporting hooks. The main
changes focus on making the Azure configuration experience clearer and
more robust by supporting both environment variable and saved settings,
improving status indicators, and updating the logic for determining
provider readiness.

**Azure Provider UI and Logic Improvements**

* Added a new `AzureConfiguration` component that provides a dedicated
form for entering and saving Azure resource name and API key, with clear
status indicators and error handling. The UI now explains precedence
between saved settings and environment variables, and guides users
through configuration.
(`src/components/settings/AzureConfiguration.tsx`)
* Updated the main provider settings page and API key configuration
logic to pass Azure-specific settings and update functions to the new
component, ensuring seamless integration and correct state management.
(`src/components/settings/ApiKeyConfiguration.tsx`,
`src/components/settings/ProviderSettingsPage.tsx`)
[[1]](diffhunk://#diff-2104fb487cda3768cc5777889100e882f51e7fb3e13abe3cc89cf8ed1444300aR35)
[[2]](diffhunk://#diff-2104fb487cda3768cc5777889100e882f51e7fb3e13abe3cc89cf8ed1444300aR51-R61)
[[3]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cR297)
* Refactored the logic for determining whether Azure is configured to
check both saved settings and environment variables, ensuring accurate
status display and enabling fallback to environment variables if no
settings are saved. (`src/components/settings/ProviderSettingsPage.tsx`,
`src/hooks/useLanguageModelProviders.ts`)
[[1]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cL72-R99)
[[2]](diffhunk://#diff-9ac9e279a0cda34a0bc519348d5474b2e355b0828a678495be3af1e8984b5be5R35-R48)
* Updated the Azure provider E2E test to verify the new UI elements,
status indicators, and guidance, ensuring the test matches the new
configuration flow and messaging.
(`e2e-tests/azure_provider_settings.spec.ts`)

**Supporting Type and Import Updates**

* Added and updated type imports for `AzureProviderSetting` and
`VertexProviderSetting` where needed to support the new logic and UI.
(`src/components/settings/ProviderSettingsPage.tsx`,
`src/hooks/useLanguageModelProviders.ts`,
`src/ipc/utils/get_model_client.ts`)
[[1]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cL14-R14)
[[2]](diffhunk://#diff-9ac9e279a0cda34a0bc519348d5474b2e355b0828a678495be3af1e8984b5be5L5-R5)
[[3]](diffhunk://#diff-3cd526c6c10413c1387bfef450e48b880ba6f54865e96046044586ff4192bcceR15)
* Changed Azure model client import to use `createAzure` for consistency
and future extensibility. (`src/ipc/utils/get_model_client.ts`)
[Copilot is generating a summary...]figuration status and error handling
in the UI.
- Refactor environment variable checks to prioritize saved settings.
- Add support for Azure provider settings in the schema.
- Modify tests to reflect changes in Azure configuration requirements.

# Changes in short

- **Azure settings panel**
  - Replaced with a full form that:
    - Persists API key and resource name  
    - Surfaces save state  
    - Keeps the environment-variable helper  
  - *(src/components/settings/AzureConfiguration.tsx:23-214)*

- **Settings stack workflow**
  - Threaded the new Azure workflow:
    - Config shim now passes `updateSettings`  
    - Provider status checks prefer saved Azure values before env vars  
- *(src/components/settings/ApiKeyConfiguration.tsx:40-55,
src/components/settings/ProviderSettingsPage.tsx:60-105)*

- **Provider detection**
  - Azure treated like other saved credentials by:
    - Looking for both stored fields, or  
    - The pair of env vars  
  - *(src/hooks/useLanguageModelProviders.ts:5-57)*

- **Back-end model creation**
  - Reads saved Azure credentials (falling back to env vars)  
  - Builds the client via `createAzure`  
  - *(src/ipc/utils/get_model_client.ts:316-369)*

- **Provider schema support**
  - Extended so Azure can store its resource name alongside the secret  
  - *(src/lib/schemas.ts:82-109)*  

- **E2E tests**
  - Updated Azure Playwright spec to cover the new UI  
  - *(e2e-tests/azure_provider_settings.spec.ts:4-50)*

Issues resolved: #1275
2025-09-30 13:53:52 -07:00
Adeniji Adekunle James
3b68fb4e48 feat: add hotkey to toggle chat modes (#1274) (#995) (#1284)
Adds Ctrl+Shift+A (Cmd+Shift+A on Mac) keyboard shortcut to toggle
between Ask and Build chat modes.

**Changes:**
- Created `useChatModeToggle` hook for shared logic
- Added shortcut to ChatInput and HomeChatInput components

**Usage:**
Press Ctrl+Shift+A (or Cmd+Shift+A on Mac) to quickly switch between
chat modes without using the UI.

<img width="434" height="123" alt="image"
src="https://github.com/user-attachments/assets/a8c167b6-2b54-46f5-8191-5019991fc8e5"
/>

Closes (#995)
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Add a global hotkey to toggle between Ask and Build modes: Ctrl+Shift+A
(Cmd+Shift+A on Mac). Makes switching faster without touching the UI and
fulfills Linear #995.

- **New Features**
- Added useChatModeToggle hook to flip selectedChatMode, detect
platform, and track PostHog event chat:mode_toggle.
- Wired the hotkey into ChatInput and HomeChatInput via
useChatModeToggle.
  - Updated ChatModeSelector tooltip to show the shortcut.

<!-- End of auto-generated description by cubic. -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds Cmd/Ctrl + . shortcut to cycle chat modes via a new hook, and
updates the mode selector tooltip to show the shortcut.
> 
> - **UX/Hotkey**:
> - Introduces `useChatModeToggle` to cycle `settings.selectedChatMode`
(captures `chat:mode_toggle`), with platform detection
(`detectIsMac`/`useIsMac`) and `useShortcut` binding for `Cmd/Ctrl + .`.
> - **Integrations**:
> - Wires `useChatModeToggle()` into `components/chat/ChatInput.tsx` and
`components/chat/HomeChatInput.tsx` to enable the shortcut in chat
inputs.
> - **UI**:
> - Enhances `components/ChatModeSelector.tsx` tooltip to display the
platform-specific shortcut hint (`⌘ + .` or `Ctrl + .`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d8cc3fff43b6eb3227623f1c084410f42392c0b3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Will Chen <willchen90@gmail.com>
2025-09-30 13:43:24 -07:00
Will Chen
42a406e3ab Update setup banner: navigate to settings#ai & Dyad Pro option (#1361)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Updated the setup banner to navigate to Settings and auto-scroll to the
AI Providers section, and added a Dyad Pro setup option to streamline
onboarding.

- **New Features**
  - Added “Setup Dyad Pro” card with logo; opens Dyad Pro signup.
- “Other providers” now jumps to Settings → Provider section with smooth
scroll.
  - OpenRouter setup card updated with new teal styling.

- **Refactors**
- Introduced useScrollAndNavigateTo hook to navigate, scroll, and set
active section.
- Centralized active section state via activeSettingsSectionAtom (used
by SettingsList).
  - SetupProviderCard supports a new “dyad” variant styling.

<!-- End of auto-generated description by cubic. -->
2025-09-23 16:06:49 -07:00
Adeniji Adekunle James
2597d50529 feat: add copy functionality for ai responses with Dyad tag formatting (#1290) (#1315)
## Summary
Adds AI response copy functionality to chat messages that preserves
formatting and converts Dyad-specific tags to clean, readable markdown.

## Changes
- **New `useCopyToClipboard` hook**: Parses Dyad tags and converts them
to professional markdown format
- **Updated `ChatMessage` component**: Positions copy button on left
side of approval status
- **Dyad tag conversion**: Transforms custom tags to readable format:
  - `<dyad-write>` → `### File: path/to/file.js` + code block
  - `<dyad-edit>` → `### Edit: path/to/file.js` + code block  
  - `<dyad-execute-sql>` → `### Execute SQL` + ```sql block
  - `<think>` → `### Thinking` + content

## Features
-  Automatic programming language detection from file extensions  
-  Professional markdown formatting with proper headings and code
blocks
-  Tooltip showing "Copied" confirmation
-  Reuses existing DyadMarkdownParser logic for consistency

closes (#1290)
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a Copy button to assistant messages that copies a clean Markdown
version of the response by converting Dyad tags and preserving code
blocks. Improves shareability and removes Dyad-only markup; addresses
Linear #1290.

- **New Features**
- Added useCopyToClipboard hook that parses Dyad tags to Markdown,
auto-detects code language, and cleans spacing.
- Updated ChatMessage to show a Copy button (with Copy/Copied tooltip)
to the left of approval status; disabled while streaming.
- Tag conversions: think → "### Thinking"; dyad-write/edit → "###
File/Edit: path" + fenced code; dyad-execute-sql → "### Execute SQL" +
sql block; other Dyad tags map to concise headings; chat-summary/command
are omitted.
- Added e2e tests for clipboard copy, Dyad tag stripping/formatting, and
tooltip states.

<!-- End of auto-generated description by cubic. -->
2025-09-22 23:32:55 -07:00
Will Chen
6d3c397d40 Add MCP support (#1028) 2025-09-19 15:43:39 -07:00
Mohamed Aziz Mejri
a547aa3ac1 Implementing app search feature (#1302)
This PR implements app search feature and addresses the issue #1182.
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a fast app search with a command-style dialog so users can find
apps by name or chat content and jump to them quickly. Implements the
search experience requested in #1182.

- New Features
- Search dialog (Ctrl+K or “Search Apps” button) with result snippets
from matching chat titles/messages.
- Searches across app names, chat titles, and message content;
case-insensitive; supports partial matches; empty query lists all apps.
  - Selecting a result navigates to the app and closes the dialog.
- New IPC endpoint search-app with Zod-validated results, debounced
React Query hook, and preload allowlist update.
- Added E2E tests for dialog open/close, shortcuts, matching behavior,
empty state, and navigation.

<!-- End of auto-generated description by cubic. -->
2025-09-17 15:03:07 -07:00
Adeniji Adekunle James
8c3fdb0ad0 feat: add edit functionality for custom AI providers (#1232) (#1171) (#1250)
## Summary
Adds the ability to edit existing custom AI providers through the
settings UI.

## Changes Made
- **UI Changes:**
  - Added "Edit Provider" button to custom provider dropdown menu
  - Modified `CreateCustomProviderDialog` to support edit mode


- **Backend Changes:**
- Implemented `editCustomLanguageModelProvider` handler in
`language_model_handlers.ts`
  - Added corresponding IPC client method
- Database transaction ensures atomicity when updating provider and
associated models


- **Testing:**
  - Added comprehensive e2e test covering edit functionality
  - Tests verify form pre-population, field updates, and UI persistence
  
  


https://github.com/user-attachments/assets/e8c8600e-4fb7-4816-be95-993ede1224d4



## Closes
Fixes #1232 and #1171
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds edit support for custom language model providers in Settings. Users
can update provider ID, name, API base URL, and API key env var, with
safe backend updates that also retarget associated models if the ID
changes.

- New Features
  - Added “Edit Provider” option in the custom provider menu.
- Dialog supports edit mode with pre-filled fields, unified loading
state, and update button text.
- New IPC handler to edit providers with validation and a transaction;
updates linked models when IDs change.
- IPC client and preload channel updated; React hook exposes
editProvider mutation with cache invalidation.
  - Added e2e test covering the full edit flow.

<!-- End of auto-generated description by cubic. -->
2025-09-16 22:58:46 -07:00
Will Chen
7818f2950a Chat search (#1224)
Based on https://github.com/dyad-sh/dyad/pull/1116
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a fast chat search dialog (Command Palette) to find and jump
between chats. Open via the sidebar button or Ctrl/Cmd+K, with title and
message text search plus inline snippets.

- New Features
  - Command palette using cmdk with keyboard shortcut (Ctrl/Cmd+K).
- Searches within the selected app across chat titles and message
content via a new IPC route (search-chats).
- Debounced queries (150ms) with React Query; results de-duplicated and
sorted by newest.
- Snippet preview with highlighted matches and custom ranking; selecting
a result navigates and closes the dialog.
- Search button added to ChatList; basic e2e tests added (currently
skipped).

- Dependencies
  - Added cmdk@1.1.1.
- Bumped @radix-ui/react-dialog to ^1.1.15 and updated Dialog to support
an optional close button.

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Evans Obeng <iamevansobeng@outlook.com>
Co-authored-by: Evans Obeng <60653146+iamevansobeng@users.noreply.github.com>
2025-09-09 00:18:48 -07:00
Md Rakibul Islam Rocky
4db6d63b72 Add Google Vertex AI provider (#1163)
# Summary

* Adds first-class **Google Vertex AI provider** using
`@ai-sdk/google-vertex`.
* Supports **Gemini 2.5** models and partner **MaaS (Model Garden)**
models via full publisher IDs.
* New **Vertex-specific settings UI** for Project, Location, and Service
Account JSON.
* Implements a **“thinking” toggle** for Gemini 2.5 Flash

  * Pro: always on
  * Flash: toggleable
  * Flash Lite: none
* Fixes *“AI not found”* for Vertex built-ins by mapping to
`publishers/google` paths.
* Hardens **cross-platform file ops** and ensures all tests pass.

---

# What’s New

### Vertex AI Provider

* Uses `@ai-sdk/google-vertex` with `googleAuthOptions.credentials` from
pasted Service Account JSON.
* Configurable **project** and **location**.
* Base URL → `/projects/{project}/locations/{location}`

  * Built-ins: `publishers/google/models/<id>`
  * Partner MaaS: `publishers/<partner>/models/...`

### Built-in Vertex Models

* `gemini-2.5-pro`
* `gemini-2.5-flash`
* `gemini-2.5-flash-lite`

### Thinking Behavior

* Vertex + Google marked as thinking-capable.
* Pro: always thinking
* Flash: toggle in UI
* Flash Lite: none

### Vertex Settings UI

* New **Google Vertex AI panel** for Project ID, Location, Service
Account JSON.
* Keys encrypted like other secrets.

---

# Fixes

* **Model resolution:** built-ins auto-map to
`publishers/google/models/<id>`.
* **Partner MaaS support:** full publisher IDs work directly (e.g.
DeepSeek).
* **Cross-platform paths:** normalize file ops with `toPosixPath`,
preserve `safeJoin` semantics.

---

# Why This Is Better

* Users can select **Vertex alongside other providers**.
* **More models** available through Model Garden.
* **Dedicated setup UI** reduces misconfig.
* **Thinking toggle** gives control over cost vs. reasoning depth.

---

# Files Changed

* **Provider & Models**: `language_model_helpers.ts`,
`get_model_client.ts`
* **Streaming**: `chat_stream_handlers.ts`
* **Schemas & Encryption**: `schemas.ts`, `settings.ts`
* **Settings UI**: `VertexConfiguration.tsx`, `ApiKeyConfiguration.tsx`
* **Models UI**: `ModelsSection.tsx` (Flash toggle)
* **Setup Detection**: `useLanguageModelProviders.ts`
* **Path Utils**: `path_utils.ts`, `response_processor.ts`
* **Deps**: `package.json` → `@ai-sdk/google-vertex@3.0.16`

---

# Tests & Validation

* **TypeScript**: `npm run ts` → 
* **Lint**: `npm run lint` → 
* **Unit tests**: `npm test` →  231 passed, 0 failed

---

# Migration / Notes

* No breaking changes.
* For Vertex usage:

  * Ensure Vertex AI API is enabled.
  * Service Account needs `roles/aiplatform.user`.
  * Region must support model (e.g. `us-central1`).
* Thinking toggle currently affects **only** Gemini 2.5 Flash.

---

# Manual QA

1. Configure Vertex with Project/Location/Service Account JSON.
2. Test built-ins:

   * `gemini-2.5-pro`
   * `gemini-2.5-flash` (toggle on/off)
   * `gemini-2.5-flash-lite`
3. Test MaaS partner model (e.g., DeepSeek) via full publisher ID.
4. Verify other providers remain unaffected.
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Adds a first-class Google Vertex AI provider with Gemini 2.5 models, a
Vertex settings panel, and a “thinking” toggle for Gemini 2.5 Flash.
Also fixes model resolution for Vertex and hardens cross-platform file
operations.

- **New Features**
- Vertex AI provider via @ai-sdk/google-vertex with project, location,
and service account JSON.
- Built-in models: gemini-2.5-pro, gemini-2.5-flash,
gemini-2.5-flash-lite.
- “Thinking” support: Pro always on; Flash toggle in Models UI; Flash
Lite none.
- MaaS partners supported via full publisher paths (e.g.,
publishers/<partner>/models/...).
  - Vertex settings UI with encrypted service account key storage.

- **Bug Fixes**
  - Built-in Vertex models auto-map to publishers/google/models/<id>.
  - Consistent file ops across platforms using toPosixPath.
- Vertex readiness detection requires project/location/service account
JSON.
- Streaming “thinking” behavior respects Vertex Flash toggle and Pro
always-on.

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Md Rakibul Islam Rocky <mdrirocky08@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Will Chen <willchen90@gmail.com>
2025-09-08 22:41:12 -07:00
Mohamed Aziz Mejri
6ee1a93187 Component selection shortcut (#1139)
This PR introduces a new keyboard shortcut to improve the efficiency of
selecting components in the app. Users can now quickly select components
using Meta + Shift + C for Mac and Ctrl + Shift + C for Other devices
(Windows/Linux)

    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Add a shortcut to quickly activate the component selector from the
preview. Use Meta+Shift+C on macOS and Ctrl+Shift+C on Windows/Linux.

- **New Features**
- Added useShortcut hook to handle key combos and prevent default on
match.
  - Wired shortcut in PreviewIframe with OS detection for Meta vs Ctrl.
- Forwarded keydown events from the iframe to the parent via postMessage
(dyad-shortcut-triggered) so the shortcut works inside preview content.

<!-- End of auto-generated description by cubic. -->
2025-09-05 23:33:44 -07:00
Will Chen
573642ae5f Prompt gallery (#957)
- [x] show prompt instead of app in autocomplete
- [x] use proper array/list for db (tags)
- [x] don't do <dyad-prompt> - replace inline
2025-08-18 13:25:11 -07:00
Will Chen
55cc5460e3 Support next.js for routes and handle long width address bar (#958) 2025-08-15 17:56:44 -07:00
Will Chen
5db0b04400 Support exclude paths in manual context management (#774) 2025-08-05 14:33:39 -07:00
Will Chen
b0f08eaf15 Neon / portal template support (#713)
TODOs:
- [x] Do restart when checkout / restore if there is a DB
- [x] List all branches (branch id, name, date)
- [x] Allow checking out versions with no DB
- [x] safeguard to never delete main branches
- [x] create app hook for neon template
- [x] weird UX with connector on configure panel
- [x] tiny neon logo in connector
- [x] deploy to vercel
- [x] build forgot password page
- [x] what about email setup
- [x] lots of imgix errors
- [x] edit file - db snapshot
- [x] DYAD_DISABLE_DB_PUSH
- [ ] update portal doc
- [x] switch preview branch to be read-only endpoint
- [x] disable supabase sys prompt if neon is enabled
- [ ] https://payloadcms.com/docs/upload/storage-adapters
- [x] need to use main branch...

Phase 2?
- [x] generate DB migrations
2025-08-04 16:36:09 -07:00
Will Chen
0793fc299d Fix vercel deployment fetching (#758) 2025-07-31 16:13:46 -07:00
Will Chen
e947eede7a community templates (#691) 2025-07-23 10:11:16 -07:00
Will Chen
9edd0fa80f Upload image via chat (#686) 2025-07-22 15:45:30 -07:00
Will Chen
4b84b12fe3 Extract panel header to title bar (#625) 2025-07-10 16:37:05 -07:00
Will Chen
742e754431 telemetry on version used on app load (#610) 2025-07-10 10:24:30 -07:00
Will Chen
77e39874ad truly disable check problems (#566) 2025-07-03 17:51:37 -07:00
Will Chen
375d35b144 Disable check problems when autofix is not enabled (#563) 2025-07-03 16:11:35 -07:00
Will Chen
bd715a2ea0 invalidate problems when version is reverted (#546) 2025-07-02 16:11:37 -07:00
Will Chen
678cd3277e Problems: auto-fix & problem panel (#541)
Test cases:
- [x] create-ts-errors
  - [x] with auto-fix
  - [x] without auto-fix 
- [x] create-unfixable-ts-errors
- [x] manually edit file & click recheck
- [x] fix all
- [x] delete and rename case

THINGS
- [x] error handling for checkProblems isn't working as expected
- [x] make sure it works for both default templates (add tests) 
- [x] fix bad animation
- [x] change file context (prompt/files)

IF everything passes in Windows AND defensive try catch... then enable
by default
- [x] enable auto-fix by default
2025-07-02 15:43:26 -07:00
Will Chen
fa1fb9cc4d Allow pasting images (#472)
Fixes #283
2025-06-23 15:33:21 -07:00
Will Chen
37fb643f6f Allow attaching the same file twice (#471) 2025-06-23 15:02:55 -07:00
Will Chen
2fc33d04c1 Make delete app better handled & revamp error toast (#422)
Fixes #395 
Fixes #270 
Fixes #268
2025-06-16 23:36:43 -07:00
Will Chen
c1aa6803ce Click to edit UI (#385)
- [x] add e2e test - happy case (make sure it clears selection and next
prompt is empty, and preview is cleared); de-selection case
- [x] shim - old & new file
- [x] upgrade path
- [x] add docs
- [x] add try-catch to parser script
- [x] make it work for next.js
- [x] extract npm package
- [x] make sure plugin doesn't apply in prod
2025-06-11 13:05:27 -07:00
Will Chen
534cbad909 Allow manual context management (#376) 2025-06-10 13:52:20 -07:00
Will Chen
d3fbb48472 Copy app (#349)
Fixes #12
2025-06-05 22:26:17 -07:00
Will Chen
0123e68dda Instrument extra files warning (#345)
https://github.com/dyad-sh/dyad/issues/244
2025-06-05 15:24:31 -07:00
Will Chen
16bf0828f5 Fix stale app UI (supabase) & overall E2E test infra improvements (#337)
Fixes #269
2025-06-04 23:07:59 -07:00
Will Chen
9d1a0f7ad7 pro: show remaining credits (#329)
Fixes #265
2025-06-03 23:46:35 -07:00
Will Chen
cdf2f5d772 Show a loading bar when checkout is happening (#249) 2025-05-26 11:51:00 -07:00
Will Chen
cbfe26bac1 Rename branch (#199)
This is more important now that import app is available and not every
git repo will be initialized with `main` as the default branch. This
handles the other common case which is the `master` branch.
2025-05-19 14:41:18 -07:00
Will Chen
b5671c0a59 Auto-commit extra files (#197)
Whenever Dyad does a commit from a proposal, it will automatically amend
the commit with outside changes (e.g. made outside of Dyad).

This helps avoid a lot of user confusion, e.g.
https://github.com/dyad-sh/dyad/issues/187

https://www.reddit.com/r/dyadbuilders/comments/1kjysc0/error_pushing_images/

Edge cases:
If a user adds a file outside of Dyad, and then they hit retry, it will
revert these outside changes, but it's still technically in the version
history, so I think it's OK. This should also be a pretty unusual
situation.

Fixes #164 
Fixes #187
2025-05-19 13:42:27 -07:00
Will Chen
5966dd7f4b Proxy server to inject shim (#178)
things to test:

- [x] allow real URL to open in new window
- [x] packaging in electron?
- [ ] does it work on windows?
- [x] make sure it works with older apps
- [x] what about cache / reuse? - maybe use a bigger range of ports??
2025-05-16 23:28:26 -07:00
Will Chen
993c5417e3 Fix DB schemas (#138) 2025-05-12 21:51:08 -07:00
Will Chen
f5a6a1abca Delete custom provider (#137) 2025-05-12 17:31:03 -07:00
Will Chen
ea9301c771 Support delete custom model (#136) 2025-05-12 16:37:39 -07:00
Will Chen
477015b43d allow creating and listing custom language model (#134) 2025-05-12 16:00:16 -07:00
Will Chen
642895f0ba Allow creating custom providers (#132) 2025-05-12 15:04:42 -07:00
Will Chen
cd7eaa8ece Prep for custom models: support reading custom providers (#131) 2025-05-12 14:52:48 -07:00
Will Chen
c71638a508 Simplify handlers & IPC client: move from Result pattern to throwing errors (#120) 2025-05-09 15:14:12 -07:00