perf: drop wasted requests and reuse markdown renderers

pr edit with reviewers and other fields reads the pull request once,
org delete counts only repositories, org view counts concurrently,
team list skips the repository count of all-repository teams,
pr diff --web builds the URL locally, pr list re-reads pull requests
concurrently for review fields, and glamour renderers are built once
per width and color.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 18:44:29 +02:00
1 parent af14803b3a
commit 8bf979099b
8 files changed
+104 -47

No files matched your search

+2 -2
View File
@@ -292,11 +292,11 @@ $ tea org delete acme-old --yes`,
if err != nil {
return err
}
size, err := service.Size(cmd.Context(), org.Name)
repos, err := service.RepositoryCount(cmd.Context(), org.Name)
if err != nil {
return err
}
if size.Repositories != nil && *size.Repositories > 0 {
if repos != nil && *repos > 0 {
return &services.ConflictError{Reason: services.ReasonOwnsRepos, Kind: "organization", Key: org.Name, Hint: "transfer or delete them first (see tea repo list " + org.Name + ")"}
}
if err := a.confirmAction(cmd, terminal.Confirmation{