Commit Graph

59 Commits

Author SHA1 Message Date
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
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
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
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
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
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
444397ea86 Create Publish panel to easy GitHub and Vercel push (#655) 2025-07-17 15:54:08 -07:00
Will Chen
a1aee5c2b8 Graduate file editing from experimental (#599) 2025-07-08 11:39:46 -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
c3362fdaff Normalize app files (#547) 2025-07-02 16:51:26 -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
d6d6918d1b Safe send (#421) 2025-06-16 21:58:20 -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
34ea593928 Fix bug with copy app (#371)
Fixes #361
2025-06-09 14:58:55 -07:00
Will Chen
d3fbb48472 Copy app (#349)
Fixes #12
2025-06-05 22:26:17 -07:00
Will Chen
3558663ab7 Support native Git (experimental) (#338) 2025-06-04 21:37:05 -07:00
Will Chen
e060f780b9 Use npm install --legacy-peer-deps (#326)
Fixes #309 

Unfortunately a lot of React.js apps have this problem with peer deps
because older dependencies specify pre-v19. Because Dyad app templates
do (and should) explicitly specify React as a dependnecy, using
`--legacy-peer-deps` gives us the right behavior where it effectively
does not install peer deps and avoids the React version errors.

For pnpm, we have an explicit lockfiles for our templates so there isn't
an issue.

Context:
https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-06-03 22:26:39 -07:00
Will Chen
a915d892f7 Support Next.js template & template hub (#241) 2025-05-27 00:16:30 -07:00
Will Chen
4d2b4783bc Fix scaffold copy and better error handling for create app (#202)
I was over-eager in https://github.com/dyad-sh/dyad/pull/200 and removed
copyDirectoryRecursive which is actually needed to copy the scaffold
out.
2025-05-19 17:58:49 -07:00
Will Chen
68cb6b3d7d Robust app folder rename (#200)
Fixes #89
2025-05-19 14:59:55 -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
6e08bc5c62 Import app (#189)
Fixes #163
2025-05-19 14:03:10 -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
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
Will Chen
2537fbb342 lint using oxlint (#106) 2025-05-08 17:21:35 -07:00
Will Chen
0d56651220 Run prettier on everything (#104) 2025-05-06 23:02:28 -07:00
Will Chen
939c7db2ec make sure supabase is configured before retrieiving supabase app info (#97) 2025-05-06 12:26:38 -07:00
Will Chen
20362d7b08 Fix undo and redo by using initial commit hash for chat (#94) 2025-05-06 12:15:42 -07:00
Will Chen
1fcb58a141 Refactor version handlers (#90)
refactor version handlers
2025-05-06 10:16:09 -07:00
Will Chen
a720e0073d Max versions shown (#83) 2025-05-05 14:29:06 -07:00
Will Chen
b9dc2cc0f9 Undo button (#76) 2025-05-02 15:35:39 -07:00
Will Chen
46cb7ca577 redo reverts code (when possible) (#75) 2025-05-02 14:55:46 -07:00
Will Chen
3529627172 Undo chat history (#74) 2025-05-02 13:47:59 -07:00
Will Chen
aec5882c8d Fix bug in extract codebase that artificially limited to 30 files (#32) 2025-04-28 13:45:32 -07:00
Will Chen
4294ce5767 Supabase support: client, auth & SQL 2025-04-23 12:59:09 -07:00
Will Chen
ec43482d6c Basic Supabase OAuth integration & project-app binding 2025-04-23 12:59:09 -07:00
Will Chen
ee3d2e7f4e Provide a rebuild option (restart w/ re-install node modules) 2025-04-21 16:46:10 -07:00
Will Chen
87ff4ee870 Add help button which opens GitHub issue w/ system report | explicitly log with electron-log & scrub logs 2025-04-21 14:28:21 -07:00
Will Chen
7ac07aa0ce Use npm as fallback if pnpm isn't available & more robust pnpm installation 2025-04-18 21:43:46 -07:00
Will Chen
14d09f080f Remove uncessary check in checkout-version 2025-04-18 15:58:00 -07:00
Will Chen
aa36986771 fix pnpm command 2025-04-18 10:29:56 -07:00
Will Chen
e1911162e3 Use pnpm and more clean-up of sandbox mode 2025-04-17 17:33:09 -07:00
Will Chen
24c1be224b Remove runtime mode selection & have unified setup flow for node.js + API access 2025-04-17 16:52:20 -07:00
Will Chen
42e179653c Clean up ANSI escape codes from stdout/stderr (interfered with port detection) 2025-04-15 21:48:13 -07:00
Will Chen
26fb5c8dc6 Kill on port 32100 on restart app (clean up orphan process) 2025-04-15 21:42:01 -07:00
Will Chen
52c0893fe5 Restructure reset all so dyad apps deletion is last 2025-04-15 17:16:35 -07:00
Will Chen
6b0df21a05 show version & bump 2025-04-15 00:22:19 -07:00