fix(tui): empty states, context, and minor improvements to diff viewer (#28878)
This commit is contained in:
@@ -26,6 +26,7 @@ const PathInfo = Schema.Struct({
|
||||
export const VcsDiffQuery = Schema.Struct({
|
||||
...WorkspaceRoutingQueryFields,
|
||||
mode: Vcs.Mode,
|
||||
context: Schema.optional(Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0))),
|
||||
})
|
||||
|
||||
export class ApiVcsApplyError extends Schema.ErrorClass<ApiVcsApplyError>("VcsApplyError")(
|
||||
|
||||
@@ -48,8 +48,10 @@ export const instanceHandlers = HttpApiBuilder.group(InstanceHttpApi, "instance"
|
||||
return yield* vcs.status()
|
||||
})
|
||||
|
||||
const getVcsDiff = Effect.fn("InstanceHttpApi.vcsDiff")(function* (ctx: { query: { mode: Vcs.Mode } }) {
|
||||
return yield* vcs.diff(ctx.query.mode)
|
||||
const getVcsDiff = Effect.fn("InstanceHttpApi.vcsDiff")(function* (ctx: {
|
||||
query: { mode: Vcs.Mode; context?: number }
|
||||
}) {
|
||||
return yield* vcs.diff(ctx.query.mode, { context: ctx.query.context })
|
||||
})
|
||||
|
||||
const getVcsDiffRaw = Effect.fn("InstanceHttpApi.vcsDiffRaw")(function* () {
|
||||
|
||||
@@ -66,6 +66,7 @@ const QueryParameterSchemas: Record<string, OpenApiSchema> = {
|
||||
"GET /session roots": QueryBooleanOpenApi,
|
||||
"GET /session limit": { type: "number" },
|
||||
"GET /session/{sessionID}/message limit": { type: "integer", minimum: 0, maximum: Number.MAX_SAFE_INTEGER },
|
||||
"GET /vcs/diff context": { type: "integer", minimum: 0 },
|
||||
"GET /api/session limit": { type: "number" },
|
||||
"GET /api/session start": { type: "number" },
|
||||
"GET /api/session roots": QueryBooleanOpenApi,
|
||||
|
||||
Reference in New Issue
Block a user