Commit Graph

226 Commits

Author SHA1 Message Date
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
Adeniji Adekunle James
ebcf89ee6c fix: hide <dyad-command> tags from generated text output (#945) (#1162)
### Summary
This PR hides `<dyad-command type="refresh"></dyad-command>` tags from
generated text outputs. These elements are not intended for end users
and clutter the response text.

### Changes
- Filter out `<dyad-command>` tags from generated text.
- Ensure no regressions in rendering or formatting of user-visible
output.

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

## Summary by cubic
Hide dyad-command tags from chat output so internal commands never
appear in user-visible text. Updates DyadMarkdownParser to detect and
drop these tags during preprocessing, parsing, and rendering.

<!-- End of auto-generated description by cubic. -->
2025-09-03 14:56:27 -07:00
Will Chen
1c0255ab12 Enable iframe sandbox (#1178)
This allows almost all the iframe sandbox tokens
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#sandbox
except notably for allow-top-navigation*

Note: allow-same-origin should be OK because the main window is under
the `file://` origin while the iframe window is served on
`localhost:####`

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

## Summary by cubic
Enable sandboxing on the preview iframe to isolate preview content while
preserving needed capabilities (allow-same-origin, scripts, forms,
popups, modals, orientation/pointer lock, presentation, downloads).
Top-level navigation remains disallowed; allow-same-origin is safe
because the app is file:// and the iframe runs on localhost.

<!-- End of auto-generated description by cubic. -->
2025-09-03 14:17:50 -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
9869fefbcb Support dyad docker (#674)
TODOs:
- [ ] clean-up docker images

https://claude.ai/chat/13b2c5d3-0d46-49e3-a771-d10edf1e29f4
2025-08-26 11:07:40 -07:00
顾颢
2d5aa7e711 style(chat): solve the issue where the SetupBanner is cut off (#1078)
Fixes #1077 
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Fix the SetupBanner being cut off in the empty chat state. The
placeholder message now uses flex-1 instead of h-full so the banner
renders fully.

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

Co-authored-by: 顾颢 <guhao@dayee.com>
2025-08-25 17:24:19 -07:00
Mohamed Aziz Mejri
7adffc7576 fix text overflow in chat messages (#1073)
This PR fixes the issue #1072 where long words in chat messages overflow
outside the message container.
The fix applies Tailwind’s `break-words` utility to ensure that overly
long words wrap properly within the chat bubble.
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Fixes text overflow in chat messages by adding Tailwind’s break-words to
the message content. Long words and URLs now wrap inside the bubble
instead of spilling out.

<!-- End of auto-generated description by cubic. -->
2025-08-25 16:57:57 -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
34215db141 Help chat (#1007) 2025-08-19 15:31:17 -07:00
Adeniji Adekunle James
0cdd13dcbe feat: add timestamp and message version to prompt (#944) (#959)
### Summary

This PR implements a timestamp feature for messages in the prompt
window, responding to feature request #944.

**What this does:**
- Prefixes each sent message with a timestamp and message version.
### Screenshot

<img width="530" height="116" alt="image"
src="https://github.com/user-attachments/assets/62a86890-b120-42dd-ab48-8eeb4515a292"
/>

---------

Co-authored-by: Will Chen <willchen90@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-08-18 22:27:19 -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
Olyno
237017acd9 feat: allow custom install and start commands (#892)
# Description

Gives the ability to define an `install` and `startup` command when
importing a project, so we can work on a project locally without any
issue.

# Preview

<img width="2256" height="1422" alt="image"
src="https://github.com/user-attachments/assets/2132b1cb-5f71-4b88-84db-8ecc81cf1f66"
/>

---------

Co-authored-by: Will Chen <willchen90@gmail.com>
2025-08-18 10:41:22 -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
Adeniji Adekunle James
e554fd962b feat: add copy to clipboard functionality for code blocks (#934)
## 🚀 Feature: Copy to Clipboard for Code Blocks

### What's Changed
- Added a copy button to all code blocks that allows users to easily
copy code snippets
- Implemented visual feedback showing a checkmark when code is
successfully copied
- Copy button automatically reverts back after 2 seconds

### Technical Details
- Uses `navigator.clipboard.writeText()` for modern clipboard API
- Positioned copy button in the top-right corner alongside language
label
- Maintains existing code highlighting functionality

### UI/UX Improvements
- Clean, minimal copy button design that doesn't interfere with code
readability
- Clear visual feedback with copy and check icon transition
- Consistent styling with existing theme system

### Video



https://github.com/user-attachments/assets/8f388217-da8a-422e-9087-42cce8df68ad

---------

Co-authored-by: Will Chen <willchen90@gmail.com>
2025-08-15 16:52:37 -07:00
Will Chen
b06f658fc5 Add link for rate limit errors (#956) 2025-08-15 14:29:28 -07:00
Will Chen
4bc961ffb4 Fix preset value (#933) 2025-08-13 17:25:21 -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
Adeniji Adekunle James
76054c6db7 fix(ui): prevent content click from toggling accordion and improve UX with cursor-text in Codeblock (#930)
Hovering over the code block previously showed a pointer cursor, and
clicking inside would collapse/expand the accordion. This PR updates the
DyadWrite component to use `cursor-text` and adds `e.stopPropagation()`
so clicks inside the code block no longer toggle the accordion, making
it behave like other AI tools and improving user friendliness.


Before


https://github.com/user-attachments/assets/7b6983fd-91a0-4f30-9337-d444cbfcc110

After


https://github.com/user-attachments/assets/07d0d765-7206-4552-b0b4-2665d87df4a1
2025-08-13 15:34:11 -07:00
BlueRaw
2c208e3ace add editable custom model (#794)
Now users can free to edit their custom models by double clicking any
custom models created in each provider.
Before this, they have to delete -> create a new one.
I simply add an edit panel (which looks the same as 'Add Custom Model')
and integrate that process into the "update" button.

There is one more issue that if a user deletes a model that he was using
in chat, then back to chat, that model would still appear (and work)
unless user chooses a new one.
Tried to modify "delete-custom-model" in language_model_handlers.ts by
the logic that if the name of that model matches the latest using one ->
switch to auto (or default) model. Yet I failed, maybe need more
explanation for this :)
2025-08-12 21:53:44 -07:00
Will Chen
ac948412dc Clearer help instructions (#919) 2025-08-12 11:31:06 -07:00
Abdur Rahman
bbc50197c2 fix: improve close button alignment in chat error containers (#782)
Adjusted positioning to top-2.5 left-2 and add left padding to prevent
text overlap with the close button. 

<img width="715" height="61" alt="image"
src="https://github.com/user-attachments/assets/1e47f577-2b11-4928-82a6-053abc77dd1e"
/>

<img width="727" height="101" alt="image"
src="https://github.com/user-attachments/assets/b6058eca-93e0-445e-b17a-dee81911b90b"
/>
2025-08-05 14:34:17 -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
867ea28f73 Auto-sync GitHub after connecting to project (#756) 2025-07-31 15:35:18 -07:00
Will Chen
510d288d78 Show code snippet in fix problems (#745) 2025-07-30 16:03:17 -07:00
Will Chen
c57f6e35f0 bump limit to 100_000 versions (#731) 2025-07-29 11:03:57 -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
de21c6ff25 Rename chat (#673)
Fixes #102
2025-07-21 17:44:56 -07:00
Will Chen
444397ea86 Create Publish panel to easy GitHub and Vercel push (#655) 2025-07-17 15:54:08 -07:00
Will Chen
29065335f6 more draggable region for title bar (#651)
Fixes #650
2025-07-15 17:04:17 -07:00
Will Chen
be1321152e Make space for windows controls (#635) 2025-07-11 16:28:13 -07:00
Will Chen
7433028b21 Adjust color for non-build chat mode (#631) 2025-07-11 11:17:42 -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
a1aee5c2b8 Graduate file editing from experimental (#599) 2025-07-08 11:39:46 -07:00
Will Chen
ac2efa3294 Spruce up problems UX more (#593) 2025-07-07 17:46:15 -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
bc38f9b2d7 Improve check error performance by off-loading to worker thread w/ incremental compilation (#575) 2025-07-07 12:47:33 -07:00
Will Chen
97b5c29f11 Allow common iframe permissions (#589)
Fixes #576 
Fixes #538
2025-07-07 12:33:11 -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
e74bca6453 Allow typing into chat input / attaching while streaming (#544)
Fixes https://github.com/dyad-sh/dyad/issues/518
2025-07-02 15:51:44 -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
52205be9db Allow toggling pro in pro mode selector (#539)
Fixes #512
2025-07-01 13:06:46 -07:00
Will Chen
eee087fc81 Rename Undo button in version pane to Restore (#536) 2025-07-01 11:12:40 -07:00
Will Chen
6c71644775 Fix telemetry link (#511) 2025-06-28 21:00:29 -07:00
Will Chen
d5307a7207 Capacitor command fix (#498) 2025-06-25 16:45:49 -07:00