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
This commit is contained in:
@@ -14,7 +14,7 @@ import { useChats } from "./useChats";
|
||||
import { useLoadApp } from "./useLoadApp";
|
||||
import { selectedAppIdAtom } from "@/atoms/appAtoms";
|
||||
import { useVersions } from "./useVersions";
|
||||
import { showUncommittedFilesWarning } from "@/lib/toast";
|
||||
import { showExtraFilesToast } from "@/lib/toast";
|
||||
import { useProposal } from "./useProposal";
|
||||
import { useSearch } from "@tanstack/react-router";
|
||||
import { useRunApp } from "./useRunApp";
|
||||
@@ -87,8 +87,11 @@ export function useStreamChat({
|
||||
setIsPreviewOpen(true);
|
||||
refreshAppIframe();
|
||||
}
|
||||
if (response.uncommittedFiles) {
|
||||
showUncommittedFilesWarning(response.uncommittedFiles);
|
||||
if (response.extraFiles) {
|
||||
showExtraFilesToast({
|
||||
files: response.extraFiles,
|
||||
error: response.extraFilesError,
|
||||
});
|
||||
}
|
||||
refreshProposal(chatId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user