Open merge dialog instantly from pushed merge facts

This commit is contained in:
Ian Gulliver
2026-10-21 11:48:21 -07:00
parent 4bb6f1fa11
commit 890fb6b691
15 changed files with 736 additions and 678 deletions
+3 -36
View File
@@ -67,7 +67,9 @@ func New(dataDir string, portFirst int, ts *tsnet.Server, token string) (*Server
startedAt: time.Now().UTC(),
users: map[string]string{},
}
s.terminals, err = terminal.New(filepath.Join(dataDir, "zsh"), s.terminalsChanged)
s.terminals, err = terminal.New(filepath.Join(dataDir, "zsh"), s.terminalsChanged, func(taskID string) {
s.agents.MarkFacts(taskID)
})
if err != nil {
return nil, err
}
@@ -490,41 +492,6 @@ func (s *Server) GetTask(w http.ResponseWriter, r *http.Request, taskID string)
writeJSON(w, http.StatusOK, t)
}
func (s *Server) GetUnmerged(w http.ResponseWriter, r *http.Request, taskID string) {
t, p, ok := s.activeTaskProject(w, r, taskID)
if !ok {
return
}
u, err := git.UnmergedChanges(t.WorktreePath, p.DefaultBranch)
if err != nil {
writeError(w, http.StatusInternalServerError, err)
return
}
writeJSON(w, http.StatusOK, api.Unmerged{
Commits: u.Commits,
Files: u.Files,
Insertions: u.Insertions,
Deletions: u.Deletions,
Uncommitted: u.Uncommitted,
})
}
func (s *Server) GetCoAuthors(w http.ResponseWriter, r *http.Request, taskID string) {
_, err := s.store.GetTask(r.Context(), taskID)
if err != nil {
writeStoreError(w, err)
return
}
coAuthors, err := s.agents.CoAuthors(r.Context(), taskID, actor(r))
if err != nil {
writeError(w, http.StatusInternalServerError, err)
return
}
writeJSON(w, http.StatusOK, coAuthors)
}
func (s *Server) MergeTask(w http.ResponseWriter, r *http.Request, taskID string) {
req := api.MergeTaskJSONRequestBody{}
if !readJSON(w, r, &req) {