Commit Graph
65 Commits
Author SHA1 Message Date
Sebastian Martinez 365674bc58 Provide a sync_status store
The `sync_status` would update every 10 seconds with the latest state of
all repos, to be displayed in the repo where needed.
2025-02-10 11:55:14 -06:00
Sebastian Martinez 450f6d6f0c Remove usage of DraftStore
@fintan:
The API of the DraftStore needs some improvement and it can be easy to
do the wrong thing when trying to publish the changes to the published
cob reference

Based on this PSA we should apply any changes to the patch revisions
directly, instead of using the `DraftStore`
2025-02-06 13:14:23 +01:00
Sebastian Martinez 9c021345dd Delete cobs/patch module 2025-02-06 13:08:31 +01:00
Rūdolfs Ošiņš 014a3e9eee Add revision commit list 2025-02-04 15:49:00 -06:00
Sebastian Martinez f34522b689 Implement a custom list_patches method to read directly from cache 2025-02-03 14:25:39 +01:00
Sebastian Martinez 5dd75959a0 Cleanup img-src attributes in the CSP directive
By restricting `img-src` in our CSP, we weren't allowing images from
e.g. https://github.com like CI badges to display.

With this change we allow users to add images from any `https`, `data`
or `blob` source, which is more user friendly.
2025-01-31 15:17:47 -06:00
Sebastian Martinez 19fdd17f99 Fix repo listing not displaying all repos
`Show::All` which is the default value should return all values obtained
from `storage.repositories()`.
This commit adds a `Show::Contributor` enum variant to only get repos
that the user has forked, initialized or contributed in some way.
2025-01-27 13:19:42 +01:00
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 4647cea062 Fix syntax highlighting for languages with multiple injections 2024-12-19 13:54:25 +01:00
Sebastian Martinez ca4d9d13fd Add embeds to the Textarea 2024-12-13 12:26:51 +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 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 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 7cdf6544ad Fix error serialize in the test-http-api crate 2024-11-20 14:20:57 +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 4537a003ad Refactor issue thread compute to the backend 2024-11-08 06:49:09 +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 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