Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
This PR aims to expose commit-application rejection details (reason + path) through the Rust schema → TypeScript type pipeline so frontend code can consume a typed RejectedChange instead of a loose [string, string] tuple.
Changes:
- Add
RejectedChange(tuple) andRejectionReason(string-union) to the generated@gitbutler/but-sdkTypeScript declarations. - Introduce a
RejectedChangetransport type inbut-apiand updateUICommitCreateResult.paths_to_rejected_changesto use it. - Add
schemars::JsonSchemaderivation support forbut-core::tree::create_tree::RejectionReasonbehindexport-schema.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/but-sdk/src/generated/index.d.ts | Exposes RejectedChange / RejectionReason types and uses them in UICommitCreateResult. |
| crates/but-core/src/tree/mod.rs | Makes RejectionReason schema-exportable when export-schema is enabled. |
| crates/but-api/src/commit.rs | Adds RejectedChange schema type + registration and updates commit-create result to return it. |
| pub struct RejectedChange( | ||
| pub RejectionReason, | ||
| #[cfg_attr(feature = "export-schema", schemars(with = "String"))] | ||
| pub but_serde::BStringForFrontend, |
| #[cfg(feature = "export-schema")] | ||
| but_schemars::register_sdk_type!(RejectedChange); | ||
| #[cfg(feature = "export-schema")] | ||
| but_schemars::register_sdk_type!(RejectionReason); |
|
@OliverJAsh the svelte app might need to be adapted for the new type. Also it would be neat to document the fields so that it's nice to consume |
I was aiming to just expose the type without changing it, but I'm not sure if I achieved that… |
|
right maybe nothing needs doing 🤷♂️ |
This type would be useful for the front-end.
I used AI to generate this and I have no idea if it's correct. If it looks wrong, would someone else be able to pick this up? 🙏
Closes GB-1168