Commit Graph
100 Commits
Author SHA1 Message Date
Sebastian Martinez d5632ed534 Add global inbox 2025-01-23 22:28:00 +01:00
Sebastian Martinez dc87d3fa84 Adding Service and Storage traits for the inbox logic
To start making the backend codebase more future proof, I started
introducing the hexagonal architecture concept, of having `Service`
traits that is the public API and inner traits like `Storage`,
`Metrics`, etc. that can be implemented by different adapters like
`Sqlite`.

This is a first development in this direction.
2025-01-23 22:23:44 +01:00
Sebastian Martinez 62bdbc37d9 Fix creation of draft review in tauri command 2025-01-23 15:00:12 -06:00
Sebastian Martinez 84572389a9 Fix function param for creating reviews 2025-01-23 15:00:12 -06:00
Sebastian Martinez 6da4ffe344 Remove optional argument from review comments 2025-01-23 20:03:00 +01:00
Sebastian Martinez 3419b62194 Strongly type patch review verdict
Instead of typing a review verdict as `string | null` we should do
`"accept" | "reject" | null`
2025-01-23 20:02:42 +01:00
Sebastian Martinez 432db1ce5b Make Operation generic, and handle patch operations
So far we only supported issue operations on the `activity_by_id`
command.

With this commit we separate the commands into a `activity_by_issue` and
`activity_by_patch` command that calls a generic `activity_by_id` trait
implementation.

`Operation` now takes as a generic either `cob/issue/Action.ts` or
`cob/patch/Action.ts`.

Also `Operation` now stores the array of all `Action` that happened on
said operation. I'm not entirely sure if this will help us in the
future, but it represents more closely the state of the relation between
an `Operation` and the cob `Actions`.
2025-01-10 10:33:32 -06:00
Sebastian Martinez 2ac0c54a85 Add heartwood stream module
Introducing the `stream` module from the `heartwood` repo from patch
`40a8d72`, for our global inbox
2025-01-09 11:10:07 +01:00
Sebastian Martinez 153331f2e3 Infer file type for embeds for previews 2024-12-19 20:55:30 +01:00
Sebastian Martinez 01416e8aa5 Allow preview for empty body in ExtendedTextarea
Instead of disabling the preview feature when the body is empty, we show
`Nothing to preview`
2024-12-19 14:06:34 +01:00
Sebastian Martinez 684a5df136 Fix the Markdown height during preview in ExtendedTextarea 2024-12-19 14:03:27 +01:00
Sebastian Martinez 3276e5f7b5 Escape highlighted lines html tags 2024-12-19 13:54:25 +01:00
Sebastian Martinez 4647cea062 Fix syntax highlighting for languages with multiple injections 2024-12-19 13:54:25 +01:00
Sebastian Martinez 6aef218254 Restrict DOM sanitization to limited whitelist 2024-12-18 13:57:25 +01:00
Sebastian Martinez d6d9c43ee6 Fix regression on height of CreateIssue description field
Also instead of calculating the height of the description textarea we
should allow flexbox to extend the description field to fill the entire
height.
2024-12-17 12:06:42 +01:00
Sebastian Martinez a71f6b7feb Update dependencies 2024-12-17 10:42:51 +01:00
Sebastian Martinez 5f26f71b86 Avoid issue creation without title or description 2024-12-13 12:26:51 +01:00
Sebastian Martinez ca4d9d13fd Add embeds to the Textarea 2024-12-13 12:26:51 +01:00
Sebastian Martinez 3109e1d231 Try to fetch alias on AssigneeInput 2024-12-09 16:24:14 +01:00
Sebastian Martinez 3b0daefec4 Add alias tauri command
Returns either `null` or `string` for a lookup of an alias.
2024-12-09 16:20:37 +01:00
Sebastian Martinez 4f046343f3 Add syntax highlighting for diffs 2024-12-09 14:53:17 +01:00
Sebastian Martinez ece9ee1eb0 Avoid announcing changes when node is stopped
Also in the edge case that the front-end didn't update and the node just
stopped in between we fallback gracefully instead of returning an error
on the back-end.
2024-12-06 10:06:45 +01:00
Sebastian Martinez ebc8b3236b Improve e2e clipboard tests
Instead of trying to copy the RID of the first repo card, try to copy
the one you later expect.
2024-12-05 14:48:43 +01:00
Sebastian Martinez 653cf9a48d Sort repos by activity 2024-12-05 13:56:12 +01:00
Sebastian Martinez 5c8844db1c Fix radicle crate at 0.14.0
Also update `heartwood-release` to a pre-release to get the tests to
pass
2024-12-02 17:06:42 +01:00
Sebastian Martinez e093a5bc29 Let ts_rs run formatting types instead of prettier 2024-12-02 16:34:12 +01:00
Sebastian Martinez 45699e4fc8 Run checks for all rust crates 2024-12-02 16:34:12 +01:00
Sebastian Martinez 1f779a8a1b Add tests for list_commits unit test 2024-12-02 16:34:12 +01:00
Sebastian Martinez 70ee53e859 Add unit tests for radicle-types crate 2024-12-02 16:34:12 +01:00
Sebastian Martinez b7b71ccb11 Move AppState to radicle-types 2024-12-02 16:30:54 +01:00
Sebastian Martinez f5d559158b Add list_commits tauri command
Returns all commits for a specific repo.

