@tequila99/githuman 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/cli/config.js +4 -2
- package/dist/cli/server-runtime.js +1 -0
- package/dist/server/app.js +10 -0
- package/dist/server/config/openapi.js +29 -0
- package/dist/server/repositories/review.repo.js +31 -5
- package/dist/server/routes/agent.js +145 -18
- package/dist/server/routes/app-info.js +8 -1
- package/dist/server/routes/comments.js +73 -27
- package/dist/server/routes/diff.js +58 -31
- package/dist/server/routes/events.js +14 -1
- package/dist/server/routes/export.js +22 -5
- package/dist/server/routes/git.js +52 -21
- package/dist/server/routes/health.js +8 -1
- package/dist/server/routes/openapi.js +4 -0
- package/dist/server/routes/reviews.js +59 -33
- package/dist/server/services/agent/agent-session.js +5 -3
- package/dist/shared/agents/schemas.js +120 -31
- package/dist/shared/app/schemas.js +7 -0
- package/dist/shared/comments/schemas.js +48 -0
- package/dist/shared/diff/schemas.js +77 -0
- package/dist/shared/diff/types.js +0 -3
- package/dist/shared/events/schemas.js +4 -0
- package/dist/shared/git/schemas.js +59 -0
- package/dist/shared/http/schemas.js +23 -0
- package/dist/shared/reviews/schemas.js +96 -0
- package/dist/shared/reviews/summary.js +5 -0
- package/dist/shared/utils/schemas.js +9 -0
- package/dist/web/assets/{AppPage-BNPBe_fi.js → AppPage-BSvF7ik1.js} +1 -1
- package/dist/web/assets/CreateReviewFabButton-M0od1QEZ.js +1 -0
- package/dist/web/assets/{IndexPage-xqMEFqAN.js → IndexPage-Do-EZOBf.js} +1 -1
- package/dist/web/assets/{MainLayout-CMbAu8_d.js → MainLayout-daEN-VtX.js} +1 -1
- package/dist/web/assets/{QMenu-QYPSkHBE.js → QMenu-DXgFwoTJ.js} +1 -1
- package/dist/web/assets/{QSelect-D4U0Of4k.js → QSelect-DzYPZHrW.js} +1 -1
- package/dist/web/assets/ReviewDetailPage-DEtNg2UN.js +1 -0
- package/dist/web/assets/{ReviewsPage-CmHdSBsU.js → ReviewsPage-Dg-iCxsQ.js} +1 -1
- package/dist/web/assets/{StatusSwitcher-CenEW-Lu.js → StatusSwitcher-BpebV47C.js} +3 -3
- package/dist/web/assets/{abnfDiagram-O67JEVCF-C4PFTrGZ.js → abnfDiagram-O67JEVCF-BUX560Qb.js} +1 -1
- package/dist/web/assets/{agent-icon-C1oimBWa.js → agent-icon-BJbyp2DP.js} +3 -3
- package/dist/web/assets/{agent-store-D1WRRYIE.js → agent-store-B9E-aiz3.js} +1 -1
- package/dist/web/assets/{arc-CiNErV2i.js → arc-dElW-85p.js} +1 -1
- package/dist/web/assets/architecture-7GRP2DOG-bgxww3gY.js +1 -0
- package/dist/web/assets/{architectureDiagram-NJMV4G6O-DnAqHYSW.js → architectureDiagram-NJMV4G6O-CUUKpxro.js} +1 -1
- package/dist/web/assets/{blockDiagram-BEXU5L5S-CCN9Ja5L.js → blockDiagram-BEXU5L5S-D4r5wIie.js} +1 -1
- package/dist/web/assets/{c4Diagram-YGBWAQC7-CPzIw79A.js → c4Diagram-YGBWAQC7-ww04LJhe.js} +1 -1
- package/dist/web/assets/channel-CdThk9yc.js +1 -0
- package/dist/web/assets/{chunk-3FUC2YCW-BbeiQKv_.js → chunk-3FUC2YCW-9i3K5FXP.js} +1 -1
- package/dist/web/assets/{chunk-5DYCD2WN-CuzXaWoe.js → chunk-5DYCD2WN-BmtGl0Xn.js} +1 -1
- package/dist/web/assets/{chunk-742MDFTN-DJUCmQfr.js → chunk-742MDFTN-5p0wX5Yc.js} +1 -1
- package/dist/web/assets/{chunk-7INBJB4K-BBd4ghzW.js → chunk-7INBJB4K-CWFVY0jp.js} +1 -1
- package/dist/web/assets/{chunk-7M6MHVWA-B0L68u_O.js → chunk-7M6MHVWA-DUgZIYj4.js} +1 -1
- package/dist/web/assets/{chunk-7PRAP22T-BvEmVPr6.js → chunk-7PRAP22T-BrhA6Tm7.js} +1 -1
- package/dist/web/assets/{chunk-GTNCS2PH-B_vHEKRO.js → chunk-GTNCS2PH-B83nsnuR.js} +1 -1
- package/dist/web/assets/{chunk-GWA4HPMP-DWaW5-VL.js → chunk-GWA4HPMP-cewRmL7f.js} +1 -1
- package/dist/web/assets/{chunk-MBY4JIJT-Dfo1FM_M.js → chunk-MBY4JIJT-D18SeqyB.js} +1 -1
- package/dist/web/assets/{chunk-NETBCI7D-DzjBtXVV.js → chunk-NETBCI7D-5SjiRygT.js} +1 -1
- package/dist/web/assets/{chunk-O7XYJQB3-DY5ZFCJH.js → chunk-O7XYJQB3-H6mLYErS.js} +1 -1
- package/dist/web/assets/{chunk-UA2S7LBM-DX_QjVLS.js → chunk-UA2S7LBM-C5VQVDlC.js} +1 -1
- package/dist/web/assets/{chunk-WEXAMYUT-Cckc2fqg.js → chunk-WEXAMYUT-CrOcvEcH.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-DjF0kpJr.js → chunk-XXDRQBXY-BuVPxQhc.js} +1 -1
- package/dist/web/assets/{chunk-Z7XXMR3K-Do7oG6KK.js → chunk-Z7XXMR3K-BVP3f1-g.js} +1 -1
- package/dist/web/assets/{chunk-ZIGJFQKS-DTcqsqHq.js → chunk-ZIGJFQKS-CF-OzGXH.js} +1 -1
- package/dist/web/assets/{classDiagram-v2-NBCMYWYE-Z6ZhPv4N.js → classDiagram-v2-NBCMYWYE-Bd3VDNaV.js} +1 -1
- package/dist/web/assets/{core-tP7fpdit.js → core-DiiZIGCg.js} +1 -1
- package/dist/web/assets/{cose-bilkent-JH36ORCC-B5DV641c.js → cose-bilkent-JH36ORCC-ifMLrEkd.js} +1 -1
- package/dist/web/assets/{cynefin-OW5HDTMX-BYrEwheK.js → cynefin-OW5HDTMX-6l9c0yRf.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-VND7K2PF-BXbLnUDP.js → cynefinDiagram-VND7K2PF-u9Gy0Odz.js} +1 -1
- package/dist/web/assets/{dagre-6A5THRUB-DJHHAqZU.js → dagre-6A5THRUB-D1jsEBl4.js} +1 -1
- package/dist/web/assets/{diagram-22UHCM2B-DA9deaTX.js → diagram-22UHCM2B-DpyH5n1y.js} +1 -1
- package/dist/web/assets/{diagram-3UASUU5V-C6bo1gN6.js → diagram-3UASUU5V-3X1RJV9-.js} +1 -1
- package/dist/web/assets/{diagram-ATOU4E4O-TTQR35E_.js → diagram-ATOU4E4O-B_bvvAua.js} +1 -1
- package/dist/web/assets/{diagram-CDSNMT55-ChFXwow0.js → diagram-CDSNMT55-DheqAuOA.js} +1 -1
- package/dist/web/assets/{diagram-MLGK6HIB-D3F8BzhV.js → diagram-MLGK6HIB-CYwe9zYy.js} +1 -1
- package/dist/web/assets/{diagram-MPIPVDR6-NJ6F45a1.js → diagram-MPIPVDR6-CVd9i23e.js} +1 -1
- package/dist/web/assets/{dist-Besl4xjp.js → dist-BzuUT3GV.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-ZINNZB2B-u2e1UzYe.js → ebnfDiagram-ZINNZB2B-B5vtXULf.js} +1 -1
- package/dist/web/assets/{elk-276RUBZZ-tCLm9cCU.js → elk-276RUBZZ-BmMM0tV5.js} +1 -1
- package/dist/web/assets/{engine-oniguruma-DaaPGLR3.js → engine-oniguruma-D6DCTEub.js} +1 -1
- package/dist/web/assets/{erDiagram-OPXOYQCR-ChNVjKDe.js → erDiagram-OPXOYQCR-1ORPVLQR.js} +1 -1
- package/dist/web/assets/eventmodeling-NTZA5JFV-BH97sTDs.js +1 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-CRwhE8ka.js +1 -0
- package/dist/web/assets/{ganttDiagram-FUAMR5RP-8mcAm2ao.js → ganttDiagram-FUAMR5RP-CAWNdy1S.js} +1 -1
- package/dist/web/assets/{gitGraph-4MIJSDKK-DtM1RZrd.js → gitGraph-4MIJSDKK-CXCCnZ1j.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-X574FWY7-C7KXkLLU.js → gitGraphDiagram-X574FWY7-DPDrqSt6.js} +1 -1
- package/dist/web/assets/{i18n-BmgFD4Gx.js → i18n-D5wmXwHr.js} +1 -1
- package/dist/web/assets/{index-CuqF4_ks.js → index-DWi4DKrl.js} +2 -2
- package/dist/web/assets/{info-A6RAGUB7-C5tVl8cQ.js → info-A6RAGUB7-CGg3Xa4X.js} +1 -1
- package/dist/web/assets/{infoDiagram-VRGFBTTK-DO4D3mI7.js → infoDiagram-VRGFBTTK-vx9EUrdV.js} +1 -1
- package/dist/web/assets/{init-app-C0kkg1Ie.js → init-app-CgDkvlRb.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-OU5B5YK6-DA2H3Eih.js → ishikawaDiagram-OU5B5YK6-DL7T0J63.js} +1 -1
- package/dist/web/assets/{journeyDiagram-ZHPQQLJL-CdPvR3Sr.js → journeyDiagram-ZHPQQLJL-D45T1Pj5.js} +1 -1
- package/dist/web/assets/{kanban-definition-PNTS6WVX-BRIiazVf.js → kanban-definition-PNTS6WVX-C9ZnTE1l.js} +1 -1
- package/dist/web/assets/{line-CmXhYhmh.js → line-CLBEcmiH.js} +1 -1
- package/dist/web/assets/{linear-Cyx-ptw-.js → linear-B5bBEu0i.js} +1 -1
- package/dist/web/assets/{mermaid-parser.core-CZ05RARR.js → mermaid-parser.core-Dj-n65Ou.js} +3 -3
- package/dist/web/assets/{mermaid.core-ZosqiKX-.js → mermaid.core-CmPsESsw.js} +4 -4
- package/dist/web/assets/{mindmap-definition-NLK3R4M7-a7nG9rPn.js → mindmap-definition-NLK3R4M7-ZX638ce_.js} +1 -1
- package/dist/web/assets/{packet-AYTQ26CC-yIJsAali.js → packet-AYTQ26CC-D-XZHUq_.js} +1 -1
- package/dist/web/assets/{pegDiagram-GJSIUBJH-CBdB4i41.js → pegDiagram-GJSIUBJH-sE-EOKNL.js} +1 -1
- package/dist/web/assets/{pie-WAS4IAKB-ybMEHYPX.js → pie-WAS4IAKB-DMkVggJA.js} +1 -1
- package/dist/web/assets/{pieDiagram-5QR66LMP-BfiG4Lho.js → pieDiagram-5QR66LMP-DSdIEQyS.js} +1 -1
- package/dist/web/assets/pinia-BMN9Drn3.js +1 -0
- package/dist/web/assets/{quadrantDiagram-O4NWA36T-7A6x_hoF.js → quadrantDiagram-O4NWA36T-BReXSVss.js} +1 -1
- package/dist/web/assets/{radar-RG4KPBEZ-BbeFIczu.js → radar-RG4KPBEZ-CJzPwlj6.js} +1 -1
- package/dist/web/assets/{railroad-74A4TZTK-CAyDA7Zz.js → railroad-74A4TZTK-CkhRuR3N.js} +1 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-CcS8fVgm.js +1 -0
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-BlpYA103.js +1 -0
- package/dist/web/assets/railroad-peg-WCYAUIDC-C2EznudM.js +1 -0
- package/dist/web/assets/{railroadDiagram-XR7U4H2S-BXiOJ_AA.js → railroadDiagram-XR7U4H2S-DCoF4AEN.js} +1 -1
- package/dist/web/assets/{requirementDiagram-PLB6GJNP-bQNGcpuV.js → requirementDiagram-PLB6GJNP-B15aXZXI.js} +1 -1
- package/dist/web/assets/{safe-storage-CqQMHcn7.js → safe-storage-ak36tVRO.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-IPEJSGJF-CgfGV4TY.js → sankeyDiagram-IPEJSGJF-DcWsnYYP.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-PO4LG4MO-BdCuKkDZ.js → sequenceDiagram-PO4LG4MO-CXWUNmSl.js} +1 -1
- package/dist/web/assets/{src-AvcVSqt3.js → src-CB-shhJB.js} +1 -1
- package/dist/web/assets/{stateDiagram-v2-GCMORJYK-aj1Op7xi.js → stateDiagram-v2-GCMORJYK-M9PkKdix.js} +1 -1
- package/dist/web/assets/{swimlanes-2SLR337P-DQ_YYhZu.js → swimlanes-2SLR337P-B13LpAqh.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-BmCQPnJC.js +8 -0
- package/dist/web/assets/theme-BMaTNJdz.js +1 -0
- package/dist/web/assets/{timeline-definition-EJHVYXUP-Bk3Mvy3w.js → timeline-definition-EJHVYXUP-Dli0jMaX.js} +1 -1
- package/dist/web/assets/{treeView-Q6P3EWNA-BzM7oZcT.js → treeView-Q6P3EWNA-BwBFpWIC.js} +1 -1
- package/dist/web/assets/{treemap-WGGIJYW6-DzgzhZei.js → treemap-WGGIJYW6-DYGjPuTv.js} +1 -1
- package/dist/web/assets/{use-app-theme-DEiGbVuj.js → use-app-theme-C9HTPdVu.js} +1 -1
- package/dist/web/assets/{use-panel-width-ujFPWf-l.js → use-panel-width-DGbjs_T8.js} +1 -1
- package/dist/web/assets/{usecaseDiagram-POWQR4AR-kriFnh7L.js → usecaseDiagram-POWQR4AR-Chs4O-o-.js} +1 -1
- package/dist/web/assets/{vennDiagram-UO4OBE2U-CDdCMQs7.js → vennDiagram-UO4OBE2U-D3GVZcIr.js} +1 -1
- package/dist/web/assets/{wardley-WFR3VGLG-BUWTYQyf.js → wardley-WFR3VGLG-B5YUEVo5.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-VNRHLVJA-CW7lMcTj.js → wardleyDiagram-VNRHLVJA-liqH-4lm.js} +1 -1
- package/dist/web/assets/{xychartDiagram-PMCCYNJV-DoIu8J_3.js → xychartDiagram-PMCCYNJV-C63N6ZvA.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +2 -2
- package/dist/web/assets/CreateReviewFabButton-3V9ZYSHd.js +0 -1
- package/dist/web/assets/ReviewDetailPage-DSCeLI9D.js +0 -1
- package/dist/web/assets/architecture-7GRP2DOG-DORh0iBM.js +0 -1
- package/dist/web/assets/channel-WV0H_O-w.js +0 -1
- package/dist/web/assets/eventmodeling-NTZA5JFV-KBTHxbEB.js +0 -1
- package/dist/web/assets/flowDiagram-KWPJA3E3-DM-yXypD.js +0 -1
- package/dist/web/assets/pinia-r4XAEwbB.js +0 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-BzS6thC5.js +0 -1
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-MS09sAPW.js +0 -1
- package/dist/web/assets/railroad-peg-WCYAUIDC-DEQwqbcE.js +0 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-9frEtrG_.js +0 -8
- package/dist/web/assets/theme-BSjPUW3f.js +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { Nullable } from "../utils/schemas.js";
|
|
3
|
+
import { DiffLineTypeSchema } from "../diff/schemas.js";
|
|
4
|
+
export const CommentSchema = Type.Object({
|
|
5
|
+
id: Type.String({ description: 'Comment id.' }),
|
|
6
|
+
reviewId: Type.String({ description: 'Review that holds the comment.' }),
|
|
7
|
+
filePath: Type.String({ description: 'Repository-relative file path.' }),
|
|
8
|
+
lineNumber: Nullable(Type.Integer({
|
|
9
|
+
description: 'First line of the comment. Null for a file comment.'
|
|
10
|
+
})),
|
|
11
|
+
lineNumberEnd: Nullable(Type.Integer({
|
|
12
|
+
description: 'Last line of a selected range. Equals lineNumber for one line.'
|
|
13
|
+
})),
|
|
14
|
+
lineType: Nullable(DiffLineTypeSchema),
|
|
15
|
+
content: Type.String({ description: 'Comment text in markdown.' }),
|
|
16
|
+
createdAt: Type.String({ description: 'Creation time, ISO 8601.' }),
|
|
17
|
+
updatedAt: Type.String({ description: 'Last change time, ISO 8601.' }),
|
|
18
|
+
resolved: Type.Optional(Type.Boolean({ description: 'The comment is resolved.' })),
|
|
19
|
+
suggestion: Type.Optional(Nullable(Type.String({ description: 'Code that replaces the selected lines.' })))
|
|
20
|
+
}, { description: 'A comment on a file or on lines of a review.' });
|
|
21
|
+
// Null goes first in each union: Fastify's Ajv coerces types, and with
|
|
22
|
+
// Integer (or String) first it turns a JSON null into 0 (or "") before the
|
|
23
|
+
// Null branch is ever tried — a file-level comment would be stored as line 0.
|
|
24
|
+
export const CreateCommentBody = Type.Object({
|
|
25
|
+
filePath: Type.String({
|
|
26
|
+
minLength: 1,
|
|
27
|
+
description: 'Repository-relative file path.'
|
|
28
|
+
}),
|
|
29
|
+
lineNumber: Type.Optional(Type.Union([Type.Null(), Type.Integer()], {
|
|
30
|
+
description: 'First line. Null or omitted for a file comment.'
|
|
31
|
+
})),
|
|
32
|
+
lineNumberEnd: Type.Optional(Type.Union([Type.Null(), Type.Integer()], {
|
|
33
|
+
description: 'Last line of a range. Null or omitted for one line.'
|
|
34
|
+
})),
|
|
35
|
+
lineType: Type.Optional(Type.Union([Type.Null(), ...DiffLineTypeSchema.anyOf], {
|
|
36
|
+
description: 'Line kind of lineNumber. Null for a file comment.'
|
|
37
|
+
})),
|
|
38
|
+
content: Type.String({ description: 'Comment text in markdown.' }),
|
|
39
|
+
suggestion: Type.Optional(Type.Union([Type.Null(), Type.String()], {
|
|
40
|
+
description: 'Code that replaces the selected lines.'
|
|
41
|
+
}))
|
|
42
|
+
}, { description: 'A new comment.' });
|
|
43
|
+
export const UpdateCommentBody = Type.Object({
|
|
44
|
+
content: Type.String({ description: 'New comment text in markdown.' })
|
|
45
|
+
}, { description: 'A comment change.' });
|
|
46
|
+
export const CommentIdParams = Type.Object({
|
|
47
|
+
id: Type.String({ description: 'Comment id.' })
|
|
48
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { Nullable } from "../utils/schemas.js";
|
|
3
|
+
export const DiffSourceNameSchema = Type.Union([Type.Literal('staged'), Type.Literal('unstaged')], { description: 'Side of the working tree: the index or the files on disk.' });
|
|
4
|
+
export const DiffLineTypeSchema = Type.Union([Type.Literal('added'), Type.Literal('removed'), Type.Literal('context')], { description: 'Line kind: added, removed or unchanged context.' });
|
|
5
|
+
export const DiffFileStatusSchema = Type.Union([
|
|
6
|
+
Type.Literal('added'),
|
|
7
|
+
Type.Literal('modified'),
|
|
8
|
+
Type.Literal('deleted'),
|
|
9
|
+
Type.Literal('renamed')
|
|
10
|
+
], { description: 'What the change does to the file.' });
|
|
11
|
+
export const DiffLineSchema = Type.Object({
|
|
12
|
+
type: DiffLineTypeSchema,
|
|
13
|
+
content: Type.String({
|
|
14
|
+
description: 'Line text without the "+", "-" or " " prefix.'
|
|
15
|
+
}),
|
|
16
|
+
oldLineNumber: Nullable(Type.Integer({
|
|
17
|
+
description: 'Line number in the old file. Null for an added line.'
|
|
18
|
+
})),
|
|
19
|
+
newLineNumber: Nullable(Type.Integer({
|
|
20
|
+
description: 'Line number in the new file. Null for a removed line.'
|
|
21
|
+
}))
|
|
22
|
+
}, { description: 'One line of a hunk.' });
|
|
23
|
+
export const DiffHunkSchema = Type.Object({
|
|
24
|
+
oldStart: Type.Integer({ description: 'First line in the old file.' }),
|
|
25
|
+
oldLines: Type.Integer({ description: 'Line count in the old file.' }),
|
|
26
|
+
newStart: Type.Integer({ description: 'First line in the new file.' }),
|
|
27
|
+
newLines: Type.Integer({ description: 'Line count in the new file.' }),
|
|
28
|
+
lines: Type.Array(DiffLineSchema, {
|
|
29
|
+
description: 'Lines of the hunk in file order.'
|
|
30
|
+
})
|
|
31
|
+
}, { description: 'One hunk of a file diff.' });
|
|
32
|
+
const diffFileFields = {
|
|
33
|
+
oldPath: Type.String({
|
|
34
|
+
description: 'Path before the change. Equals newPath unless renamed.'
|
|
35
|
+
}),
|
|
36
|
+
newPath: Type.String({
|
|
37
|
+
description: 'Path after the change. Equals oldPath for a deleted file.'
|
|
38
|
+
}),
|
|
39
|
+
status: DiffFileStatusSchema,
|
|
40
|
+
additions: Type.Integer({ description: 'Added line count.' }),
|
|
41
|
+
deletions: Type.Integer({ description: 'Removed line count.' }),
|
|
42
|
+
isBinary: Type.Boolean({ description: 'Git sees the file as binary.' })
|
|
43
|
+
};
|
|
44
|
+
export const DiffFileSchema = Type.Object({
|
|
45
|
+
...diffFileFields,
|
|
46
|
+
hunks: Type.Array(DiffHunkSchema, {
|
|
47
|
+
description: 'Hunks of the file. Empty for a binary file.'
|
|
48
|
+
})
|
|
49
|
+
}, { description: 'Diff of one file with its hunks.' });
|
|
50
|
+
export const DiffFileSummarySchema = Type.Object({
|
|
51
|
+
...diffFileFields,
|
|
52
|
+
signature: Type.String({
|
|
53
|
+
description: 'Changes when the file content or its diff changes. Equal signatures mean equal hunks.'
|
|
54
|
+
})
|
|
55
|
+
}, { description: 'Diff of one file without hunks.' });
|
|
56
|
+
export const SourceParams = Type.Object({ source: DiffSourceNameSchema });
|
|
57
|
+
export const FileQuery = Type.Object({
|
|
58
|
+
path: Type.String({
|
|
59
|
+
minLength: 1,
|
|
60
|
+
description: 'Repository-relative path after the change.'
|
|
61
|
+
}),
|
|
62
|
+
oldPath: Type.Optional(Type.String({
|
|
63
|
+
minLength: 1,
|
|
64
|
+
description: 'Repository-relative path before a rename.'
|
|
65
|
+
})),
|
|
66
|
+
status: DiffFileStatusSchema
|
|
67
|
+
});
|
|
68
|
+
export const BranchQuery = Type.Object({
|
|
69
|
+
base: Type.String({
|
|
70
|
+
minLength: 1,
|
|
71
|
+
description: 'Ref that the diff compares HEAD with.'
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
export const CommitsQuery = Type.Object({
|
|
75
|
+
from: Type.String({ minLength: 1, description: 'Older ref.' }),
|
|
76
|
+
to: Type.String({ minLength: 1, description: 'Newer ref.' })
|
|
77
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
export const EventStreamSchema = Type.String({
|
|
3
|
+
description: 'Server-sent events. The first event is connected with { instanceId } data. Then come review:created, review:updated, review:deleted, comment:created, comment:updated and comment:deleted with { reviewId } data, and files:changed with {} data.'
|
|
4
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { Nullable } from "../utils/schemas.js";
|
|
3
|
+
export const RepositoryInfoSchema = Type.Object({
|
|
4
|
+
name: Type.String({ description: 'Name of the repository directory.' }),
|
|
5
|
+
branch: Type.String({ description: 'Current branch.' }),
|
|
6
|
+
remote: Nullable(Type.String({
|
|
7
|
+
description: 'Fetch URL of the origin remote. Null if none.'
|
|
8
|
+
})),
|
|
9
|
+
path: Type.String({ description: 'Absolute path of the repository.' })
|
|
10
|
+
}, { description: 'The repository that the server shows.' });
|
|
11
|
+
export const FileTreeResponseSchema = Type.Object({
|
|
12
|
+
ref: Type.String({ description: 'Ref from the request.' }),
|
|
13
|
+
files: Type.Array(Type.String(), {
|
|
14
|
+
description: 'Repository-relative paths of all files at the ref.'
|
|
15
|
+
})
|
|
16
|
+
}, { description: 'Files of the repository at a ref.' });
|
|
17
|
+
export const FileContentResponseSchema = Type.Object({
|
|
18
|
+
path: Type.String({ description: 'Repository-relative path.' }),
|
|
19
|
+
ref: Type.String({ description: 'Ref from the request.' }),
|
|
20
|
+
content: Type.String({
|
|
21
|
+
description: 'Full file text. Empty for a binary file or a file that is not at the ref.'
|
|
22
|
+
}),
|
|
23
|
+
lines: Type.Array(Type.String(), {
|
|
24
|
+
description: 'Lines of the text. Empty for a binary file.'
|
|
25
|
+
}),
|
|
26
|
+
lineCount: Type.Integer({ description: 'Length of lines.' }),
|
|
27
|
+
isBinary: Type.Boolean({ description: 'The file is binary.' })
|
|
28
|
+
}, { description: 'One file at a ref.' });
|
|
29
|
+
export const OkSchema = Type.Object({
|
|
30
|
+
ok: Type.Literal(true, { description: 'Always true.' })
|
|
31
|
+
}, { description: 'The git command succeeded.' });
|
|
32
|
+
export const TreeParams = Type.Object({
|
|
33
|
+
ref: Type.String({
|
|
34
|
+
minLength: 1,
|
|
35
|
+
description: 'Commit, branch or tag. INDEX lists the index, WORKTREE the files on disk.'
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
export const FileParams = Type.Object({
|
|
39
|
+
'*': Type.String({
|
|
40
|
+
description: 'Repository-relative path. Slashes stay literal.'
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
export const FileContentQuery = Type.Object({
|
|
44
|
+
ref: Type.String({
|
|
45
|
+
minLength: 1,
|
|
46
|
+
description: 'Commit, branch or tag. INDEX reads the index, WORKTREE the file on disk.'
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
export const OptionalPathsBody = Type.Object({
|
|
50
|
+
paths: Type.Optional(Type.Array(Type.String(), {
|
|
51
|
+
description: 'Repository-relative paths. Omitted or empty means all.'
|
|
52
|
+
}))
|
|
53
|
+
}, { description: 'Paths for stage or unstage.' });
|
|
54
|
+
export const DiscardBody = Type.Object({
|
|
55
|
+
paths: Type.Array(Type.String(), {
|
|
56
|
+
minItems: 1,
|
|
57
|
+
description: 'Repository-relative paths. Required: there is no "discard all".'
|
|
58
|
+
})
|
|
59
|
+
}, { description: 'Paths to discard.' });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
/** Fields of the error body that Fastify writes for each error. */
|
|
3
|
+
const API_ERROR_FIELDS = {
|
|
4
|
+
statusCode: Type.Integer({ description: 'HTTP status code.' }),
|
|
5
|
+
code: Type.Optional(Type.String({
|
|
6
|
+
description: 'Stable error code, for example GHT_HTTP_NOT_FOUND.'
|
|
7
|
+
})),
|
|
8
|
+
error: Type.String({ description: 'HTTP status text.' }),
|
|
9
|
+
message: Type.String({ description: 'What went wrong.' })
|
|
10
|
+
};
|
|
11
|
+
/** Error answers that every route can give. */
|
|
12
|
+
export const ERROR_RESPONSES = {
|
|
13
|
+
'4xx': Type.Object(API_ERROR_FIELDS, {
|
|
14
|
+
description: 'The request is not valid.'
|
|
15
|
+
}),
|
|
16
|
+
'5xx': Type.Object(API_ERROR_FIELDS, { description: 'The server failed.' })
|
|
17
|
+
};
|
|
18
|
+
export const ApiErrorSchema = Type.Object(API_ERROR_FIELDS, {
|
|
19
|
+
description: 'Error body of every route.'
|
|
20
|
+
});
|
|
21
|
+
export const NoContentSchema = Type.Null({
|
|
22
|
+
description: 'The request succeeded. The body is empty.'
|
|
23
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { Nullable } from "../utils/schemas.js";
|
|
3
|
+
import { CommentSchema } from "../comments/schemas.js";
|
|
4
|
+
export const ReviewStatusSchema = Type.Union([
|
|
5
|
+
Type.Literal('in_progress'),
|
|
6
|
+
Type.Literal('approved'),
|
|
7
|
+
Type.Literal('changes_requested')
|
|
8
|
+
], { description: 'Review state.' });
|
|
9
|
+
/**
|
|
10
|
+
* 'local' snapshots staged + unstaged diffs together — the only source type
|
|
11
|
+
* the "Start review" UI offers, since a review's comments apply to both
|
|
12
|
+
* regardless of which tab they were left on (see ADR 0018). 'staged'/
|
|
13
|
+
* 'unstaged' remain valid API inputs (kept for API callers that want one
|
|
14
|
+
* side only) but have no UI entry point anymore. 'branch'/'commits' are
|
|
15
|
+
* unrelated future-MVP source types (ADR 0017), unaffected by this.
|
|
16
|
+
*/
|
|
17
|
+
export const ReviewSourceTypeSchema = Type.Union([
|
|
18
|
+
Type.Literal('local'),
|
|
19
|
+
Type.Literal('staged'),
|
|
20
|
+
Type.Literal('unstaged'),
|
|
21
|
+
Type.Literal('branch'),
|
|
22
|
+
Type.Literal('commits')
|
|
23
|
+
], {
|
|
24
|
+
description: 'Diff in the snapshot: local (staged and unstaged), one side, a branch or commits.'
|
|
25
|
+
});
|
|
26
|
+
const reviewSummaryFields = {
|
|
27
|
+
id: Type.String({ description: 'Review id.' }),
|
|
28
|
+
repositoryPath: Type.String({
|
|
29
|
+
description: 'Absolute repository path at creation.'
|
|
30
|
+
}),
|
|
31
|
+
baseRef: Nullable(Type.String({
|
|
32
|
+
description: 'Base ref for branch or commits reviews. Else null.'
|
|
33
|
+
})),
|
|
34
|
+
sourceType: ReviewSourceTypeSchema,
|
|
35
|
+
sourceRef: Nullable(Type.String({
|
|
36
|
+
description: 'Branch name for branch, the newer ref ("to") for commits. Else null.'
|
|
37
|
+
})),
|
|
38
|
+
status: ReviewStatusSchema,
|
|
39
|
+
name: Nullable(Type.String({
|
|
40
|
+
description: 'User or generated name ("source + date/time"). Unique within branch.'
|
|
41
|
+
})),
|
|
42
|
+
branch: Nullable(Type.String({
|
|
43
|
+
description: 'Branch at creation. The server does not update it.'
|
|
44
|
+
})),
|
|
45
|
+
createdAt: Type.String({ description: 'Creation time, ISO 8601.' }),
|
|
46
|
+
updatedAt: Type.String({ description: 'Last change time, ISO 8601.' })
|
|
47
|
+
};
|
|
48
|
+
export const ReviewSummarySchema = Type.Object(reviewSummaryFields, {
|
|
49
|
+
description: 'A review without its snapshot.'
|
|
50
|
+
});
|
|
51
|
+
export const ReviewSchema = Type.Object({
|
|
52
|
+
...reviewSummaryFields,
|
|
53
|
+
snapshotData: Type.String({
|
|
54
|
+
description: 'JSON array of DiffFile, frozen at creation.'
|
|
55
|
+
})
|
|
56
|
+
}, { description: 'A review with its diff snapshot.' });
|
|
57
|
+
export const ReviewExportSchema = Type.Object({
|
|
58
|
+
review: ReviewSchema,
|
|
59
|
+
comments: Type.Array(CommentSchema, {
|
|
60
|
+
description: 'All comments of the review.'
|
|
61
|
+
})
|
|
62
|
+
}, { description: 'A review and its comments as JSON.' });
|
|
63
|
+
export const CreateReviewBody = Type.Object({
|
|
64
|
+
sourceType: Type.Optional(ReviewSourceTypeSchema),
|
|
65
|
+
sourceRef: Type.Optional(Type.String({
|
|
66
|
+
description: 'Branch name for branch, or the newer ref ("to") for commits.'
|
|
67
|
+
})),
|
|
68
|
+
baseRef: Type.Optional(Type.String({
|
|
69
|
+
description: 'Required for branch and commits: the base ref or the older ref ("from").'
|
|
70
|
+
})),
|
|
71
|
+
name: Type.Optional(Type.String({
|
|
72
|
+
description: 'Review name. Omitted or blank: the server makes one.'
|
|
73
|
+
}))
|
|
74
|
+
}, { description: 'A new review. sourceType defaults to local.' });
|
|
75
|
+
export const ReviewsQuery = Type.Object({
|
|
76
|
+
branch: Type.Optional(Type.String({ description: 'Branch filter. Default: current branch.' })),
|
|
77
|
+
search: Type.Optional(Type.String({
|
|
78
|
+
description: 'Text to find in review names, case-insensitive.'
|
|
79
|
+
})),
|
|
80
|
+
createdFrom: Type.Optional(Type.String({ description: 'Earliest creation time, ISO 8601.' })),
|
|
81
|
+
createdTo: Type.Optional(Type.String({ description: 'Latest creation time, ISO 8601.' })),
|
|
82
|
+
files: Type.Optional(Type.String({
|
|
83
|
+
description: 'Comma-separated file paths. A review matches if its snapshot has one of them.'
|
|
84
|
+
}))
|
|
85
|
+
});
|
|
86
|
+
export const UpdateReviewBody = Type.Object({
|
|
87
|
+
status: Type.Optional(ReviewStatusSchema)
|
|
88
|
+
}, { description: 'A review change. status is required.' });
|
|
89
|
+
export const ReviewIdParams = Type.Object({
|
|
90
|
+
id: Type.String({ description: 'Review id.' })
|
|
91
|
+
});
|
|
92
|
+
export const ExportQuery = Type.Object({
|
|
93
|
+
format: Type.Union([Type.Literal('json'), Type.Literal('markdown')], {
|
|
94
|
+
description: 'json gives the review and comments, markdown a report.'
|
|
95
|
+
})
|
|
96
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* A nullable value for a response schema. Request schemas put `Type.Null()`
|
|
4
|
+
* first instead, because Fastify's Ajv coerces null into the first type.
|
|
5
|
+
*/
|
|
6
|
+
export function Nullable(schema) {
|
|
7
|
+
const { description } = schema;
|
|
8
|
+
return Type.Union([schema, Type.Null()], typeof description === 'string' ? { description } : {});
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,I as t,N as n,g as r,it as i,l as a,lt as o,nt as s,q as c,s as l,x as u,y as d}from"./runtime-core.esm-bundler-CUpq88z7.js";import{E as f,O as p,_ as m,j as h,t as g}from"./QBtn-BDbJU6_B.js";import{t as _}from"./create-BkZH2Q0U.js";import{n as v}from"./vue-i18n.runtime-D0pkhc7g.js";import{n as y}from"./pinia-DmTi2T44.js";import{c as b,i as x,l as S,o as C,s as w,t as T}from"./single-flight-r8B7stt1.js";function E(e){if(e.length<2||e[0]!==`"`||e[e.length-1]!==`"`)return e;let t=e.slice(1,-1),n=[];for(let e=0;e<t.length;e++){let r=t[e];r===`\\`&&/^[0-7]{3}$/.test(t.slice(e+1,e+4))?(n.push(parseInt(t.slice(e+1,e+4),8)),e+=3):r===`\\`&&t[e+1]===`"`?(n.push(34),e+=1):r===`\\`&&t[e+1]===`\\`?(n.push(92),e+=1):n.push((r??``).charCodeAt(0))}return new TextDecoder(`utf-8`).decode(new Uint8Array(n))}function D(e){return e.newPath||e.oldPath}function O(e,t){return`${e}:${t}`}function k(e){return{...e,oldPath:E(e.oldPath),newPath:E(e.newPath)}}function A(e){let{signature:t,...n}=e;return{...n,hunks:[]}}function j(e,t,n){let r=new Map(e.map(e=>[D(e),e])),i=new Map;return{files:n.map(e=>{let n=D(e);i.set(n,e.signature);let a=r.get(n);return a&&t.get(n)===e.signature?a:A(e)}),signatures:i}}var M=y(`diff`,()=>{let e=s([]),t=s([]),n=new Map,r=new Map,a=s(!1),o=s(!1),c=s(null),u=l(()=>a.value&&!o.value),d=l(()=>[...e.value,...t.value].map(e=>e.newPath||e.oldPath)),f=i(new Map),p=i(new Map),m=new Map;function h(n){return n===`staged`?e.value:t.value}function g(e,t){return f.value.get(O(e,D(t)))?.file}function _(e,t){return f.value.get(O(e,D(t)))?.for===t}function v(e,t){let n=p.value.get(O(e,D(t)));return n?.for===t?n.message:void 0}function y(e,t){let n=O(e,D(t));if(!p.value.has(n))return;let r=new Map(p.value);r.delete(n),p.value=r}function b(e,t){return y(e,t),S(e,t)}async function S(e,t){let n=O(e,D(t));if(_(e,t)||m.get(n)===t)return;m.set(n,t);let r=new URLSearchParams({path:t.newPath,oldPath:t.oldPath,status:t.status});try{let i=k(await w(`/api/diff/${e}/file?${r}`));if(!h(e).includes(t))return;f.value=new Map(f.value).set(n,{file:i,for:t}),y(e,t)}catch(r){if(!h(e).includes(t))return;p.value=new Map(p.value).set(n,{message:x(r),for:t})}finally{m.get(n)===t&&m.delete(n)}}function C(){let n=new Set([...e.value.map(e=>O(`staged`,D(e))),...t.value.map(e=>O(`unstaged`,D(e)))]),r=new Map([...f.value].filter(([e])=>n.has(e)));r.size!==f.value.size&&(f.value=r);let i=new Map([...p.value].filter(([e])=>n.has(e)));i.size!==p.value.size&&(p.value=i)}let E=T(A);async function A(){a.value=!0;try{let[i,a]=await Promise.all([w(`/api/diff/staged/files`),w(`/api/diff/unstaged/files`)]),o=j(e.value,n,i.map(k)),s=j(t.value,r,a.map(k));e.value=o.files,n=o.signatures,t.value=s.files,r=s.signatures,C(),c.value=null}catch(i){o.value||(e.value=[],t.value=[],n=new Map,r=new Map),c.value=x(i)}finally{a.value=!1,o.value=!0}}return{stagedFiles:e,unstagedFiles:t,loading:a,loaded:o,initialLoading:u,error:c,changedPaths:d,hunksOf:g,hunksFresh:_,hunksError:v,clearHunksError:y,ensureHunks:S,retryHunks:b,fetchDiff:E}})
|
|
1
|
+
import{C as e,I as t,N as n,g as r,it as i,l as a,lt as o,nt as s,q as c,s as l,x as u,y as d}from"./runtime-core.esm-bundler-CUpq88z7.js";import{E as f,O as p,_ as m,j as h,t as g}from"./QBtn-BDbJU6_B.js";import{t as _}from"./create-BkZH2Q0U.js";import{n as v}from"./vue-i18n.runtime-D0pkhc7g.js";import{n as y}from"./pinia-DmTi2T44.js";import{c as b,i as x,l as S,o as C,s as w,t as T}from"./single-flight-r8B7stt1.js";function E(e){if(e.length<2||e[0]!==`"`||e[e.length-1]!==`"`)return e;let t=e.slice(1,-1),n=[];for(let e=0;e<t.length;e++){let r=t[e];r===`\\`&&/^[0-7]{3}$/.test(t.slice(e+1,e+4))?(n.push(parseInt(t.slice(e+1,e+4),8)),e+=3):r===`\\`&&t[e+1]===`"`?(n.push(34),e+=1):r===`\\`&&t[e+1]===`\\`?(n.push(92),e+=1):n.push((r??``).charCodeAt(0))}return new TextDecoder(`utf-8`).decode(new Uint8Array(n))}function D(e){return e.newPath||e.oldPath}function O(e,t){return`${e}:${t}`}function k(e){return{...e,oldPath:E(e.oldPath),newPath:E(e.newPath)}}function A(e){let{signature:t,...n}=e;return{...n,hunks:[]}}function j(e,t,n){let r=new Map(e.map(e=>[D(e),e])),i=new Map;return{files:n.map(e=>{let n=D(e);i.set(n,e.signature);let a=r.get(n);return a&&t.get(n)===e.signature?a:A(e)}),signatures:i}}var M=y(`diff`,()=>{let e=s([]),t=s([]),n=new Map,r=new Map,a=s(!1),o=s(!1),c=s(null),u=l(()=>a.value&&!o.value),d=l(()=>[...e.value,...t.value].map(e=>e.newPath||e.oldPath)),f=i(new Map),p=i(new Map),m=new Map;function h(n){return n===`staged`?e.value:t.value}function g(e,t){return f.value.get(O(e,D(t)))?.file}function _(e,t){return f.value.get(O(e,D(t)))?.for===t}function v(e,t){let n=p.value.get(O(e,D(t)));return n?.for===t?n.message:void 0}function y(e,t){let n=O(e,D(t));if(!p.value.has(n))return;let r=new Map(p.value);r.delete(n),p.value=r}function b(e,t){return y(e,t),S(e,t)}async function S(e,t){let n=O(e,D(t));if(_(e,t)||m.get(n)===t)return;m.set(n,t);let r=new URLSearchParams({path:t.newPath,oldPath:t.oldPath,status:t.status});try{let i=k(await w(`/api/diff/${e}/file?${r}`));if(!h(e).includes(t))return;f.value=new Map(f.value).set(n,{file:i,for:t}),y(e,t)}catch(r){if(!h(e).includes(t))return;p.value=new Map(p.value).set(n,{message:x(r),for:t})}finally{m.get(n)===t&&m.delete(n)}}function C(){let n=new Set([...e.value.map(e=>O(`staged`,D(e))),...t.value.map(e=>O(`unstaged`,D(e)))]),r=new Map([...f.value].filter(([e])=>n.has(e)));r.size!==f.value.size&&(f.value=r);let i=new Map([...p.value].filter(([e])=>n.has(e)));i.size!==p.value.size&&(p.value=i)}let E=T(A);async function A(){a.value=!0;try{let[i,a]=await Promise.all([w(`/api/diff/staged/files`),w(`/api/diff/unstaged/files`)]),o=j(e.value,n,i.map(k)),s=j(t.value,r,a.map(k));e.value=o.files,n=o.signatures,t.value=s.files,r=s.signatures,C(),c.value=null}catch(i){o.value||(e.value=[],t.value=[],n=new Map,r=new Map),c.value=x(i)}finally{a.value=!1,o.value=!0}}return{stagedFiles:e,unstagedFiles:t,loading:a,loaded:o,initialLoading:u,error:c,changedPaths:d,hunksOf:g,hunksFresh:_,hunksError:v,clearHunksError:y,ensureHunks:S,retryHunks:b,fetchDiff:E}});function N(e){let{snapshotData:t,...n}=e;return n}var P=y(`active-review`,()=>{let e=s(null),t=s([]),n=s(!1),r=l(()=>{let e=new Map;for(let n of t.value){let t=e.get(n.filePath);t?t.push(n):e.set(n.filePath,[n])}return e});async function i(){n.value=!0;try{let n=(await w(`/api/reviews`)).filter(e=>e.status===`in_progress`).sort((e,t)=>t.createdAt.localeCompare(e.createdAt));e.value=n[0]??null,t.value=e.value?await w(`/api/reviews/${e.value.id}/comments`):[]}finally{n.value=!1}}function a(n){e.value=N(n),t.value=[]}async function o(t){e.value&&(await b(`/api/reviews/${e.value.id}`,{status:t}),await i())}async function c(n){if(!e.value)throw Error(`No active review`);let r=await S(`/api/reviews/${e.value.id}/comments`,n);return t.value=[...t.value,r],r}async function u(e,n){let r=await b(`/api/comments/${e}`,{content:n});t.value=t.value.map(t=>t.id===e?r:t)}async function d(e){await C(`/api/comments/${e}`),t.value=t.value.filter(t=>t.id!==e)}async function f(e){let n=await b(`/api/comments/${e}/resolve`);t.value=t.value.map(t=>t.id===e?n:t)}async function p(e){let n=await b(`/api/comments/${e}/unresolve`);t.value=t.value.map(t=>t.id===e?n:t)}return{activeReview:e,comments:t,loading:n,commentsByFile:r,refresh:i,setActiveReview:a,setStatus:o,createComment:c,editComment:u,deleteComment:d,resolveComment:f,unresolveComment:p}}),F=r({__name:`CancelButton`,setup(t){let{t:r}=v();return(t,i)=>(n(),a(g,e({padding:`2px 8px`},t.$attrs,{dense:``,flat:``,color:`warning`,label:o(r)(`reviews.comments.cancel`)}),null,16,[`label`]))}}),I=r({__name:`CreateButton`,setup(t){let{t:r}=v();return(t,i)=>(n(),a(g,e({padding:`2px 8px`,label:o(r)(`reviews.create.submit`)},t.$attrs,{unelevated:``,dense:``,color:`accent`}),null,16,[`label`]))}}),L=_({name:`QPage`,props:{padding:Boolean,styleFn:Function},setup(e,{slots:t}){let n=f(),r=u(h,p);if(r===p)return console.error(`QPage needs to be a deep child of QLayout`),p;if(u(`_q_pc_`,p)===p)return console.error(`QPage needs to be child of QPageContainer`),p;let i=l(()=>{let t=(r.header.space?r.header.size:0)+(r.footer.space?r.footer.size:0);if(typeof e.styleFn==`function`){let i=r.isContainer.value?r.containerHeight.value:n.screen.height;return e.styleFn(t,i)}return{minHeight:r.isContainer.value?r.containerHeight.value-t+`px`:n.screen.height===0?t===0?`100vh`:`calc(100vh - ${t}px)`:n.screen.height-t+`px`}}),a=l(()=>`q-page${e.padding?` q-layout-padding`:``}`);return()=>d(`main`,{class:a.value,style:i.value},m(t.default))}}),R=r({__name:`AppPage`,setup(e){function r(e,t){return{height:`${t-e}px`}}return(e,i)=>(n(),a(L,{"style-fn":r},{default:c(()=>[t(e.$slots,`default`)]),_:3}))}});export{N as a,D as c,P as i,E as l,I as n,M as o,F as r,O as s,R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,G as t,H as n,J as r,N as i,P as a,S as o,Tt as s,_ as c,c as l,d as u,g as d,h as f,it as p,l as m,lt as h,nt as g,q as _,r as v,s as y,x as b,y as x}from"./runtime-core.esm-bundler-CUpq88z7.js";import{D as S,E as C,H as w,O as T,_ as E,d as D,h as O,j as k,k as A,t as j}from"./QBtn-BDbJU6_B.js";import{t as M}from"./create-BkZH2Q0U.js";import{J as N,K as ee,d as te,g as P,h as F,m as I,n as L,q as ne,y as re}from"./index-DWi4DKrl.js";import{n as R}from"./vue-i18n.runtime-D0pkhc7g.js";import{n as z,r as B}from"./pinia-DmTi2T44.js";import{i as V,l as H,s as U}from"./single-flight-r8B7stt1.js";import{m as W,o as G,s as K,v as q}from"./QMenu-DXgFwoTJ.js";import{a as J,i as Y,n as X,o as ie,r as ae}from"./AppPage-BSvF7ik1.js";var oe=d({__name:`SearchInput`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(t){let r=n(t,`modelValue`);return(t,n)=>(i(),m(L,e({modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e},t.$attrs,{dense:``,outlined:``,clearable:``}),{prepend:_(()=>[f(D,{name:`search`,size:`xs`})]),_:1},16,[`modelValue`]))}}),se=[`top`,`right`,`bottom`,`left`],Z={type:{type:String,default:`a`},outline:Boolean,push:Boolean,flat:Boolean,unelevated:Boolean,color:String,textColor:String,glossy:Boolean,square:Boolean,padding:String,label:{type:[String,Number],default:``},labelPosition:{type:String,default:`right`,validator:e=>se.includes(e)},externalLabel:Boolean,hideLabel:{type:Boolean},labelClass:[Array,String,Object],labelStyle:[Array,String,Object],disable:Boolean,tabindex:[Number,String]},ce=[`label`],le=Object.keys(Z).filter(e=>!ce.includes(e)&&j.props[e]!==void 0);function ue(e){let t={};for(let n of le)t[n]=e[n];return t}function de(e,t){return{formClass:y(()=>`q-fab--form-${e.square?`square`:`rounded`}`),stacked:y(()=>!e.externalLabel&&[`top`,`bottom`].includes(e.labelPosition)),labelProps:y(()=>{if(e.externalLabel){let n=e.hideLabel===null?!t.value:e.hideLabel;return{action:`push`,data:{class:[e.labelClass,`q-fab__label q-tooltip--style q-fab__label--external q-fab__label--external-${e.labelPosition}`+(n?` q-fab__label--external-hidden`:``)],style:e.labelStyle}}}return{action:[`left`,`top`].includes(e.labelPosition)?`unshift`:`push`,data:{class:[e.labelClass,`q-fab__label q-fab__label--internal q-fab__label--internal-${e.labelPosition}`+(e.hideLabel?` q-fab__label--internal-hidden`:``)],style:e.labelStyle}}})}}var fe=[`up`,`right`,`down`,`left`],pe=[`left`,`center`,`right`],me=180,Q=M({name:`QFab`,props:{...Z,...N,icon:String,activeIcon:String,hideIcon:Boolean,hideLabel:{...Z.hideLabel,default:null},direction:{type:String,default:`right`,validator:e=>fe.includes(e)},...K,persistent:Boolean,stagger:{type:Number,default:40},verticalActionsAlign:{type:String,default:`center`,validator:e=>pe.includes(e)}},emits:ne,setup(e,{slots:n}){let r=p(null),i=g(e.modelValue===!0),o=te(),s=C(),{formClass:c,stacked:l,labelProps:u}=de(e,i),d=y(()=>!e.persistent),{show:f,hide:m,toggle:h}=ee({showing:i,hideOnRouteChange:d}),_=0,{clearHoverTimer:v,hoverShow:b,hoverHide:S}=G({props:e,canShow:()=>!i.value,show:e=>{_=Date.now(),f(e)},canHide:()=>i.value,hide:m});t(i,v);function w(e){i.value&&Date.now()-_<me||h(e)}let T=y(()=>({opened:i.value})),k=y(()=>`q-fab z-fab row inline justify-center q-fab--align-${e.verticalActionsAlign} ${c.value}`+(i.value?` q-fab--opened`:` q-fab--closed`)),M=y(()=>`q-fab__actions flex no-wrap inline q-fab__actions--${e.direction} q-fab__actions--${i.value?`opened`:`closed`}`),N=y(()=>e.hover?{onPointerenter:b,onPointerleave:S}:{}),P=y(()=>{let t={id:o.value,style:`--q-fab-stagger: ${e.stagger}ms`};return i.value||(t[`aria-hidden`]=`true`),t}),F=y(()=>`q-fab__icon-holder q-fab__icon-holder--${i.value?`opened`:`closed`}`);function I(t,r){let i=n[t],a=`q-fab__${t} absolute-full`;return i===void 0?x(D,{class:a,name:e[r]||s.iconSet.fab[r]}):x(`div`,{class:a},i(T.value))}function L(){let t=[];return e.hideIcon||t.push(x(`div`,{class:F.value},[I(`icon`,`icon`),I(`active-icon`,`activeIcon`)])),(e.label!==``||n.label!==void 0)&&t[u.value.action](x(`div`,u.value.data,n.label===void 0?[e.label]:n.label(T.value))),O(n.tooltip,t)}return a(A,{showing:i,onChildClick(e){m(e),e?.qAvoidFocus!==!0&&r.value?.$el.focus()}}),()=>x(`div`,{class:k.value,...N.value},[x(j,{ref:r,class:c.value,...ue(e),noWrap:!0,stack:l.value,noCaps:!0,fab:!0,"aria-expanded":i.value?`true`:`false`,"aria-controls":o.value,onClick:w},L),x(`div`,{class:M.value,...P.value},E(n.default))])}}),he={position:{type:String,default:`bottom-right`,validator:e=>[`top-right`,`top-left`,`bottom-right`,`bottom-left`,`top`,`right`,`bottom`,`left`].includes(e)},offset:{type:Array,validator:e=>e.length===2},expand:Boolean};function ge(){let{props:e}=c(),t=C(),n=b(k,T);if(n===T)return console.error(`QPageSticky needs to be child of QLayout`),T;let r=y(()=>{let t=e.position;return{top:t.includes(`top`),right:t.includes(`right`),bottom:t.includes(`bottom`),left:t.includes(`left`),vertical:t===`top`||t===`bottom`,horizontal:t===`left`||t===`right`}}),i=y(()=>n.header.offset),a=y(()=>n.right.offset),o=y(()=>n.footer.offset),s=y(()=>n.left.offset),l=y(()=>{let n=0,c=0,l=r.value,u=t.lang.rtl?-1:1;l.top&&i.value!==0?c=`${i.value}px`:l.bottom&&o.value!==0&&(c=`${-o.value}px`),l.left&&s.value!==0?n=`${u*s.value}px`:l.right&&a.value!==0&&(n=`${-u*a.value}px`);let d={transform:`translate(${n}, ${c})`};return e.offset&&(d.margin=`${e.offset[1]}px ${e.offset[0]}px`),l.vertical?(s.value!==0&&(d[t.lang.rtl?`right`:`left`]=`${s.value}px`),a.value!==0&&(d[t.lang.rtl?`left`:`right`]=`${a.value}px`)):l.horizontal&&(i.value!==0&&(d.top=`${i.value}px`),o.value!==0&&(d.bottom=`${o.value}px`)),d}),u=y(()=>`q-page-sticky row flex-center fixed-${e.position} q-page-sticky--${e.expand?`expand`:`shrink`}`);function d(t){let n=E(t.default);return x(`div`,{class:u.value,style:l.value},e.expand?n:[x(`div`,n)])}return{$layout:n,getStickyContent:d}}var _e=M({name:`QPageSticky`,props:he,setup(e,{slots:t}){let{getStickyContent:n}=ge();return()=>n(t)}});function ve(e){let t=new URLSearchParams;e.search&&t.set(`search`,e.search),e.createdFrom&&t.set(`createdFrom`,e.createdFrom),e.createdTo&&t.set(`createdTo`,e.createdTo),e.files&&e.files.length>0&&t.set(`files`,e.files.join(`,`));let n=t.toString();return n?`?${n}`:``}var $=z(`reviews`,()=>{let e=g([]),t=g(!1),n=g(null);async function r(r={}){t.value=!0,n.value=null;try{e.value=await U(`/api/reviews${ve(r)}`)}catch(t){e.value=[],n.value=V(t)}finally{t.value=!1}}async function i(t){let n=await H(`/api/reviews`,t);return e.value=[J(n),...e.value],n}return{reviews:e,loading:t,error:n,fetchReviews:r,createReview:i}}),ye={class:`text-h6`},be=S(d({__name:`ReviewCreateDialog`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:o([`created`,`hide`],[`update:modelValue`]),setup(e,{emit:t}){let a=n(e,`modelValue`),o=t,{t:c}=R(),u=$(),d=g(``),p=g(!1),v=g(null);function y(){d.value=``,p.value=!1,v.value=null}async function b(){p.value=!0,v.value=null;try{let e=d.value.trim(),t=await u.createReview(e?{name:e}:{});a.value=!1,y(),o(`created`,t)}catch(e){v.value=V(e)}finally{p.value=!1}}function x(){y(),o(`hide`)}return(e,t)=>(i(),m(re,{modelValue:a.value,"onUpdate:modelValue":t[1]||=e=>a.value=e,onHide:x},{default:_(()=>[f(P,{class:`review-create-dialog`},{default:_(()=>[f(F,null,{default:_(()=>[l(`div`,ye,s(h(c)(`reviews.create.title`)),1)]),_:1}),f(F,{class:`q-gutter-y-md`},{default:_(()=>[f(L,{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,dense:``,outlined:``,label:h(c)(`reviews.create.nameLabel`),hint:h(c)(`reviews.create.nameHint`),error:!!v.value,"error-message":v.value??void 0,onKeyup:w(b,[`enter`])},null,8,[`modelValue`,`label`,`hint`,`error`,`error-message`])]),_:1}),f(I,{align:`right`},{default:_(()=>[r(f(ae,null,null,512),[[W]]),f(X,{loading:p.value,onClick:b},null,8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`]))}}),[[`__scopeId`,`data-v-095646d6`]]),xe=d({__name:`CreateReviewFabButton`,emits:[`created`],setup(e,{emit:t}){let n=t,a=Y(),o=ie(),{activeReview:s}=B(a),{changedPaths:c}=B(o),l=g(!1),d=g(!1),p=g([18,18]),m=g(!1),h=y(()=>c.value.length===0||s.value!==null);function b(e){m.value=e.isFirst!==!0&&e.isFinal!==!0,p.value=[p.value[0]-(e.delta?.x??0),p.value[1]-(e.delta?.y??0)]}function x(e){a.setActiveReview(e),n(`created`,e)}return(e,t)=>(i(),u(v,null,[f(_e,{position:`bottom-right`,offset:p.value},{default:_(()=>[r(f(Q,{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,icon:`add`,color:`accent`,disable:h.value||m.value,onClick:t[1]||=e=>l.value=!0},null,8,[`modelValue`,`disable`]),[[q,b,void 0,{prevent:!0,mouse:!0}]])]),_:1},8,[`offset`]),f(be,{modelValue:l.value,"onUpdate:modelValue":t[2]||=e=>l.value=e,onCreated:x,onHide:t[3]||=e=>d.value=!1},null,8,[`modelValue`])],64))}});export{$ as n,oe as r,xe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,r as t,t as n}from"./agent-icon-C1oimBWa.js";import{A as r,Ct as i,F as a,G as o,H as s,I as c,J as l,L as u,N as d,P as f,Q as p,S as m,Tt as h,c as g,d as _,g as v,h as y,it as b,j as x,l as S,lt as C,m as w,nt as T,q as E,r as D,s as O,u as k,w as A,wt as j,y as M}from"./runtime-core.esm-bundler-CUpq88z7.js";import{D as N,E as P,U as F,_ as I,d as L,h as R,o as z,s as B,t as V}from"./QBtn-BDbJU6_B.js";import{u as ee}from"./event-rR76ioXz.js";import{t as te}from"./create-BkZH2Q0U.js";import{_ as ne,d as re,p as H,t as ie,v as ae}from"./index-CuqF4_ks.js";import{n as U}from"./vue-i18n.runtime-D0pkhc7g.js";import{n as oe,r as W}from"./pinia-DmTi2T44.js";import{i as se,l as ce,r as le,s as ue,t as de}from"./single-flight-r8B7stt1.js";import{t as fe}from"./agent-store-D1WRRYIE.js";import{t as pe}from"./safe-storage-CqQMHcn7.js";import{d as G,f as me,h as K,p as q,v as he}from"./QMenu-QYPSkHBE.js";import{r as ge}from"./use-virtual-scroll-BVHTKnoC.js";import{a as _e,i as ve,n as ye,o as be,t as xe}from"./use-panel-width-ujFPWf-l.js";import{a as J,c as Se,i as Y,o as Ce,s as X,t as we}from"./AppPage-BNPBe_fi.js";import{a as Te,c as Ee,d as De,f as Oe,i as ke,l as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./StatusSwitcher-CenEW-Lu.js";import{r as Re,t as ze}from"./CreateReviewFabButton-3V9ZYSHd.js";function Be(e){return e.toSorted((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`directory`?-1:1).map(e=>({...e,children:e.children?Be(e.children):void 0}))}function Ve(e,t){let n=[];for(let r of e){let e=r.split(`/`),i=n;for(let n=0;n<e.length;n++){let a=e[n];if(!a)continue;let o=n===e.length-1,s=e.slice(0,n+1).join(`/`),c=i.find(e=>e.name===a);c||(c={name:a,path:s,type:o?`file`:`directory`,isChanged:o?t.has(r):!1,children:o?void 0:[]},i.push(c)),!o&&c.children&&(i=c.children)}}return Be(n)}function He(e,t){if(!t.trim())return e;let n=t.toLowerCase(),r=e=>{if(e.type===`file`)return e.path.toLowerCase().includes(n)?e:null;let t=e.children?.map(r).filter(e=>e!==null);return t&&t.length>0?{...e,children:t}:e.name.toLowerCase().includes(n)?e:null};return e.map(r).filter(e=>e!==null)}function Ue(){let e=T([]),t=T(!1),n=T(!1),r=T(null),i=O(()=>!n.value),a=0;async function o(i,o=[]){let s=++a;t.value=!0;try{let t=await ue(`/api/git/tree/${encodeURIComponent(i)}`);if(s!==a)return;e.value=Ve(t.files.map(Se),new Set(o)),r.value=null}catch(e){if(s!==a)return;r.value=se(e)}finally{s===a&&(t.value=!1,n.value=!0)}}function s(){++a,e.value=[],t.value=!1,n.value=!1,r.value=null}return{tree:e,loading:t,initialLoading:i,error:r,fetchTree:o,reset:s}}function We(e){return e.type===`file`?e.isChanged:e.children?.some(We)??!1}var Z=oe(`file-explorer`,()=>{let e=J(),{tree:t,initialLoading:n,error:r,fetchTree:i,reset:a}=Ue(),{lines:s,isBinary:c,loading:l,error:u,fetchContent:d,reset:f}=Ne(),p=T(`staged`),m=T(!1),h=T(``),g=T(null),_=T(new Set),v=T(new Set),y=T(null),b=T(0),x=O(()=>p.value===`staged`?e.stagedFiles:e.unstagedFiles),S=O(()=>{let e=(h.value??``).trim().toLowerCase();return e?x.value.filter(t=>X(t).toLowerCase().includes(e)):x.value}),C=O(()=>He(t.value,h.value??``)),w=O(()=>{let e=0,n=t=>{for(let r of t)r.type===`file`?e++:r.children&&n(r.children)};return n(t.value),e});o(t,e=>{let t=new Set,n=e=>{for(let r of e)r.type===`directory`&&r.children&&(We(r)&&t.add(r.path),n(r.children))};n(e),_.value=t},{immediate:!0}),o(p,()=>{g.value=null,v.value=new Set,y.value=null,b.value++}),o(g,e=>{if(m.value){if(!e){f();return}d(e,`WORKTREE`)}});function E(e){let t=new Set(_.value);t.has(e)?t.delete(e):t.add(e),_.value=t}function D(e){let t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}function k(e){g.value=e,D(e)}function A(e){g.value=e,v.value.has(e)||(v.value=new Set(v.value).add(e))}function j(){v.value=new Set(x.value.map(X)),b.value++}function M(){v.value=new Set,b.value++}function N(e){if(g.value=e,m.value)return;v.value.has(e)||(v.value=new Set(v.value).add(e));let t=x.value.findIndex(t=>X(t)===e);t<0||(y.value={path:e,index:t,seq:(y.value?.seq??0)+1})}let P=0,F=T(!1),I=de(async()=>{F.value=!0;try{await e.fetchDiff(),m.value&&(await i(`WORKTREE`,e.changedPaths),g.value&&await d(g.value,`WORKTREE`))}finally{F.value=!1}});o(m,e=>{h.value=``,g.value=null,e?I():(a(),f())});async function L(){P=Date.now(),await I()}async function R(){Date.now()-P<400||await I()}return{source:p,browseMode:m,filter:h,selectedPath:g,expandedFolders:_,expandedFiles:v,scrollRequest:y,layoutVersion:b,tree:t,treeInitialLoading:n,treeError:r,refreshing:F,browseFileLines:s,browseFileIsBinary:c,browseFileLoading:l,browseFileError:u,diffFiles:x,filteredDiffFiles:S,filteredTree:C,totalTreeFiles:w,toggleFolder:E,toggleFileCard:D,handleCardToggle:k,expandFile:A,expandAllFiles:j,collapseAllFiles:M,selectFile:N,refresh:L,refreshFromServerEvent:R}}),Ge=te({name:`QSplitter`,props:{...ae,modelValue:{type:Number,required:!0},reverse:Boolean,unit:{type:String,default:`%`,validator:e=>[`%`,`px`].includes(e)},limits:{type:Array,validator:e=>e.length!==2||typeof e[0]!=`number`||typeof e[1]!=`number`?!1:e[0]>=0&&e[0]<=e[1]},emitImmediately:Boolean,horizontal:Boolean,disable:Boolean,beforeClass:[Array,String,Object],afterClass:[Array,String,Object],separatorClass:[Array,String,Object],separatorStyle:[Array,String,Object],separatorAriaLabel:String},emits:[`update:modelValue`],setup(e,{slots:t,emit:n}){let r=P(),i=ne(e,r),a=b(null),s={before:b(null),after:b(null)},c=re(),u=O(()=>`q-splitter no-wrap ${e.horizontal?`q-splitter--horizontal column`:`q-splitter--vertical row`} q-splitter--${e.disable?`disabled`:`workable`}`+(i()?` q-splitter--dark`:``)),d=O(()=>e.horizontal?`height`:`width`),f=O(()=>e.reverse?`after`:`before`),p=O(()=>e.limits===void 0?e.unit===`%`?[10,90]:[50,1/0]:e.limits);function m(t){return(e.unit===`%`?t:Math.round(t))+e.unit}let h=O(()=>({[f.value]:{[d.value]:m(e.modelValue)}})),g,_,v,y,x;function S(t){if(t.isFirst){let t=a.value.getBoundingClientRect()[d.value];g=e.horizontal?`up`:`left`,_=e.unit===`%`?100:t,v=Math.min(_,p.value[1],Math.max(p.value[0],e.modelValue)),y=(e.reverse?-1:1)*(e.horizontal?1:r.lang.rtl?-1:1)*(e.unit===`%`?t===0?0:100/t:1),a.value.classList.add(`q-splitter--active`);return}if(t.isFinal){x!==e.modelValue&&n(`update:modelValue`,x),a.value.classList.remove(`q-splitter--active`);return}let i=v+y*(t.direction===g?-1:1)*t.distance[e.horizontal?`y`:`x`];x=Math.min(_,p.value[1],Math.max(p.value[0],i)),s[f.value].value.style[d.value]=m(x),e.emitImmediately&&e.modelValue!==x&&n(`update:modelValue`,x)}let C=O(()=>[[he,e.disable?void 0:S,void 0,{[e.horizontal?`vertical`:`horizontal`]:!0,prevent:!0,stop:!0,mouse:!0,mouseAllDir:!0}]]),w=O(()=>{let t={role:`separator`,"aria-orientation":e.horizontal?`horizontal`:`vertical`,"aria-label":e.separatorAriaLabel||r.lang.label.resize};if(e.disable)t[`aria-disabled`]=`true`;else{let n=p.value;t.tabindex=0,t[`aria-controls`]=c.value,t[`aria-valuemin`]=n[0],n[1]!==1/0&&(t[`aria-valuemax`]=n[1]),t[`aria-valuenow`]=Math.round(e.modelValue*100)/100}return t}),T=null;function E(t){let{keyCode:i}=t,o=e.horizontal?[38,40]:[37,39];if(i!==13&&i!==36&&i!==35&&!o.includes(i))return;ee(t);let s=p.value,c=e.unit===`%`?100:a.value.getBoundingClientRect()[d.value],l;if(i===13)e.modelValue===s[0]?l=T===null?e.modelValue:T:(T=e.modelValue,l=s[0]);else if(i===36)l=s[0];else if(i===35)l=s[1];else{let t=(i===o[0]?-1:1)*(e.reverse?-1:1)*(e.horizontal?1:r.lang.rtl?-1:1);l=e.modelValue+t*(e.unit===`%`?1:10)}let u=Math.min(c,s[1],Math.max(s[0],l));u!==e.modelValue&&n(`update:modelValue`,u)}function D(e,t){e<t[0]?n(`update:modelValue`,t[0]):e>t[1]&&n(`update:modelValue`,t[1])}return o(()=>e.modelValue,e=>{D(e,p.value)}),o(()=>e.limits,()=>{A(()=>{D(e.modelValue,p.value)})}),()=>{let n=[M(`div`,{ref:s.before,id:f.value===`before`?c.value:void 0,class:[`q-splitter__panel q-splitter__before`+(e.reverse?` col`:``),e.beforeClass],style:h.value.before},I(t.before)),M(`div`,{class:[`q-splitter__separator`,e.separatorClass],style:e.separatorStyle,...w.value,onKeydown:e.disable?void 0:E},[l(M(`div`,{class:`q-splitter__separator-area absolute-full`},I(t.separator)),C.value)]),M(`div`,{ref:s.after,id:f.value===`after`?c.value:void 0,class:[`q-splitter__panel q-splitter__after`+(e.reverse?``:` col`),e.afterClass],style:h.value.after},I(t.after))];return M(`div`,{class:u.value,ref:a},R(t.default,n))}}}),Ke=`githuman.fileListWidth`,qe=260,Q=220,$=600,Je=N(v({__name:`PanelResize`,setup(e){let t=T(ye(Ke,Q,$)??qe),n=O(()=>[Q,$]);function r(e){typeof e==`number`&&Number.isFinite(e)&&(t.value=xe(e,Q,$),pe.set(Ke,String(t.value)))}return(e,i)=>(d(),S(Ge,{"model-value":t.value,limits:n.value,unit:`px`,class:`file-explorer`,"before-class":`file-explorer__panel`,"after-class":`file-explorer__content`,"onUpdate:modelValue":r},{before:E(()=>[c(e.$slots,`panel`,{},void 0,!0)]),after:E(()=>[c(e.$slots,`content`,{},void 0,!0)]),_:3},8,[`model-value`,`limits`]))}}),[[`__scopeId`,`data-v-65488178`]]),Ye={class:`row items-center no-wrap q-gutter-x-xs`},Xe={class:`row items-center no-wrap q-gutter-x-xs`},Ze=v({__name:`FileExplorerTabs`,props:m({stagedFilesLength:{},unstagedFilesLength:{}},{modelValue:{default:`staged`},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=s(e,`modelValue`),{t:n}=U();return(r,i)=>(d(),S(ve,{modelValue:t.value,"onUpdate:modelValue":i[0]||=e=>t.value=e,dense:``,"no-caps":``,align:`left`,"narrow-indicator":``,class:`text-primary q-mb-sm`},{default:E(()=>[y(_e,{name:`staged`},{default:E(()=>[g(`div`,Ye,[g(`span`,null,h(C(n)(`changes.staged`)),1),y(me,{color:`positive`,rounded:``},{default:E(()=>[w(h(e.stagedFilesLength),1)]),_:1})])]),_:1}),y(_e,{name:`unstaged`},{default:E(()=>[g(`div`,Xe,[g(`span`,null,h(C(n)(`changes.unstaged`)),1),y(me,{color:`warning`,rounded:``},{default:E(()=>[w(h(e.unstagedFilesLength),1)]),_:1})])]),_:1})]),_:1},8,[`modelValue`]))}}),Qe={class:`file-tree-node`},$e={class:`row items-center no-wrap q-gutter-x-xs`},et=[`title`],tt=[`title`],nt={key:2},rt=N(v({__name:`FileTreeNode`,props:{node:{},selectedPath:{},expandedFolders:{},level:{}},emits:[`toggle-folder`,`file-select`],setup(e,{emit:t}){let n=e,r=t,o=8+n.level*12;return(t,n)=>{let s=u(`FileTreeNode`,!0);return d(),_(`div`,Qe,[e.node.type===`directory`?l((d(),S(G,{key:0,clickable:``,dense:``,style:j({paddingLeft:`${o}px`}),onClick:n[0]||=t=>r(`toggle-folder`,e.node.path)},{default:E(()=>[y(q,{avatar:``,class:`file-tree-node__icon-section`},{default:E(()=>[g(`div`,$e,[y(L,{name:`chevron_right`,size:`xs`,class:i([`file-tree-node__chevron`,{"file-tree-node__chevron--expanded":e.expandedFolders.has(e.node.path)}])},null,8,[`class`]),y(L,{name:e.expandedFolders.has(e.node.path)?`folder_open`:`folder`,size:`xs`,color:`warning`},null,8,[`name`])])]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,{class:`ellipsis file-tree-node__label`,title:e.node.path},h(e.node.name),9,et)]),_:1}),e.node.children?(d(),S(q,{key:0,side:``,class:`text-caption text-grey-6`},{default:E(()=>[w(h(e.node.children.length),1)]),_:1})):k(``,!0)]),_:1},8,[`style`])),[[z]]):l((d(),S(G,{key:1,clickable:``,dense:``,active:e.node.path===e.selectedPath,"active-class":`file-tree-node--selected`,style:j({paddingLeft:`${o+20}px`}),onClick:n[1]||=t=>r(`file-select`,e.node.path)},{default:E(()=>[y(q,{avatar:``,class:`file-tree-node__icon-section`},{default:E(()=>[y(L,{name:`insert_drive_file`,size:`xs`,color:`grey-6`})]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,{class:`ellipsis file-tree-node__label`,title:e.node.path},h(e.node.name),9,tt)]),_:1}),e.node.isChanged?(d(),S(q,{key:0,side:``},{default:E(()=>[y(L,{name:`fiber_manual_record`,size:`8px`,color:`warning`})]),_:1})):k(``,!0)]),_:1},8,[`active`,`style`])),[[z]]),e.node.type===`directory`&&e.expandedFolders.has(e.node.path)&&e.node.children?(d(),_(`div`,nt,[(d(!0),_(D,null,a(e.node.children,t=>(d(),S(s,{key:t.path,node:t,"selected-path":e.selectedPath,"expanded-folders":e.expandedFolders,level:e.level+1,onToggleFolder:n[2]||=e=>r(`toggle-folder`,e),onFileSelect:n[3]||=e=>r(`file-select`,e)},null,8,[`node`,`selected-path`,`expanded-folders`,`level`]))),128))])):k(``,!0)])}}}),[[`__scopeId`,`data-v-5f455ca2`]]);function it(){let e=P(),{t:n}=U(),r=t(),i=Z(),a=Y();async function o(e,t,a){try{await ce(t,{paths:[e]}),await i.refresh()}catch(e){r(n(a),e)}}function s(t){let r=(a.commentsByFile.get(t)??[]).filter(e=>!e.resolved).length;if(r===0)return o(t,`/api/git/stage`,`changes.actions.stageError`);e.dialog({title:n(`changes.actions.stageUnresolvedTitle`),message:n(`changes.actions.stageUnresolvedMessage`,{path:t,count:r}),persistent:!0,ok:{label:n(`changes.actions.stageUnresolvedOk`),flat:!0},cancel:{label:n(`changes.actions.discardConfirmCancel`),flat:!0}}).onOk(()=>{o(t,`/api/git/stage`,`changes.actions.stageError`)})}function c(e){return o(e,`/api/git/unstage`,`changes.actions.unstageError`)}function l(t){e.dialog({title:n(`changes.actions.discardConfirmTitle`),message:n(`changes.actions.discardConfirmMessage`,{path:t}),persistent:!0,ok:{label:n(`changes.actions.discardConfirmOk`),color:`negative`,flat:!0},cancel:{label:n(`changes.actions.discardConfirmCancel`),flat:!0}}).onOk(()=>{o(t,`/api/git/discard`,`changes.actions.discardError`)})}return{stage:s,unstage:c,discard:l}}var at={class:`file-list-item__path-row row no-wrap items-center`},ot=[`title`],st={class:`text-caption`},ct={class:`text-positive`},lt={class:`text-negative q-ml-xs`},ut=N(v({__name:`FileListItem`,props:{file:{},selected:{type:Boolean},source:{}},emits:[`click`],setup(e){let t={added:`A`,modified:`M`,deleted:`D`,renamed:`R`},n={added:`positive`,modified:`warning`,deleted:`negative`,renamed:`purple`},r=e,{t:a}=U(),{stage:o,unstage:s,discard:c}=it(),u=Y(),f=O(()=>X(r.file)),p=O(()=>u.commentsByFile.get(f.value)?.length??0);return(r,u)=>l((d(),S(G,{clickable:``,dense:``,class:`file-list-item`,active:e.selected,"active-class":`file-list-item--selected`,onClick:u[3]||=e=>r.$emit(`click`)},{default:E(()=>[y(q,{avatar:``,class:`file-list-item__icon-section`},{default:E(()=>[g(`span`,{class:i([`text-caption text-weight-bold text-mono`,`text-${n[e.file.status]}`])},h(t[e.file.status]),3)]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,at,[g(`span`,{class:`ellipsis file-list-item__path-label`,title:f.value},h(f.value),9,ot),p.value>0?(d(),S(Oe,{key:0,compact:``,class:`file-list-item__badge`,count:p.value},null,8,[`count`])):k(``,!0)])]),_:1}),y(q,{side:``,class:`file-list-item__stats`},{default:E(()=>[g(`span`,st,[g(`span`,ct,`+`+h(e.file.additions),1),g(`span`,lt,`-`+h(e.file.deletions),1)])]),_:1}),y(q,{side:``,class:`file-list-item__actions`},{default:E(()=>[e.source===`unstaged`?(d(),_(D,{key:0},[l(y(V,{flat:``,dense:``,round:``,size:`sm`,icon:`undo`,"aria-label":C(a)(`changes.actions.discard`),title:C(a)(`changes.actions.discard`),onClick:u[0]||=F(e=>C(c)(f.value),[`stop`])},null,8,[`aria-label`,`title`]),[[z]]),l(y(V,{flat:``,dense:``,round:``,size:`sm`,icon:`add`,"aria-label":C(a)(`changes.actions.stage`),title:C(a)(`changes.actions.stage`),onClick:u[1]||=F(e=>C(o)(f.value),[`stop`])},null,8,[`aria-label`,`title`]),[[z]])],64)):l((d(),S(V,{key:1,flat:``,dense:``,round:``,size:`sm`,icon:`remove`,"aria-label":C(a)(`changes.actions.unstage`),title:C(a)(`changes.actions.unstage`),onClick:u[2]||=F(e=>C(s)(f.value),[`stop`])},null,8,[`aria-label`,`title`])),[[z]])]),_:1})]),_:1},8,[`active`])),[[z]])}}),[[`__scopeId`,`data-v-2e9eab18`]]),dt=v({__name:`BrowseModeToggle`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=s(e,`modelValue`),{t:n}=U();return(e,r)=>(d(),S(G,null,{default:E(()=>[y(q,null,{default:E(()=>[y(ge,null,{default:E(()=>[w(h(C(n)(`browse.toggle`)),1)]),_:1})]),_:1}),y(q,{side:``},{default:E(()=>[y(ie,{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,dense:``,size:`xs`},null,8,[`modelValue`])]),_:1})]),_:1}))}}),ft={class:`file-list-panel__header q-pa-sm`},pt={key:1,class:`text-subtitle2 q-mb-sm`},mt={key:0,class:`text-primary`},ht={key:0,class:`row justify-center q-pa-lg`},gt={key:0,class:`text-caption text-grey-6 q-px-md q-py-sm`},_t={key:0,class:`text-caption text-grey-6 q-px-md q-py-sm`},vt=32,yt=N(v({__name:`FileListPanel`,setup(e){let{t}=U(),{stagedFiles:n,unstagedFiles:r,initialLoading:i,error:o}=W(J()),s=Z(),{source:c,browseMode:l,filter:u,selectedPath:f,expandedFolders:m,treeInitialLoading:v,treeError:b,filteredDiffFiles:x,filteredTree:A,totalTreeFiles:j}=W(s),M=T(null),N=O(()=>M.value?.getScrollTarget()??null);return(e,T)=>(d(),_(D,null,[g(`div`,ft,[C(l)?(d(),_(`div`,pt,[w(h(C(t)(`browse.allFiles`))+` `,1),C(j)>0||!C(b)?(d(),_(`span`,mt,`(`+h(C(j))+`)`,1)):k(``,!0)])):(d(),S(Ze,{key:0,modelValue:C(c),"onUpdate:modelValue":T[0]||=e=>p(c)?c.value=e:null,"staged-files-length":C(n).length,"unstaged-files-length":C(r).length},null,8,[`modelValue`,`staged-files-length`,`unstaged-files-length`])),y(Re,{modelValue:C(u),"onUpdate:modelValue":T[1]||=e=>p(u)?u.value=e:null,placeholder:C(l)?C(t)(`browse.searchPlaceholder`):C(t)(`changes.filterPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),y(H),y(K,{ref_key:`scrollArea`,ref:M,class:`col file-list-panel__scroll`,"content-style":`padding: 4px 0`,"content-active-style":`padding: 4px 0`},{default:E(()=>[(C(l)?C(v):C(i))?(d(),_(`div`,ht,[y(B,{color:`primary`,size:`2em`})])):C(l)?(d(),_(D,{key:1},[C(A).length===0&&(!C(b)||C(u)&&C(j)>0)?(d(),_(`p`,gt,h(C(u)?C(t)(`browse.noMatchingFiles`):C(t)(`browse.noFiles`)),1)):k(``,!0),(d(!0),_(D,null,a(C(A),e=>(d(),S(rt,{key:e.path,node:e,"selected-path":C(f),"expanded-folders":C(m),level:0,onToggleFolder:C(s).toggleFolder,onFileSelect:C(s).selectFile},null,8,[`node`,`selected-path`,`expanded-folders`,`onToggleFolder`,`onFileSelect`]))),128))],64)):(d(),_(D,{key:2},[C(x).length===0&&(C(u)||!C(o))?(d(),_(`p`,_t,h(C(u)?C(t)(`browse.noMatchingFiles`):C(t)(`changes.emptyFileList`)),1)):k(``,!0),N.value?(d(),S(be,{key:C(c),"scroll-target":N.value,items:C(x),"virtual-scroll-item-size":vt},{default:E(({item:e})=>[(d(),S(ut,{key:C(X)(e),file:e,selected:C(f)===C(X)(e),source:C(c),onClick:t=>C(s).selectFile(C(X)(e))},null,8,[`file`,`selected`,`source`,`onClick`]))]),_:1},8,[`scroll-target`,`items`])):k(``,!0)],64))]),_:1},512),y(H),y(dt,{modelValue:C(l),"onUpdate:modelValue":T[2]||=e=>p(l)?l.value=e:null},null,8,[`modelValue`])],64))}}),[[`__scopeId`,`data-v-6daa93e0`]]),bt={class:`diff-status-bar row items-center q-gutter-x-md q-pa-sm text-body2`},xt={class:`text-weight-medium`},St={class:`text-positive`},Ct={class:`text-negative`},wt={key:0,class:`text-grey-6`},Tt={key:1,class:`text-grey-6`},Et={key:2,class:`text-grey-6`},Dt={key:3,class:`text-grey-6`},Ot=v({__name:`DiffStatusBar`,props:{files:{}},emits:[`expand-all`,`collapse-all`],setup(t,{emit:n}){let r=t,i=n,{t:a}=U(),o=O(()=>{let e=r.files.reduce((e,t)=>e+t.additions,0),t=r.files.reduce((e,t)=>e+t.deletions,0),n=r.files.filter(e=>e.status===`added`).length,i=r.files.filter(e=>e.status===`modified`).length,a=r.files.filter(e=>e.status===`deleted`).length,o=r.files.filter(e=>e.status===`renamed`).length;return{total:r.files.length,additions:e,deletions:t,added:n,modified:i,deleted:a,renamed:o}});return(t,n)=>(d(),_(`div`,bt,[g(`span`,xt,h(C(a)(`changes.filesChanged`,{count:o.value.total})),1),g(`span`,St,` +`+h(o.value.additions)+` `+h(C(a)(`changes.additions`)),1),g(`span`,Ct,` -`+h(o.value.deletions)+` `+h(C(a)(`changes.deletions`)),1),o.value.added?(d(),_(`span`,wt,h(o.value.added)+` `+h(C(a)(`changes.added`)),1)):k(``,!0),o.value.modified?(d(),_(`span`,Tt,h(o.value.modified)+` `+h(C(a)(`changes.modified`)),1)):k(``,!0),o.value.deleted?(d(),_(`span`,Et,h(o.value.deleted)+` `+h(C(a)(`changes.deletedPlural`)),1)):k(``,!0),o.value.renamed?(d(),_(`span`,Dt,h(o.value.renamed)+` `+h(C(a)(`changes.renamed`)),1)):k(``,!0),y(e),y(V,{dense:``,flat:``,"no-caps":``,size:`sm`,icon:`unfold_more`,label:C(a)(`changes.expandAll`),onClick:n[0]||=e=>i(`expand-all`)},null,8,[`label`]),y(V,{dense:``,flat:``,"no-caps":``,size:`sm`,icon:`unfold_less`,label:C(a)(`changes.collapseAll`),onClick:n[1]||=e=>i(`collapse-all`)},null,8,[`label`])]))}}),kt=v({__name:`ChangesFileCard`,props:{file:{}},setup(e){let t=e,n=Z(),r=J(),i=Y(),{expandedFiles:a}=W(n),{activeReview:o,commentsByFile:s}=W(i),c=O(()=>X(t.file)),l=O(()=>Ce(n.source,c.value)),u=O(()=>r.hunksOf(n.source,t.file)),f=O(()=>r.hunksFresh(n.source,t.file)),p=O(()=>r.hunksError(n.source,t.file)),m=O(()=>a.value.has(c.value)),h=O(()=>s.value.get(c.value)),g=O(()=>!!o.value);function _(){r.ensureHunks(n.source,t.file)}function v(){r.retryHunks(n.source,t.file)}return(t,i)=>(d(),S(je,{file:e.file,"state-key":l.value,detail:u.value,"hunks-loaded":f.value,"hunks-error":p.value,expanded:m.value,"agent-source":C(n).source,commentable:g.value,"comments-editable":g.value,comments:h.value,onLoadHunks:_,onRetryHunks:v,onClearHunksError:i[0]||=t=>C(r).clearHunksError(C(n).source,e.file),onToggle:i[1]||=e=>C(n).handleCardToggle(c.value),onExpand:i[2]||=e=>C(n).expandFile(c.value)},null,8,[`file`,`state-key`,`detail`,`hunks-loaded`,`hunks-error`,`expanded`,`agent-source`,`commentable`,`comments-editable`,`comments`]))}}),At={key:0,class:`active-review-bar row items-center q-gutter-x-sm q-px-sm no-wrap`},jt={class:`text-body2 ellipsis`},Mt=N(v({__name:`ActiveReviewBar`,setup(r){let{t:i}=U(),a=t(),o=Y(),{activeReview:s}=W(o),c=fe(),l=Me();function u(e){o.setStatus(e).catch(e=>{a(i(`reviews.comments.error`),e)})}return(t,r)=>C(s)?(d(),_(`div`,At,[y(L,{name:`rate_review`,size:`18px`,color:`primary`}),g(`span`,jt,h(C(s).name??C(i)(`reviews.list.unnamed`)),1),y(e),C(c).enabled?(d(),S(V,{key:0,flat:``,dense:``,"no-caps":``,size:`sm`,icon:C(n),label:C(i)(`agent.context.addReview`),onClick:r[0]||=e=>C(l)({kind:`review`,reviewId:C(s).id})},null,8,[`icon`,`label`])):k(``,!0),y(Ie,{status:C(s).status,onChange:u},null,8,[`status`])])):k(``,!0)}}),[[`__scopeId`,`data-v-2b6e4bdd`]]),Nt={key:1,class:`q-pa-md text-grey-6`},Pt=46,Ft=12,It=1.5,Lt=2,Rt=20,zt=N(v({__name:`DiffPanel`,setup(e){let{t}=U(),n=Z(),{diffFiles:r}=W(n),{error:i,loading:a}=W(J()),s=Y(),{activeReview:c}=W(s);Le({create:e=>s.createComment(e),edit:(e,t)=>s.editComment(e,t),remove:e=>s.deleteComment(e),resolve:e=>s.resolveComment(e),unresolve:e=>s.unresolveComment(e)});let l=T(null),u=O(()=>l.value?.getScrollTarget()??null);f(De,()=>u.value);let p=T(null);function m(){let e=p.value;return e?Promise.resolve(e):new Promise(e=>{let t=o(p,n=>{n&&(t(),e(n))})})}return o(()=>n.layoutVersion,async()=>{await A(),p.value?.reset()}),o(r,async(e,t)=>{e.length===t.length&&e.every((e,n)=>X(e)===X(t[n]))||(await A(),p.value?.reset())}),o(()=>n.scrollRequest,async e=>{if(!e)return;let t=await m();if(await A(),n.scrollRequest===e){t.scrollTo(e.index,`start`);for(let t=0;t<Rt;t++){await new Promise(e=>requestAnimationFrame(e));let t=document.getElementById(`diff-file-${e.path}`);if(t){t.scrollIntoView({block:`nearest`});return}}}}),(e,o)=>(d(),_(D,null,[C(i)?(d(),S(Ee,{key:0,title:C(t)(`changes.loadError`),message:C(i),loading:C(a),onRetry:o[0]||=e=>C(n).refresh()},null,8,[`title`,`message`,`loading`])):k(``,!0),C(r).length===0&&!C(i)?(d(),_(`div`,Nt,h(C(t)(`changes.emptyDiffPanel`)),1)):C(r).length>0?(d(),_(D,{key:2},[y(Mt),C(c)?(d(),S(H,{key:0})):k(``,!0),y(Ot,{files:C(r),onExpandAll:C(n).expandAllFiles,onCollapseAll:C(n).collapseAllFiles},null,8,[`files`,`onExpandAll`,`onCollapseAll`]),y(H),y(K,{ref_key:`scrollArea`,ref:l,class:`col`,"content-style":`padding: 8px; width: 100%; max-width: 100%`,"content-active-style":`padding: 8px; width: 100%; max-width: 100%`},{default:E(()=>[u.value?(d(),S(be,{key:C(n).source,ref_key:`virtualScroll`,ref:p,"scroll-target":u.value,items:C(r),"virtual-scroll-item-size":Pt,"virtual-scroll-slice-size":Ft,"virtual-scroll-slice-ratio-before":It,"virtual-scroll-slice-ratio-after":Lt},{default:E(({item:e})=>[(d(),_(`div`,{key:C(X)(e),class:`diff-virtual-slot`},[y(kt,{file:e},null,8,[`file`])]))]),_:1},8,[`scroll-target`,`items`])):k(``,!0)]),_:1},512)],64)):k(``,!0),!C(c)&&C(r).length>0?(d(),S(ze,{key:3})):k(``,!0)],64))}}),[[`__scopeId`,`data-v-edff3c16`]]),Bt={key:1,class:`q-pa-md text-grey-6`},Vt={key:0,class:`row justify-center q-pa-lg`},Ht={key:1,class:`q-pa-md text-grey-6`},Ut={class:`text-caption`},Wt={key:2,class:`q-pa-md text-grey-6`},Gt=v({__name:`FileContentPanel`,setup(e){let{t}=U(),n=Z(),{selectedPath:r,browseFileLines:i,browseFileIsBinary:a,browseFileLoading:s,browseFileError:c,treeError:l,refreshing:u}=W(n),{error:f}=W(J()),p=O(()=>f.value?{title:t(`changes.loadError`),message:f.value}:l.value?{title:t(`browse.treeLoadError`),message:l.value}:null),m=T(!1);return o(r,e=>{m.value=e?Pe(e):!1},{immediate:!0}),(e,o)=>(d(),_(D,null,[p.value?(d(),S(Ee,{key:0,title:p.value.title,message:p.value.message,loading:C(u),onRetry:o[0]||=e=>C(n).refresh()},null,8,[`title`,`message`,`loading`])):k(``,!0),C(r)?(d(),S(ke,{key:2,class:`col`},{header:E(()=>[y(Fe,{path:C(r)},{default:E(()=>[y(Te,{modelValue:m.value,"onUpdate:modelValue":o[1]||=e=>m.value=e,path:C(r)},null,8,[`modelValue`,`path`])]),_:1},8,[`path`])]),default:E(()=>[C(s)&&C(i).length===0&&!C(c)?(d(),_(`div`,Vt,[y(B,{color:`primary`,size:`2em`})])):C(c)?(d(),_(`div`,Ht,[w(h(C(t)(`changes.fullFileLoadError`))+` `,1),g(`div`,Ut,h(C(c)),1),y(V,{flat:``,dense:``,color:`primary`,class:`q-mt-sm`,label:C(t)(`changes.retry`),loading:C(u),onClick:o[2]||=e=>C(n).refresh()},null,8,[`label`,`loading`])])):C(a)?(d(),_(`div`,Wt,h(C(t)(`changes.binaryFile`)),1)):(d(),S(K,{key:3,class:`col`,"content-style":`padding: 8px`,"content-active-style":`padding: 8px`},{default:E(()=>[y(Ae,{path:C(r),lines:C(i),wrap:m.value},null,8,[`path`,`lines`,`wrap`])]),_:1}))]),_:1})):(d(),_(`div`,Bt,h(C(t)(`browse.selectFile`)),1))],64))}}),Kt=v({__name:`FileExplorer`,setup(e){let t=Z(),n=Y(),{browseMode:i}=W(t);r(()=>{t.refresh(),n.refresh()});let a=le([`files:changed`],()=>void t.refreshFromServerEvent());x(()=>a.close());let o=le([`review:created`,`review:updated`,`review:deleted`,`comment:created`,`comment:updated`,`comment:deleted`],()=>void n.refresh());return x(()=>o.close()),(e,t)=>(d(),S(Je,null,{panel:E(()=>[y(yt)]),content:E(()=>[C(i)?(d(),S(Gt,{key:0})):(d(),S(zt,{key:1}))]),_:1}))}}),qt=v({__name:`IndexPage`,setup(e){return(e,t)=>(d(),S(we,null,{default:E(()=>[y(Kt)]),_:1}))}});export{qt as default};
|
|
1
|
+
import{l as e,r as t,t as n}from"./agent-icon-BJbyp2DP.js";import{A as r,Ct as i,F as a,G as o,H as s,I as c,J as l,L as u,N as d,P as f,Q as p,S as m,Tt as h,c as g,d as _,g as v,h as y,it as b,j as x,l as S,lt as C,m as w,nt as T,q as E,r as D,s as O,u as k,w as A,wt as j,y as M}from"./runtime-core.esm-bundler-CUpq88z7.js";import{D as N,E as P,U as F,_ as I,d as L,h as R,o as z,s as B,t as V}from"./QBtn-BDbJU6_B.js";import{u as ee}from"./event-rR76ioXz.js";import{t as te}from"./create-BkZH2Q0U.js";import{_ as ne,d as re,p as H,t as ie,v as ae}from"./index-DWi4DKrl.js";import{n as U}from"./vue-i18n.runtime-D0pkhc7g.js";import{n as oe,r as W}from"./pinia-DmTi2T44.js";import{i as se,l as ce,r as le,s as ue,t as de}from"./single-flight-r8B7stt1.js";import{t as fe}from"./agent-store-B9E-aiz3.js";import{t as pe}from"./safe-storage-ak36tVRO.js";import{d as G,f as me,h as K,p as q,v as he}from"./QMenu-DXgFwoTJ.js";import{r as ge}from"./use-virtual-scroll-BVHTKnoC.js";import{a as _e,i as ve,n as ye,o as be,t as xe}from"./use-panel-width-DGbjs_T8.js";import{c as J,i as Y,l as Se,o as X,s as Ce,t as we}from"./AppPage-BSvF7ik1.js";import{a as Te,c as Ee,d as De,f as Oe,i as ke,l as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./StatusSwitcher-BpebV47C.js";import{r as Re,t as ze}from"./CreateReviewFabButton-M0od1QEZ.js";function Be(e){return e.toSorted((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`directory`?-1:1).map(e=>({...e,children:e.children?Be(e.children):void 0}))}function Ve(e,t){let n=[];for(let r of e){let e=r.split(`/`),i=n;for(let n=0;n<e.length;n++){let a=e[n];if(!a)continue;let o=n===e.length-1,s=e.slice(0,n+1).join(`/`),c=i.find(e=>e.name===a);c||(c={name:a,path:s,type:o?`file`:`directory`,isChanged:o?t.has(r):!1,children:o?void 0:[]},i.push(c)),!o&&c.children&&(i=c.children)}}return Be(n)}function He(e,t){if(!t.trim())return e;let n=t.toLowerCase(),r=e=>{if(e.type===`file`)return e.path.toLowerCase().includes(n)?e:null;let t=e.children?.map(r).filter(e=>e!==null);return t&&t.length>0?{...e,children:t}:e.name.toLowerCase().includes(n)?e:null};return e.map(r).filter(e=>e!==null)}function Ue(){let e=T([]),t=T(!1),n=T(!1),r=T(null),i=O(()=>!n.value),a=0;async function o(i,o=[]){let s=++a;t.value=!0;try{let t=await ue(`/api/git/tree/${encodeURIComponent(i)}`);if(s!==a)return;e.value=Ve(t.files.map(Se),new Set(o)),r.value=null}catch(e){if(s!==a)return;r.value=se(e)}finally{s===a&&(t.value=!1,n.value=!0)}}function s(){++a,e.value=[],t.value=!1,n.value=!1,r.value=null}return{tree:e,loading:t,initialLoading:i,error:r,fetchTree:o,reset:s}}function We(e){return e.type===`file`?e.isChanged:e.children?.some(We)??!1}var Z=oe(`file-explorer`,()=>{let e=X(),{tree:t,initialLoading:n,error:r,fetchTree:i,reset:a}=Ue(),{lines:s,isBinary:c,loading:l,error:u,fetchContent:d,reset:f}=Ne(),p=T(`staged`),m=T(!1),h=T(``),g=T(null),_=T(new Set),v=T(new Set),y=T(null),b=T(0),x=O(()=>p.value===`staged`?e.stagedFiles:e.unstagedFiles),S=O(()=>{let e=(h.value??``).trim().toLowerCase();return e?x.value.filter(t=>J(t).toLowerCase().includes(e)):x.value}),C=O(()=>He(t.value,h.value??``)),w=O(()=>{let e=0,n=t=>{for(let r of t)r.type===`file`?e++:r.children&&n(r.children)};return n(t.value),e});o(t,e=>{let t=new Set,n=e=>{for(let r of e)r.type===`directory`&&r.children&&(We(r)&&t.add(r.path),n(r.children))};n(e),_.value=t},{immediate:!0}),o(p,()=>{g.value=null,v.value=new Set,y.value=null,b.value++}),o(g,e=>{if(m.value){if(!e){f();return}d(e,`WORKTREE`)}});function E(e){let t=new Set(_.value);t.has(e)?t.delete(e):t.add(e),_.value=t}function D(e){let t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}function k(e){g.value=e,D(e)}function A(e){g.value=e,v.value.has(e)||(v.value=new Set(v.value).add(e))}function j(){v.value=new Set(x.value.map(J)),b.value++}function M(){v.value=new Set,b.value++}function N(e){if(g.value=e,m.value)return;v.value.has(e)||(v.value=new Set(v.value).add(e));let t=x.value.findIndex(t=>J(t)===e);t<0||(y.value={path:e,index:t,seq:(y.value?.seq??0)+1})}let P=0,F=T(!1),I=de(async()=>{F.value=!0;try{await e.fetchDiff(),m.value&&(await i(`WORKTREE`,e.changedPaths),g.value&&await d(g.value,`WORKTREE`))}finally{F.value=!1}});o(m,e=>{h.value=``,g.value=null,e?I():(a(),f())});async function L(){P=Date.now(),await I()}async function R(){Date.now()-P<400||await I()}return{source:p,browseMode:m,filter:h,selectedPath:g,expandedFolders:_,expandedFiles:v,scrollRequest:y,layoutVersion:b,tree:t,treeInitialLoading:n,treeError:r,refreshing:F,browseFileLines:s,browseFileIsBinary:c,browseFileLoading:l,browseFileError:u,diffFiles:x,filteredDiffFiles:S,filteredTree:C,totalTreeFiles:w,toggleFolder:E,toggleFileCard:D,handleCardToggle:k,expandFile:A,expandAllFiles:j,collapseAllFiles:M,selectFile:N,refresh:L,refreshFromServerEvent:R}}),Ge=te({name:`QSplitter`,props:{...ae,modelValue:{type:Number,required:!0},reverse:Boolean,unit:{type:String,default:`%`,validator:e=>[`%`,`px`].includes(e)},limits:{type:Array,validator:e=>e.length!==2||typeof e[0]!=`number`||typeof e[1]!=`number`?!1:e[0]>=0&&e[0]<=e[1]},emitImmediately:Boolean,horizontal:Boolean,disable:Boolean,beforeClass:[Array,String,Object],afterClass:[Array,String,Object],separatorClass:[Array,String,Object],separatorStyle:[Array,String,Object],separatorAriaLabel:String},emits:[`update:modelValue`],setup(e,{slots:t,emit:n}){let r=P(),i=ne(e,r),a=b(null),s={before:b(null),after:b(null)},c=re(),u=O(()=>`q-splitter no-wrap ${e.horizontal?`q-splitter--horizontal column`:`q-splitter--vertical row`} q-splitter--${e.disable?`disabled`:`workable`}`+(i()?` q-splitter--dark`:``)),d=O(()=>e.horizontal?`height`:`width`),f=O(()=>e.reverse?`after`:`before`),p=O(()=>e.limits===void 0?e.unit===`%`?[10,90]:[50,1/0]:e.limits);function m(t){return(e.unit===`%`?t:Math.round(t))+e.unit}let h=O(()=>({[f.value]:{[d.value]:m(e.modelValue)}})),g,_,v,y,x;function S(t){if(t.isFirst){let t=a.value.getBoundingClientRect()[d.value];g=e.horizontal?`up`:`left`,_=e.unit===`%`?100:t,v=Math.min(_,p.value[1],Math.max(p.value[0],e.modelValue)),y=(e.reverse?-1:1)*(e.horizontal?1:r.lang.rtl?-1:1)*(e.unit===`%`?t===0?0:100/t:1),a.value.classList.add(`q-splitter--active`);return}if(t.isFinal){x!==e.modelValue&&n(`update:modelValue`,x),a.value.classList.remove(`q-splitter--active`);return}let i=v+y*(t.direction===g?-1:1)*t.distance[e.horizontal?`y`:`x`];x=Math.min(_,p.value[1],Math.max(p.value[0],i)),s[f.value].value.style[d.value]=m(x),e.emitImmediately&&e.modelValue!==x&&n(`update:modelValue`,x)}let C=O(()=>[[he,e.disable?void 0:S,void 0,{[e.horizontal?`vertical`:`horizontal`]:!0,prevent:!0,stop:!0,mouse:!0,mouseAllDir:!0}]]),w=O(()=>{let t={role:`separator`,"aria-orientation":e.horizontal?`horizontal`:`vertical`,"aria-label":e.separatorAriaLabel||r.lang.label.resize};if(e.disable)t[`aria-disabled`]=`true`;else{let n=p.value;t.tabindex=0,t[`aria-controls`]=c.value,t[`aria-valuemin`]=n[0],n[1]!==1/0&&(t[`aria-valuemax`]=n[1]),t[`aria-valuenow`]=Math.round(e.modelValue*100)/100}return t}),T=null;function E(t){let{keyCode:i}=t,o=e.horizontal?[38,40]:[37,39];if(i!==13&&i!==36&&i!==35&&!o.includes(i))return;ee(t);let s=p.value,c=e.unit===`%`?100:a.value.getBoundingClientRect()[d.value],l;if(i===13)e.modelValue===s[0]?l=T===null?e.modelValue:T:(T=e.modelValue,l=s[0]);else if(i===36)l=s[0];else if(i===35)l=s[1];else{let t=(i===o[0]?-1:1)*(e.reverse?-1:1)*(e.horizontal?1:r.lang.rtl?-1:1);l=e.modelValue+t*(e.unit===`%`?1:10)}let u=Math.min(c,s[1],Math.max(s[0],l));u!==e.modelValue&&n(`update:modelValue`,u)}function D(e,t){e<t[0]?n(`update:modelValue`,t[0]):e>t[1]&&n(`update:modelValue`,t[1])}return o(()=>e.modelValue,e=>{D(e,p.value)}),o(()=>e.limits,()=>{A(()=>{D(e.modelValue,p.value)})}),()=>{let n=[M(`div`,{ref:s.before,id:f.value===`before`?c.value:void 0,class:[`q-splitter__panel q-splitter__before`+(e.reverse?` col`:``),e.beforeClass],style:h.value.before},I(t.before)),M(`div`,{class:[`q-splitter__separator`,e.separatorClass],style:e.separatorStyle,...w.value,onKeydown:e.disable?void 0:E},[l(M(`div`,{class:`q-splitter__separator-area absolute-full`},I(t.separator)),C.value)]),M(`div`,{ref:s.after,id:f.value===`after`?c.value:void 0,class:[`q-splitter__panel q-splitter__after`+(e.reverse?``:` col`),e.afterClass],style:h.value.after},I(t.after))];return M(`div`,{class:u.value,ref:a},R(t.default,n))}}}),Ke=`githuman.fileListWidth`,qe=260,Q=220,$=600,Je=N(v({__name:`PanelResize`,setup(e){let t=T(ye(Ke,Q,$)??qe),n=O(()=>[Q,$]);function r(e){typeof e==`number`&&Number.isFinite(e)&&(t.value=xe(e,Q,$),pe.set(Ke,String(t.value)))}return(e,i)=>(d(),S(Ge,{"model-value":t.value,limits:n.value,unit:`px`,class:`file-explorer`,"before-class":`file-explorer__panel`,"after-class":`file-explorer__content`,"onUpdate:modelValue":r},{before:E(()=>[c(e.$slots,`panel`,{},void 0,!0)]),after:E(()=>[c(e.$slots,`content`,{},void 0,!0)]),_:3},8,[`model-value`,`limits`]))}}),[[`__scopeId`,`data-v-65488178`]]),Ye={class:`row items-center no-wrap q-gutter-x-xs`},Xe={class:`row items-center no-wrap q-gutter-x-xs`},Ze=v({__name:`FileExplorerTabs`,props:m({stagedFilesLength:{},unstagedFilesLength:{}},{modelValue:{default:`staged`},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=s(e,`modelValue`),{t:n}=U();return(r,i)=>(d(),S(ve,{modelValue:t.value,"onUpdate:modelValue":i[0]||=e=>t.value=e,dense:``,"no-caps":``,align:`left`,"narrow-indicator":``,class:`text-primary q-mb-sm`},{default:E(()=>[y(_e,{name:`staged`},{default:E(()=>[g(`div`,Ye,[g(`span`,null,h(C(n)(`changes.staged`)),1),y(me,{color:`positive`,rounded:``},{default:E(()=>[w(h(e.stagedFilesLength),1)]),_:1})])]),_:1}),y(_e,{name:`unstaged`},{default:E(()=>[g(`div`,Xe,[g(`span`,null,h(C(n)(`changes.unstaged`)),1),y(me,{color:`warning`,rounded:``},{default:E(()=>[w(h(e.unstagedFilesLength),1)]),_:1})])]),_:1})]),_:1},8,[`modelValue`]))}}),Qe={class:`file-tree-node`},$e={class:`row items-center no-wrap q-gutter-x-xs`},et=[`title`],tt=[`title`],nt={key:2},rt=N(v({__name:`FileTreeNode`,props:{node:{},selectedPath:{},expandedFolders:{},level:{}},emits:[`toggle-folder`,`file-select`],setup(e,{emit:t}){let n=e,r=t,o=8+n.level*12;return(t,n)=>{let s=u(`FileTreeNode`,!0);return d(),_(`div`,Qe,[e.node.type===`directory`?l((d(),S(G,{key:0,clickable:``,dense:``,style:j({paddingLeft:`${o}px`}),onClick:n[0]||=t=>r(`toggle-folder`,e.node.path)},{default:E(()=>[y(q,{avatar:``,class:`file-tree-node__icon-section`},{default:E(()=>[g(`div`,$e,[y(L,{name:`chevron_right`,size:`xs`,class:i([`file-tree-node__chevron`,{"file-tree-node__chevron--expanded":e.expandedFolders.has(e.node.path)}])},null,8,[`class`]),y(L,{name:e.expandedFolders.has(e.node.path)?`folder_open`:`folder`,size:`xs`,color:`warning`},null,8,[`name`])])]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,{class:`ellipsis file-tree-node__label`,title:e.node.path},h(e.node.name),9,et)]),_:1}),e.node.children?(d(),S(q,{key:0,side:``,class:`text-caption text-grey-6`},{default:E(()=>[w(h(e.node.children.length),1)]),_:1})):k(``,!0)]),_:1},8,[`style`])),[[z]]):l((d(),S(G,{key:1,clickable:``,dense:``,active:e.node.path===e.selectedPath,"active-class":`file-tree-node--selected`,style:j({paddingLeft:`${o+20}px`}),onClick:n[1]||=t=>r(`file-select`,e.node.path)},{default:E(()=>[y(q,{avatar:``,class:`file-tree-node__icon-section`},{default:E(()=>[y(L,{name:`insert_drive_file`,size:`xs`,color:`grey-6`})]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,{class:`ellipsis file-tree-node__label`,title:e.node.path},h(e.node.name),9,tt)]),_:1}),e.node.isChanged?(d(),S(q,{key:0,side:``},{default:E(()=>[y(L,{name:`fiber_manual_record`,size:`8px`,color:`warning`})]),_:1})):k(``,!0)]),_:1},8,[`active`,`style`])),[[z]]),e.node.type===`directory`&&e.expandedFolders.has(e.node.path)&&e.node.children?(d(),_(`div`,nt,[(d(!0),_(D,null,a(e.node.children,t=>(d(),S(s,{key:t.path,node:t,"selected-path":e.selectedPath,"expanded-folders":e.expandedFolders,level:e.level+1,onToggleFolder:n[2]||=e=>r(`toggle-folder`,e),onFileSelect:n[3]||=e=>r(`file-select`,e)},null,8,[`node`,`selected-path`,`expanded-folders`,`level`]))),128))])):k(``,!0)])}}}),[[`__scopeId`,`data-v-5f455ca2`]]);function it(){let e=P(),{t:n}=U(),r=t(),i=Z(),a=Y();async function o(e,t,a){try{await ce(t,{paths:[e]}),await i.refresh()}catch(e){r(n(a),e)}}function s(t){let r=(a.commentsByFile.get(t)??[]).filter(e=>!e.resolved).length;if(r===0)return o(t,`/api/git/stage`,`changes.actions.stageError`);e.dialog({title:n(`changes.actions.stageUnresolvedTitle`),message:n(`changes.actions.stageUnresolvedMessage`,{path:t,count:r}),persistent:!0,ok:{label:n(`changes.actions.stageUnresolvedOk`),flat:!0},cancel:{label:n(`changes.actions.discardConfirmCancel`),flat:!0}}).onOk(()=>{o(t,`/api/git/stage`,`changes.actions.stageError`)})}function c(e){return o(e,`/api/git/unstage`,`changes.actions.unstageError`)}function l(t){e.dialog({title:n(`changes.actions.discardConfirmTitle`),message:n(`changes.actions.discardConfirmMessage`,{path:t}),persistent:!0,ok:{label:n(`changes.actions.discardConfirmOk`),color:`negative`,flat:!0},cancel:{label:n(`changes.actions.discardConfirmCancel`),flat:!0}}).onOk(()=>{o(t,`/api/git/discard`,`changes.actions.discardError`)})}return{stage:s,unstage:c,discard:l}}var at={class:`file-list-item__path-row row no-wrap items-center`},ot=[`title`],st={class:`text-caption`},ct={class:`text-positive`},lt={class:`text-negative q-ml-xs`},ut=N(v({__name:`FileListItem`,props:{file:{},selected:{type:Boolean},source:{}},emits:[`click`],setup(e){let t={added:`A`,modified:`M`,deleted:`D`,renamed:`R`},n={added:`positive`,modified:`warning`,deleted:`negative`,renamed:`purple`},r=e,{t:a}=U(),{stage:o,unstage:s,discard:c}=it(),u=Y(),f=O(()=>J(r.file)),p=O(()=>u.commentsByFile.get(f.value)?.length??0);return(r,u)=>l((d(),S(G,{clickable:``,dense:``,class:`file-list-item`,active:e.selected,"active-class":`file-list-item--selected`,onClick:u[3]||=e=>r.$emit(`click`)},{default:E(()=>[y(q,{avatar:``,class:`file-list-item__icon-section`},{default:E(()=>[g(`span`,{class:i([`text-caption text-weight-bold text-mono`,`text-${n[e.file.status]}`])},h(t[e.file.status]),3)]),_:1}),y(q,{class:`text-mono`},{default:E(()=>[g(`div`,at,[g(`span`,{class:`ellipsis file-list-item__path-label`,title:f.value},h(f.value),9,ot),p.value>0?(d(),S(Oe,{key:0,compact:``,class:`file-list-item__badge`,count:p.value},null,8,[`count`])):k(``,!0)])]),_:1}),y(q,{side:``,class:`file-list-item__stats`},{default:E(()=>[g(`span`,st,[g(`span`,ct,`+`+h(e.file.additions),1),g(`span`,lt,`-`+h(e.file.deletions),1)])]),_:1}),y(q,{side:``,class:`file-list-item__actions`},{default:E(()=>[e.source===`unstaged`?(d(),_(D,{key:0},[l(y(V,{flat:``,dense:``,round:``,size:`sm`,icon:`undo`,"aria-label":C(a)(`changes.actions.discard`),title:C(a)(`changes.actions.discard`),onClick:u[0]||=F(e=>C(c)(f.value),[`stop`])},null,8,[`aria-label`,`title`]),[[z]]),l(y(V,{flat:``,dense:``,round:``,size:`sm`,icon:`add`,"aria-label":C(a)(`changes.actions.stage`),title:C(a)(`changes.actions.stage`),onClick:u[1]||=F(e=>C(o)(f.value),[`stop`])},null,8,[`aria-label`,`title`]),[[z]])],64)):l((d(),S(V,{key:1,flat:``,dense:``,round:``,size:`sm`,icon:`remove`,"aria-label":C(a)(`changes.actions.unstage`),title:C(a)(`changes.actions.unstage`),onClick:u[2]||=F(e=>C(s)(f.value),[`stop`])},null,8,[`aria-label`,`title`])),[[z]])]),_:1})]),_:1},8,[`active`])),[[z]])}}),[[`__scopeId`,`data-v-2e9eab18`]]),dt=v({__name:`BrowseModeToggle`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=s(e,`modelValue`),{t:n}=U();return(e,r)=>(d(),S(G,null,{default:E(()=>[y(q,null,{default:E(()=>[y(ge,null,{default:E(()=>[w(h(C(n)(`browse.toggle`)),1)]),_:1})]),_:1}),y(q,{side:``},{default:E(()=>[y(ie,{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,dense:``,size:`xs`},null,8,[`modelValue`])]),_:1})]),_:1}))}}),ft={class:`file-list-panel__header q-pa-sm`},pt={key:1,class:`text-subtitle2 q-mb-sm`},mt={key:0,class:`text-primary`},ht={key:0,class:`row justify-center q-pa-lg`},gt={key:0,class:`text-caption text-grey-6 q-px-md q-py-sm`},_t={key:0,class:`text-caption text-grey-6 q-px-md q-py-sm`},vt=32,yt=N(v({__name:`FileListPanel`,setup(e){let{t}=U(),{stagedFiles:n,unstagedFiles:r,initialLoading:i,error:o}=W(X()),s=Z(),{source:c,browseMode:l,filter:u,selectedPath:f,expandedFolders:m,treeInitialLoading:v,treeError:b,filteredDiffFiles:x,filteredTree:A,totalTreeFiles:j}=W(s),M=T(null),N=O(()=>M.value?.getScrollTarget()??null);return(e,T)=>(d(),_(D,null,[g(`div`,ft,[C(l)?(d(),_(`div`,pt,[w(h(C(t)(`browse.allFiles`))+` `,1),C(j)>0||!C(b)?(d(),_(`span`,mt,`(`+h(C(j))+`)`,1)):k(``,!0)])):(d(),S(Ze,{key:0,modelValue:C(c),"onUpdate:modelValue":T[0]||=e=>p(c)?c.value=e:null,"staged-files-length":C(n).length,"unstaged-files-length":C(r).length},null,8,[`modelValue`,`staged-files-length`,`unstaged-files-length`])),y(Re,{modelValue:C(u),"onUpdate:modelValue":T[1]||=e=>p(u)?u.value=e:null,placeholder:C(l)?C(t)(`browse.searchPlaceholder`):C(t)(`changes.filterPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),y(H),y(K,{ref_key:`scrollArea`,ref:M,class:`col file-list-panel__scroll`,"content-style":`padding: 4px 0`,"content-active-style":`padding: 4px 0`},{default:E(()=>[(C(l)?C(v):C(i))?(d(),_(`div`,ht,[y(B,{color:`primary`,size:`2em`})])):C(l)?(d(),_(D,{key:1},[C(A).length===0&&(!C(b)||C(u)&&C(j)>0)?(d(),_(`p`,gt,h(C(u)?C(t)(`browse.noMatchingFiles`):C(t)(`browse.noFiles`)),1)):k(``,!0),(d(!0),_(D,null,a(C(A),e=>(d(),S(rt,{key:e.path,node:e,"selected-path":C(f),"expanded-folders":C(m),level:0,onToggleFolder:C(s).toggleFolder,onFileSelect:C(s).selectFile},null,8,[`node`,`selected-path`,`expanded-folders`,`onToggleFolder`,`onFileSelect`]))),128))],64)):(d(),_(D,{key:2},[C(x).length===0&&(C(u)||!C(o))?(d(),_(`p`,_t,h(C(u)?C(t)(`browse.noMatchingFiles`):C(t)(`changes.emptyFileList`)),1)):k(``,!0),N.value?(d(),S(be,{key:C(c),"scroll-target":N.value,items:C(x),"virtual-scroll-item-size":vt},{default:E(({item:e})=>[(d(),S(ut,{key:C(J)(e),file:e,selected:C(f)===C(J)(e),source:C(c),onClick:t=>C(s).selectFile(C(J)(e))},null,8,[`file`,`selected`,`source`,`onClick`]))]),_:1},8,[`scroll-target`,`items`])):k(``,!0)],64))]),_:1},512),y(H),y(dt,{modelValue:C(l),"onUpdate:modelValue":T[2]||=e=>p(l)?l.value=e:null},null,8,[`modelValue`])],64))}}),[[`__scopeId`,`data-v-6daa93e0`]]),bt={class:`diff-status-bar row items-center q-gutter-x-md q-pa-sm text-body2`},xt={class:`text-weight-medium`},St={class:`text-positive`},Ct={class:`text-negative`},wt={key:0,class:`text-grey-6`},Tt={key:1,class:`text-grey-6`},Et={key:2,class:`text-grey-6`},Dt={key:3,class:`text-grey-6`},Ot=v({__name:`DiffStatusBar`,props:{files:{}},emits:[`expand-all`,`collapse-all`],setup(t,{emit:n}){let r=t,i=n,{t:a}=U(),o=O(()=>{let e=r.files.reduce((e,t)=>e+t.additions,0),t=r.files.reduce((e,t)=>e+t.deletions,0),n=r.files.filter(e=>e.status===`added`).length,i=r.files.filter(e=>e.status===`modified`).length,a=r.files.filter(e=>e.status===`deleted`).length,o=r.files.filter(e=>e.status===`renamed`).length;return{total:r.files.length,additions:e,deletions:t,added:n,modified:i,deleted:a,renamed:o}});return(t,n)=>(d(),_(`div`,bt,[g(`span`,xt,h(C(a)(`changes.filesChanged`,{count:o.value.total})),1),g(`span`,St,` +`+h(o.value.additions)+` `+h(C(a)(`changes.additions`)),1),g(`span`,Ct,` -`+h(o.value.deletions)+` `+h(C(a)(`changes.deletions`)),1),o.value.added?(d(),_(`span`,wt,h(o.value.added)+` `+h(C(a)(`changes.added`)),1)):k(``,!0),o.value.modified?(d(),_(`span`,Tt,h(o.value.modified)+` `+h(C(a)(`changes.modified`)),1)):k(``,!0),o.value.deleted?(d(),_(`span`,Et,h(o.value.deleted)+` `+h(C(a)(`changes.deletedPlural`)),1)):k(``,!0),o.value.renamed?(d(),_(`span`,Dt,h(o.value.renamed)+` `+h(C(a)(`changes.renamed`)),1)):k(``,!0),y(e),y(V,{dense:``,flat:``,"no-caps":``,size:`sm`,icon:`unfold_more`,label:C(a)(`changes.expandAll`),onClick:n[0]||=e=>i(`expand-all`)},null,8,[`label`]),y(V,{dense:``,flat:``,"no-caps":``,size:`sm`,icon:`unfold_less`,label:C(a)(`changes.collapseAll`),onClick:n[1]||=e=>i(`collapse-all`)},null,8,[`label`])]))}}),kt=v({__name:`ChangesFileCard`,props:{file:{}},setup(e){let t=e,n=Z(),r=X(),i=Y(),{expandedFiles:a}=W(n),{activeReview:o,commentsByFile:s}=W(i),c=O(()=>J(t.file)),l=O(()=>Ce(n.source,c.value)),u=O(()=>r.hunksOf(n.source,t.file)),f=O(()=>r.hunksFresh(n.source,t.file)),p=O(()=>r.hunksError(n.source,t.file)),m=O(()=>a.value.has(c.value)),h=O(()=>s.value.get(c.value)),g=O(()=>!!o.value);function _(){r.ensureHunks(n.source,t.file)}function v(){r.retryHunks(n.source,t.file)}return(t,i)=>(d(),S(je,{file:e.file,"state-key":l.value,detail:u.value,"hunks-loaded":f.value,"hunks-error":p.value,expanded:m.value,"agent-source":C(n).source,commentable:g.value,"comments-editable":g.value,comments:h.value,onLoadHunks:_,onRetryHunks:v,onClearHunksError:i[0]||=t=>C(r).clearHunksError(C(n).source,e.file),onToggle:i[1]||=e=>C(n).handleCardToggle(c.value),onExpand:i[2]||=e=>C(n).expandFile(c.value)},null,8,[`file`,`state-key`,`detail`,`hunks-loaded`,`hunks-error`,`expanded`,`agent-source`,`commentable`,`comments-editable`,`comments`]))}}),At={key:0,class:`active-review-bar row items-center q-gutter-x-sm q-px-sm no-wrap`},jt={class:`text-body2 ellipsis`},Mt=N(v({__name:`ActiveReviewBar`,setup(r){let{t:i}=U(),a=t(),o=Y(),{activeReview:s}=W(o),c=fe(),l=Me();function u(e){o.setStatus(e).catch(e=>{a(i(`reviews.comments.error`),e)})}return(t,r)=>C(s)?(d(),_(`div`,At,[y(L,{name:`rate_review`,size:`18px`,color:`primary`}),g(`span`,jt,h(C(s).name??C(i)(`reviews.list.unnamed`)),1),y(e),C(c).enabled?(d(),S(V,{key:0,flat:``,dense:``,"no-caps":``,size:`sm`,icon:C(n),label:C(i)(`agent.context.addReview`),onClick:r[0]||=e=>C(l)({kind:`review`,reviewId:C(s).id})},null,8,[`icon`,`label`])):k(``,!0),y(Ie,{status:C(s).status,onChange:u},null,8,[`status`])])):k(``,!0)}}),[[`__scopeId`,`data-v-2b6e4bdd`]]),Nt={key:1,class:`q-pa-md text-grey-6`},Pt=46,Ft=12,It=1.5,Lt=2,Rt=20,zt=N(v({__name:`DiffPanel`,setup(e){let{t}=U(),n=Z(),{diffFiles:r}=W(n),{error:i,loading:a}=W(X()),s=Y(),{activeReview:c}=W(s);Le({create:e=>s.createComment(e),edit:(e,t)=>s.editComment(e,t),remove:e=>s.deleteComment(e),resolve:e=>s.resolveComment(e),unresolve:e=>s.unresolveComment(e)});let l=T(null),u=O(()=>l.value?.getScrollTarget()??null);f(De,()=>u.value);let p=T(null);function m(){let e=p.value;return e?Promise.resolve(e):new Promise(e=>{let t=o(p,n=>{n&&(t(),e(n))})})}return o(()=>n.layoutVersion,async()=>{await A(),p.value?.reset()}),o(r,async(e,t)=>{e.length===t.length&&e.every((e,n)=>J(e)===J(t[n]))||(await A(),p.value?.reset())}),o(()=>n.scrollRequest,async e=>{if(!e)return;let t=await m();if(await A(),n.scrollRequest===e){t.scrollTo(e.index,`start`);for(let t=0;t<Rt;t++){await new Promise(e=>requestAnimationFrame(e));let t=document.getElementById(`diff-file-${e.path}`);if(t){t.scrollIntoView({block:`nearest`});return}}}}),(e,o)=>(d(),_(D,null,[C(i)?(d(),S(Ee,{key:0,title:C(t)(`changes.loadError`),message:C(i),loading:C(a),onRetry:o[0]||=e=>C(n).refresh()},null,8,[`title`,`message`,`loading`])):k(``,!0),C(r).length===0&&!C(i)?(d(),_(`div`,Nt,h(C(t)(`changes.emptyDiffPanel`)),1)):C(r).length>0?(d(),_(D,{key:2},[y(Mt),C(c)?(d(),S(H,{key:0})):k(``,!0),y(Ot,{files:C(r),onExpandAll:C(n).expandAllFiles,onCollapseAll:C(n).collapseAllFiles},null,8,[`files`,`onExpandAll`,`onCollapseAll`]),y(H),y(K,{ref_key:`scrollArea`,ref:l,class:`col`,"content-style":`padding: 8px; width: 100%; max-width: 100%`,"content-active-style":`padding: 8px; width: 100%; max-width: 100%`},{default:E(()=>[u.value?(d(),S(be,{key:C(n).source,ref_key:`virtualScroll`,ref:p,"scroll-target":u.value,items:C(r),"virtual-scroll-item-size":Pt,"virtual-scroll-slice-size":Ft,"virtual-scroll-slice-ratio-before":It,"virtual-scroll-slice-ratio-after":Lt},{default:E(({item:e})=>[(d(),_(`div`,{key:C(J)(e),class:`diff-virtual-slot`},[y(kt,{file:e},null,8,[`file`])]))]),_:1},8,[`scroll-target`,`items`])):k(``,!0)]),_:1},512)],64)):k(``,!0),!C(c)&&C(r).length>0?(d(),S(ze,{key:3})):k(``,!0)],64))}}),[[`__scopeId`,`data-v-edff3c16`]]),Bt={key:1,class:`q-pa-md text-grey-6`},Vt={key:0,class:`row justify-center q-pa-lg`},Ht={key:1,class:`q-pa-md text-grey-6`},Ut={class:`text-caption`},Wt={key:2,class:`q-pa-md text-grey-6`},Gt=v({__name:`FileContentPanel`,setup(e){let{t}=U(),n=Z(),{selectedPath:r,browseFileLines:i,browseFileIsBinary:a,browseFileLoading:s,browseFileError:c,treeError:l,refreshing:u}=W(n),{error:f}=W(X()),p=O(()=>f.value?{title:t(`changes.loadError`),message:f.value}:l.value?{title:t(`browse.treeLoadError`),message:l.value}:null),m=T(!1);return o(r,e=>{m.value=e?Pe(e):!1},{immediate:!0}),(e,o)=>(d(),_(D,null,[p.value?(d(),S(Ee,{key:0,title:p.value.title,message:p.value.message,loading:C(u),onRetry:o[0]||=e=>C(n).refresh()},null,8,[`title`,`message`,`loading`])):k(``,!0),C(r)?(d(),S(ke,{key:2,class:`col`},{header:E(()=>[y(Fe,{path:C(r)},{default:E(()=>[y(Te,{modelValue:m.value,"onUpdate:modelValue":o[1]||=e=>m.value=e,path:C(r)},null,8,[`modelValue`,`path`])]),_:1},8,[`path`])]),default:E(()=>[C(s)&&C(i).length===0&&!C(c)?(d(),_(`div`,Vt,[y(B,{color:`primary`,size:`2em`})])):C(c)?(d(),_(`div`,Ht,[w(h(C(t)(`changes.fullFileLoadError`))+` `,1),g(`div`,Ut,h(C(c)),1),y(V,{flat:``,dense:``,color:`primary`,class:`q-mt-sm`,label:C(t)(`changes.retry`),loading:C(u),onClick:o[2]||=e=>C(n).refresh()},null,8,[`label`,`loading`])])):C(a)?(d(),_(`div`,Wt,h(C(t)(`changes.binaryFile`)),1)):(d(),S(K,{key:3,class:`col`,"content-style":`padding: 8px`,"content-active-style":`padding: 8px`},{default:E(()=>[y(Ae,{path:C(r),lines:C(i),wrap:m.value},null,8,[`path`,`lines`,`wrap`])]),_:1}))]),_:1})):(d(),_(`div`,Bt,h(C(t)(`browse.selectFile`)),1))],64))}}),Kt=v({__name:`FileExplorer`,setup(e){let t=Z(),n=Y(),{browseMode:i}=W(t);r(()=>{t.refresh(),n.refresh()});let a=le([`files:changed`],()=>void t.refreshFromServerEvent());x(()=>a.close());let o=le([`review:created`,`review:updated`,`review:deleted`,`comment:created`,`comment:updated`,`comment:deleted`],()=>void n.refresh());return x(()=>o.close()),(e,t)=>(d(),S(Je,null,{panel:E(()=>[y(yt)]),content:E(()=>[C(i)?(d(),S(Gt,{key:0})):(d(),S(zt,{key:1}))]),_:1}))}}),qt=v({__name:`IndexPage`,setup(e){return(e,t)=>(d(),S(we,null,{default:E(()=>[y(Kt)]),_:1}))}});export{qt as default};
|