Commit Graph

66 Commits

Author SHA1 Message Date
Adeniji Adekunle James
2edd122d9b Feat: Add inline code editor (#1156) (#1232) (#1220) (#1235)
## 🚀 Feature: Inline Code Editor

This PR adds a comprehensive inline code editing experience to the
DyadWrite component.

###  What's New

- **Inline Monaco Editor**: Edit code directly within the component
using Monaco Editor
- **Cancel/Revert**: Cancel changes and revert to original code state
- **Language Detection**: Automatic syntax highlighting based on file
extensions
- **Theme Support**: Proper dark/light mode theming integration



https://github.com/user-attachments/assets/c44ab622-6b86-403c-904d-3f327f9719e8


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

## Summary by cubic
Adds an inline Monaco-based code editor to DyadWrite so users can edit
code blocks in place, then save or cancel changes. Saves stream edits
back to the chat as a dyad-edit block.

- **New Features**
- Inline editor with Edit, Save, and Cancel; preserves original code and
auto-expands when editing.
  - Language detection from file extension and dark/light theme support.
- Save streams edits via useStreamChat as <dyad-edit
path="...">...</dyad-edit> tied to the selected chat.
- Non-edit view still uses CodeHighlight; visibility toggle and
in-progress state respected.

- **Refactors**
- ChatMessage now uses DyadMarkdownParser instead of
VanillaMarkdownParser.

<!-- End of auto-generated description by cubic. -->
2025-09-16 23:03:22 -07:00
Will Chen
9bc5e1387a Fix Azure e2e test so it doesn't leak (#1248)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Scoped Azure e2e test env setup to prevent leaking variables across
tests. Added testWithConfigSkipIfWindows and moved Azure env vars into a
per-test preLaunchHook; the Azure test now skips on Windows.

<!-- End of auto-generated description by cubic. -->
2025-09-10 14:48:15 -07:00
Will Chen
7150082f5a Add OpenRouter to setup banner (#1242)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added OpenRouter as a first-class option in the setup banner and
introduced a reusable provider card component. This streamlines provider
selection and adds E2E coverage for the setup flow.

- **New Features**
- Added SetupProviderCard and used it for Google and OpenRouter in
SetupBanner.
- Clicking Google or OpenRouter routes to the correct provider settings
and logs PostHog events.
  - Kept “Other providers” link to Settings.
- Added setup.spec.ts E2E test to verify Google, OpenRouter, and Other
navigation; introduced test config flag showSetupScreen to control the
OPENAI_API_KEY shortcut.

<!-- End of auto-generated description by cubic. -->
2025-09-10 13:00:31 -07:00
Will Chen
2842c61f7c Improve model picker UX (#1180)
1. Show less common AI providers (secondary) in submenu
2. Show $ signs for rough cost guide
3. Show "Pro" for supported AI providers with Pro is enabled

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

## Summary by cubic
Improves the Model Picker UX by grouping less-used providers under an
“Other AI providers” submenu and adding clear cost and Pro indicators.
This makes picking models faster and more informative.

- **New Features**
- Grouped secondary providers under “Other AI providers” using a new
provider.secondary flag (Azure marked secondary).
- Added rough cost hints: models can set dollarSigns and the UI shows a
“$” badge accordingly.
- Shows a “Pro” badge on supported cloud providers when Pro is enabled;
added a “Custom” badge for custom providers.
- Extended types: LanguageModelProvider.secondary and
LanguageModel.dollarSigns; populated values across OpenAI, Anthropic,
Google, and OpenRouter.

<!-- End of auto-generated description by cubic. -->
2025-09-03 15:36:54 -07:00
Tanner-Maasen
2ffbbbca8f Add Azure OpenAI Custom Model Integration (#1001)
Fixes #710 

This PR implements comprehensive Azure OpenAI integration for Dyad,
enabling users to leverage Azure
OpenAI models through proper environment variable configuration. The
implementation adds Azure as a
supported provider with full integration into the existing language
model architecture, including support
  for GPT-5 models. Key features include environment-based
configuration using `AZURE_API_KEY` and `AZURE_RESOURCE_NAME`,
specialized UI components that provide clear
setup instructions and status indicators, and seamless integration with
Dyad's existing provider system.
The Azure provider leverages the @ai-sdk/azure package (v1.3.25) for
compatibility with the current
  TypeScript language model interfaces.

The implementation includes robust error handling for missing
configuration, comprehensive test coverage
with 9 new unit tests covering critical functionality like model client
creation and error scenarios, and
  an E2E test for the Azure-specific settings UI. 

<img width="1510" height="908" alt="Screenshot 2025-08-18 at 9 14 32 PM"
src="https://github.com/user-attachments/assets/04aa99e1-1590-4bb0-86c9-a67b97bc7500"
/>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Will Chen <willchen90@gmail.com>
2025-08-30 20:47:25 -07:00
Will Chen
d8e54d9a10 Parameterize sys prompt (#1082)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Parameterized the system prompt and tokenized it in e2e dumps to make
snapshots smaller and stable. No runtime behavior changes; future prompt
edits won’t churn tests.

- **Refactors**
- Exported BUILD_SYSTEM_PREFIX and BUILD_SYSTEM_POSTFIX from
system_prompt.ts.
- Updated test_helper to replace the full prompt with
${BUILD_SYSTEM_PREFIX}/${BUILD_SYSTEM_POSTFIX} tokens in message dumps.
- Regenerated e2e snapshots to use tokens, reducing ~270 lines per
snapshot.

<!-- End of auto-generated description by cubic. -->
2025-08-25 17:56:14 -07:00
Will Chen
4e9a927a7b smart context v3 (#1022)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Adds Smart Context v3 with selectable modes (Off, Conservative,
Balanced) and surfaces token savings in chat. Also improves token
estimation by counting per-file tokens when Smart Context is enabled.

- **New Features**
- Smart Context selector in Pro settings with three options.
Conservative is the default when enabled without an explicit choice.
- New setting: proSmartContextOption ("balanced"); undefined implies
Conservative.
- Engine now receives enable_smart_files_context and smart_context_mode.
- Chat shows a DyadTokenSavings card when the message contains
token-savings?original-tokens=...&smart-context-tokens=..., with percent
saved and a tooltip for exact tokens.
- Token estimation uses extracted file contents for accuracy when Pro +
Smart Context is on; otherwise falls back to formatted codebase output.

<!-- End of auto-generated description by cubic. -->
2025-08-20 14:16:07 -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
8ef84285fc Shard E2E tests (#941) 2025-08-14 13:48:27 -07:00
Will Chen
a6dca76d29 Allow referencing other apps (#692)
- [x] Update chat_stream_handlers
- [x] Update token handlers
- [x] Update HomeChatInput
- [x] update lexical chat input: do not allow referencing same app
(current app, or other already selected apps)
- [x] I don't think smart context will work on this...
- [x] Enter doesn't clear...
2025-08-13 16:22:49 -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
e947eede7a community templates (#691) 2025-07-23 10:11:16 -07:00
Will Chen
2c284d0f20 Allow configuring environmental variables in panel (#626)
- [ ] Add test cases
2025-07-11 10:52:52 -07:00
Will Chen
4b84b12fe3 Extract panel header to title bar (#625) 2025-07-10 16:37:05 -07:00
Will Chen
72fd504f4a Skip git check in windows & longer timeout (#622) 2025-07-10 10:53:07 -07:00
Will Chen
dfdd267f53 Backup Dyad on new versions (#595) 2025-07-08 11:38:06 -07:00
Will Chen
a93536386b Support Beta release channel (#591) 2025-07-07 17:15:02 -07:00
Will Chen
ab6a9d3b34 Disable auto-update setting & settings page has scroll shortcuts (#590)
Fixes https://github.com/dyad-sh/dyad/issues/561
2025-07-07 15:43:06 -07:00
Will Chen
a9575abc01 Rebaseline tests (#568) 2025-07-03 22:42:40 -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
64ae18b34b Make wait extra long for preview pick element (#488) 2025-06-24 22:22:23 -07:00
Will Chen
fe597db5b3 harden app files snapshot (#486) 2025-06-24 16:46:40 -07:00
Will Chen
87a0de438c fix select component test (#485) 2025-06-24 16:16:08 -07:00
Will Chen
47f3ec460a Add Capacitor support (#483)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-06-24 14:35:05 -07:00
Will Chen
9fbd7031d9 build ask mode (#444) 2025-06-19 10:42:51 -07:00
Will Chen
bd809a010d GitHub workflows (#428)
Fixes #348 
Fixes #274 
Fixes #149 

- Connect to existing repos
- Push to other branches on GitHub besides main
- Allows force push (with confirmation) dialog

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-17 16:59:26 -07:00
Will Chen
382fe9bab5 support setting for writing supabase migration files (#427) 2025-06-17 15:14:02 -07:00
Will Chen
30b5c0d0ef Replace thinking with native Gemini thinking summaries (#400)
This uses Gemini's native [thinking
summaries](https://cloud.google.com/vertex-ai/generative-ai/docs/thinking#thought-summaries)
which were recently added to the API.

Why? The grafted thinking would sometimes cause weird issues where the
model, especially Gemini 2.5 Flash, got confused and put dyad tags like
`<dyad-write>` inside the `<think>` tags.

This also improves the UX because you can see the native thoughts rather
than having the Gemini response load for a while without any feedback.

I tried adding Anthropic extended thinking, however it requires temp to
be set at 1, which isn't ideal for Dyad's use case where we need precise
syntax following.
2025-06-16 17:29:32 -07:00
Will Chen
67dc9f4c42 Print engine/gateway URL more clearly (#396) 2025-06-13 10:05:12 -07:00
Will Chen
b044acb61f Polish chat input UX (#388) 2025-06-11 14:39:55 -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
4907fcafd8 E2E test for fixing errors (#351) 2025-06-05 23:29:52 -07:00
Will Chen
d3fbb48472 Copy app (#349)
Fixes #12
2025-06-05 22:26:17 -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
3558663ab7 Support native Git (experimental) (#338) 2025-06-04 21:37:05 -07:00
Will Chen
4e38031a65 Increase timeout for waiting for chat completion (#334) 2025-06-04 14:03:36 -07:00
Will Chen
e91a9c44fa Skip failing windows test (#332) 2025-06-04 10:31:13 -07:00
Will Chen
69b0e7aba2 Attempt to improve Windows E2E reliability(#331) 2025-06-04 07:42:00 -07:00
Will Chen
7994b01aa8 Context window e2e (#324) 2025-06-03 21:30:36 -07:00
Will Chen
b8f7490288 Stabilize E2E test by alphabetically sorting files for context (#321) 2025-06-03 17:58:59 -07:00
Will Chen
c227a08d11 Gateway e2e (#323) 2025-06-03 16:35:46 -07:00
Will Chen
fc1ebe9e8a e2e tests for engine (#322) 2025-06-03 16:11:16 -07:00
Will Chen
7235eab227 Make CI run cross-platform (#295) 2025-06-03 13:04:16 -07:00
Will Chen
81345153fc Deflake e2e tests (#316) 2025-06-02 22:48:03 -07:00
Will Chen
5802c39825 Rename app E2E (#315) 2025-06-02 22:46:35 -07:00
Will Chen
a44a9783c1 New chat e2e (#314) 2025-06-02 22:35:55 -07:00
Will Chen
1dde72e776 Delete app E2E (#313)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-06-02 22:06:21 -07:00
Will Chen
667fc42af4 Import e2e (#311) 2025-06-02 21:39:51 -07:00