Takes a `parent` argument as starting point for the git history.
Uses the `head` field of the project payload if not provided.

Instead of since and until timestamps uses cursor and take params to
paginate the commit history.
2024-12-02 16:30:54 +01:00
Sebastian Martinez a2776c27a4 Remove migrate argument since not used anymore 2024-12-02 16:30:54 +01:00
Sebastian Martinez 4670370562 Use Into::into instead of a closure in radicle-types 2024-11-22 11:15:05 +01:00
Sebastian Martinez c176fb9a3d Take a &identity::Did for the Author constructor 2024-11-22 10:54:49 +01:00
Sebastian Martinez 936d8197b1 Update heartwood crates to commit 2d13591
- Add `migrate::ignore` callback to `cob::cache` calls
- Remove the `Verified` trait from the `Doc` struct
- Update `Doc` fields with read-only methods
2024-11-22 10:54:49 +01:00
Sebastian Martinez 06437656c0 Add filter for repos to list_repos command
Instead of only returning seeded repos, this repo adds 3 new filter
options to the `list_repos` command, under the `show` field

- *all* - All repos that a user has initialized or forked (own
namespace)
- *seeded* - Repos that are beeing seeded by the user
- *delegate* - Repos that the current user is a delegate of.
2024-11-22 09:35:26 +01:00
Sebastian Martinez c35ab783a7 Add tests to verify authenticated identities 2024-11-21 10:29:24 +01:00
Sebastian Martinez f23206b83d Instrument authentication for e2e tests 2024-11-21 10:29:14 +01:00
Sebastian Martinez 7cdf6544ad Fix error serialize in the test-http-api crate 2024-11-20 14:20:57 +01:00
Sebastian Martinez ac550e0602 Remove unused console.logs 2024-11-20 12:16:43 +01:00
Sebastian Martinez 743b7af54c Revert logging from crabnebula dev tools to the tauri-plugin-log 2024-11-20 11:35:50 +01:00
Sebastian Martinez d52c01e26a Fix error serialize implementation 2024-11-19 10:42:37 +01:00
Sebastian Martinez 376e475adf Reset Issue component state on reload
There was a need to double click on the reply icon in the `Issue` view
to get `topLevelReplyOpen` to the correct state.
2024-11-08 06:49:09 +01:00
Sebastian Martinez 4537a003ad Refactor issue thread compute to the backend 2024-11-08 06:49:09 +01:00
Sebastian Martinez 93e2770d6d Fix focus on comment component 2024-11-06 13:26:29 +01:00
Sebastian Martinez 777430ab92 Add tests for clipboard, issue listing and issues 2024-11-05 12:43:52 +01:00
Sebastian Martinez 58891de06f Add svelte runes 2024-11-05 10:54:09 +01:00
Sebastian Martinez 737be7935a Replace <slot> directives with snippets 2024-11-01 13:27:21 +01:00
Sebastian Martinez 066034d603 Rename check github workflow name 2024-10-30 10:07:52 +01:00
Sebastian Martinez e37369062f Add playwright for e2e testing 2024-10-30 10:07:52 +01:00
Sebastian Martinez b853dea38b Fix patches_handler params 2024-10-30 10:07:52 +01:00
Sebastian Martinez ea981634d0 Add create_issue_comment_handler 2024-10-30 10:07:52 +01:00
Sebastian Martinez d90dc0735c Add test-http-api crate to make app work in browser
A new `invoke` function calls either the tauri backend or the
`test-http-api` function if ran in a browser.
2024-10-28 13:56:23 +01:00
Sebastian Martinez e0323e34bc Use tokio::time::sleep instead of blocking threads
Great explanation by @LarsWirzenius on the why

> Async code in Rust runs in one or more threads. Usually there's a
small number of threads that are multiplexed between different async
functions. The async executor chooses what threads to use and which
thread runs which async code. If the async code takes a long time, such
as by calling std::thread::sleep, the whole thread stops doing anything
else, and then no other async code runs in that thread, either.
2024-10-25 12:48:33 +02:00
Sebastian Martinez 56f55051eb Flatten Action with serde instead of ts_rs 2024-10-23 16:37:00 +02:00
Sebastian Martinez fc8613606d Fix entry_id field to camelCase 2024-10-23 12:47:52 +02:00
Sebastian Martinez 9b2240b933 Remove unused error variants 2024-10-23 12:22:34 +02:00
Sebastian Martinez 5277028e1a Add edit_patch tauri command 2024-10-23 11:58:40 +02:00
Sebastian Martinez 874605633e Refactor types
- Improves the hierarchy of types into separate folders
- Improve the types generation making more structs and less serde_json
- Adding more optional values to the tauri commands
2024-10-23 11:58:37 +02:00
Sebastian Martinez 0bdf0e7192 Extract rust types into its own crate 2024-10-22 13:10:12 +02:00
Sebastian Martinez caebd0a325 Narrow down IssueOp type by flattening it 2024-10-22 12:29:35 +02:00
Sebastian Martinez 5ed10a408c Fix overflow repo title and descriptions in RepoCard 2024-10-22 11:27:12 +02:00
Sebastian Martinez 996f0817f6 Return comments and replies instead of Oids 2024-10-22 10:49:06 +02:00
Sebastian Martinez 7267961c0f Update dependencies
Start using svelte 5 stable instead of next versions
2024-10-21 08:19:44 +02:00
Sebastian Martinez 6d649aea6d Add get_diff tauri command 2024-10-15 09:36:42 +02:00
Sebastian Martinez ebbccccc9d Add embed fix and add save_embed command 2024-10-14 13:47:41 +02:00
Sebastian Martinez a3a0850b49 Add activity timeline to Issue.svelte 2024-10-14 10:38:22 +02:00
Sebastian Martinez 3f88cedd40 Add activity_by_id tauri command 2024-10-14 10:36:44 +02:00
Sebastian Martinez 6ff895e9a5 Add embeds field to comments 2024-10-10 19:55:53 +02:00
Sebastian Martinez 2af8538851 Fix reactions TS types 2024-10-10 19:55:44 +02:00
Sebastian Martinez 98bd1ee6b5 Use number as type instead of bigint 2024-10-10 11:23:36 +02:00
Sebastian Martinez c17c659458 Remove return of ReviewId from create_draft_review for open reviews
Instead of returning the `ReviewId` for a existing `Review`
`create_draft_review` should return an error that the new `Review` is a
duplicate.
2024-10-10 09:43:25 +02:00
Sebastian Martinez c06ddc5b49 Use types.rs instead of the mod.rs system for types 2024-10-10 09:43:25 +02:00
Sebastian Martinez 6ea83dec47 Add edit_issue command 2024-10-09 11:43:58 +02:00
Sebastian Martinez 05fc9ec46c Add create and edit of patch reviews 2024-10-09 10:06:49 +02:00
Sebastian Martinez 8d76c8317c Create a cargo workspace to handle multiple crates 2024-10-08 15:21:19 +02:00
Sebastian Martinez 54ce1864eb Fix linter issue 2024-10-08 13:06:33 +02:00
Sebastian Martinez aebd7dda3a Fix missing entry in Cargo.lock 2024-10-08 13:06:23 +02:00
Sebastian Martinez ab27beca87 Add CobOptions to issue creation 2024-10-08 12:57:13 +02:00
Sebastian Martinez 3139c98834 Add rid to missing Patch component 2024-10-08 12:14:25 +02:00
Sebastian Martinez cb3a5ee586 Add mainBinaryName config option
Allows us to separate the binary name for the name of the rust crate.
2024-10-08 12:09:20 +02:00
Sebastian Martinez b2ea2cd2c9 Move src-tauri crate to crates/radicle-tauri 2024-10-08 12:09:20 +02:00
Sebastian Martinez 8c80f7b228 Add get_file_by_oid command, enables support for embeds 2024-10-08 12:07:47 +02:00
Sebastian Martinez 517d867f95 Revert to initial scroll position on filter change 2024-10-07 13:11:08 +02:00
Sebastian Martinez e51df19fed Add infinite scrolling for patches listing 2024-10-07 13:11:08 +02:00
Sebastian Martinez 6b8c73c615 Fix Patch revision listing 2024-10-03 16:56:02 +02:00
Sebastian Martinez c9f654f752 Rename Revision oid to head 2024-10-03 16:55:52 +02:00
Sebastian Martinez 56cbb761d5 Add id to revision type 2024-10-03 11:51:12 +02:00
Sebastian Martinez d3d690c0fb Update tauri to 2.0 stable 2024-10-03 10:00:10 +02:00
Sebastian Martinez 6dea9a648e Update rust-toolchain to 1.81 2024-10-03 08:43:51 +02:00
Sebastian Martinez 4d81bf53be Await event listeners and unlisten on unmount 2024-10-01 18:24:18 +02:00
Sebastian Martinez d4825ab1dd Some minor refactors on tauri commands 2024-09-30 11:00:47 +02:00
Sebastian Martinez 1a0de05a58 Add create_issue tauri command 2024-09-27 09:35:36 +02:00
Sebastian Martinez ddf44cea4e Rename and reorganize tauri commands 2024-09-26 11:30:44 +02:00
Sebastian Martinez 665c5a96bd Remove unusued lineNumbersGutter fn
It was a copy pasta function from `radicle-explorer` that if we need to
highlight files by line in the future e.g. changesets we should do it
better than this.
2024-09-26 09:54:07 +02:00
Sebastian Martinez 3b29598c77 Add prettylights css file
To provide the stylesheets for the classes that `starry-night` outputs
we use the `starry-night/style/both` stylesheets provided at
https://github.com/wooorm/starry-night?tab=readme-ov-file#css
2024-09-26 09:53:32 +02:00
Sebastian Martinez 56522a6083 Add buffer dependency for fixing build step
With the addition of the buffer polyfill we need to add the
corresponding dependency to fix the build step
2024-09-25 22:44:52 +02:00
Sebastian Martinez 608d211083 Add repo::diff tauri command 2024-09-25 16:59:47 +02:00
Sebastian Martinez 037ac391f8 Add issues_by_id, patches_by_id, revisions_by_patch, revisions_by_id
Also provides all the types related to it and a new npm script that
allows generating those types quickly.
2024-09-24 06:40:50 +02:00
Sebastian Martinez 9334ffb3c5 Add tauri commands to create comments and reply 2024-09-19 16:00:13 +02:00