Merge radicle-desktop into desktop/

Desktop history is kept as-is, so old commit IDs and signatures stay valid.
This commit is contained in:
Rūdolfs Ošiņš
2026-10-12 09:27:47 +02:00
676 changed files with 101026 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
[advisories]
ignore = [
"RUSTSEC-2023-0071", # https://radicle.network/nodes/iris.radicle.network/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/issues/bd8af7a5e3fd02c0963d7550a5cc2cab00950775
]
+4
View File
@@ -0,0 +1,4 @@
target/
node_modules/
releases/
.git/
+3
View File
@@ -0,0 +1,3 @@
watch_file rust-toolchain nix/*
use flake
+58
View File
@@ -0,0 +1,58 @@
on:
pull_request:
push:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
e2e:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.61.1-noble
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- run: |
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
xz-utils \
libssl-dev \
libxdo-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libwebkit2gtk-4.1-dev \
libjavascriptcoregtk-4.1-dev \
openssh-client
- run: npm ci
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cache heartwood binaries
uses: actions/cache@v5
with:
path: tests/tmp/bin
key: heartwood-${{ hashFiles('tests/support/heartwood-release') }}
- run: scripts/install-binaries
- run: npm run build:http
- run: mkdir -p tests/artifacts
- name: Run e2e tests
run: npm run test:e2e
# Kept for passing runs too: a test that passed on retry still leaves
# the failed attempt's logs and trace behind.
- name: Upload test artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v6
with:
name: e2e-artifacts
path: tests/artifacts
retention-days: 7
+41
View File
@@ -0,0 +1,41 @@
on:
pull_request:
push:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
lint-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- run: npm ci
- run: npm run check-js
lint-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
libxdo-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libwebkit2gtk-4.1-dev \
libjavascriptcoregtk-4.1-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: scripts/check-rs
+19
View File
@@ -0,0 +1,19 @@
on:
pull_request:
push:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- run: npm ci
- run: npm run test:unit
+36
View File
@@ -0,0 +1,36 @@
/build/
/target/
/target-release/
/releases/
node_modules/
# Tauri
crates/test-http-api/target
crates/radicle-tauri/target
crates/radicle-tauri/gen/schemas
# KaTeX files
public/*.min.css
public/fonts/KaTeX_**.ttf
public/fonts/KaTeX_**.woff
public/fonts/KaTeX_**.woff2
# Twemoji Assets
public/twemoji/*.svg
# Editor directories and files
.vscode
.idea
# Mac OS
.DS_Store
# Integration Tests
tests/tmp/**/*
tests/artifacts/**/*
# direnv cache
/.direnv/
.claude/settings.local.json
.claude/worktrees/
+3
View File
@@ -0,0 +1,3 @@
min-release-age=7
strict-allow-scripts=true
loglevel=warn
+1
View File
@@ -0,0 +1 @@
24.15.0
+3
View File
@@ -0,0 +1,3 @@
crates
*.md
*.lock
+8
View File
@@ -0,0 +1,8 @@
{
"arrowParens": "avoid",
"plugins": ["prettier-plugin-svelte"],
"svelteSortOrder": "options-scripts-styles-markup",
"bracketSameLine": true,
"proseWrap": "never",
"htmlWhitespaceSensitivity": "ignore"
}
+39
View File
@@ -0,0 +1,39 @@
FROM ghcr.io/drips-network/ryph-universal:1
USER root
# Tauri's system libraries (radicle-desktop's cargo build, clippy and tests),
# and bzip2 for radicle-explorer's .tar.bz2 test fixtures.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
libjavascriptcoregtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libxdo-dev \
bzip2 \
&& rm -rf /var/lib/apt/lists/*
# The OS libraries Playwright's browsers need: WebKit for radicle-desktop's e2e
# tests, Chromium and WebKit for radicle-explorer's and always-on-node's. The
# browsers themselves are installed by each member's setup, keyed on its lockfile.
RUN npx -y playwright@1.61.1 install-deps chromium webkit \
&& rm -rf /var/lib/apt/lists/* /root/.npm \
&& chown -R runner:runner /usr/local/share/mise
# garden-broker's `make lint`.
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v2.14.0/install.sh \
| sh -s -- -b /usr/local/bin v2.14.0 \
&& golangci-lint version
USER runner
# garden-broker's go.mod files say `go 1.25.0`, a minimum, and pin no toolchain.
# Without this, mise reads that line as a pin and tries to download Go 1.25.0
# instead of using the image's newer Go.
ENV MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS=node,python,deno,bun
# Debug info is most of a warm target/ (8 GB of radicle-desktop's 13). Line
# tables keep file:line in panics and backtraces. Set for the whole machine,
# so the image's warm build and every run's builds use the same profile.
ENV CARGO_PROFILE_DEV_DEBUG=line-tables-only
+43
View File
@@ -0,0 +1,43 @@
# radicle-desktop environment
This repository's `.ryph/Dockerfile` is the machine for the whole Radicle
workspace. On top of the universal image it adds:
- Tauri's system libraries (`libwebkit2gtk-4.1-dev`,
`libjavascriptcoregtk-4.1-dev`, `libayatana-appindicator3-dev`,
`librsvg2-dev`, `libxdo-dev`), so the Rust crates build here;
- the OS libraries Playwright's Chromium and WebKit need, and `bzip2`;
- `golangci-lint` v2.14.0 in `/usr/local/bin`, for garden-broker;
- `MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS=node,python,deno,bun`, so mise
does not read a `go.mod` `go` line as a pin: Go is the image's own.
- `CARGO_PROFILE_DEV_DEBUG=line-tables-only`: dev and test builds carry
line tables, not full debug info. Backtraces keep file and line. Do not
override it, or every crate rebuilds.
`.ryph/setup.yml` installs the npm dependencies, Playwright's WebKit and the
pinned Radicle binaries (`tests/tmp/bin`), and warms clippy, the test build
and the e2e backend (`test-http-api`, `rad-job`) in `target/`. Node 24.15.0
(`.nvmrc`) and Rust 1.97.1 (`rust-toolchain.toml`) are installed by mise and
rustup on first use.
## Checks (what CI runs)
```sh
npm run check-js # svelte-check, eslint, prettier
scripts/check-rs # cargo fmt --check, clippy -Dwarnings, cargo test
npm run test:unit
npm run test:e2e # WebKit; needs scripts/install-binaries, done by setup
```
`npm run check:ci` runs all of them in order and logs to
`tests/tmp/check-ci.log`. The machine has 2 CPUs: the Rust test build and the
e2e suite are the slow parts.
## What does not work here
- Chromium cannot be installed by Playwright: its download redirects to
`storage.googleapis.com`, which the egress allowlist refuses. This app's
e2e tests use WebKit only and are unaffected; radicle-explorer's and
always-on-node's Chromium e2e tests are.
- There is no container runtime, so nothing that runs `docker` or `podman`
works (always-on-node's `pnpm test:e2e`, garden-broker's integration tests).
+26
View File
@@ -0,0 +1,26 @@
steps:
# An image layer keeps whole-second mtimes, but cargo fingerprints the
# nanoseconds it saw at build time. Rounding tracked files down to the
# second before building keeps the warm target/ fresh at run time. Never
# set them to the commit time: on an incremental image build that can make
# a changed file older than its stale build output.
- name: round source mtimes down to whole seconds (image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || git ls-files -z | xargs -0 perl -e ''for (@ARGV) { next if -l; my $m = (lstat)[9]; utime $m, $m, $_ }'''
- name: install npm dependencies
run: npm install --prefer-offline
- name: install Playwright WebKit
run: npx playwright install webkit
- name: install the pinned Radicle binaries for e2e tests
run: scripts/install-binaries
# The cargo warm steps only fill the image's target/. At run time cargo
# builds what a command needs when it runs.
- name: warm clippy (scripts/check-rs, image builds only)
run: 'mkdir -p build && { [ "$RYPH_SETUP_PHASE" != image ] || cargo clippy --workspace --all-targets --locked; }'
- name: warm cargo test (scripts/check-rs, image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || cargo test --workspace --no-run --locked'
- name: warm the e2e backend (tests/support/globalSetup.ts, image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || { cargo build --manifest-path ./crates/test-http-api/Cargo.toml --locked && cargo build -p radicle-job --bin rad-job --locked; }'
# rustc's incremental cache only speeds up rebuilding this repo's own
# crates after an edit, and it is gigabytes. Image builds only.
- name: drop the incremental cache (image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || rm -rf target/debug/incremental'
+395
View File
@@ -0,0 +1,395 @@
### v0.17.0
**Features**
- Added Releases and Release views for browsing a repository's releases and
their artifacts, with links, mentions, a warning on releases and artifacts
published by others, and the artifact node and rad-artifact CLI versions
in the status popover
- Added smart links and better mentions: `rad:` links now open in the app,
Radicle entities in comments are linked, and mentions search node aliases
- Added a repository identity document view
- Assignees are now suggested by alias as you type
- Added keyboard shortcuts
- Added Markdown shortcuts to textareas
- Markdown now renders Mermaid diagrams, GitHub style alerts and repository
images in READMEs
- Task list items in Markdown can now be checked and unchecked
- AsciiDoc READMEs are now rendered in the source view, with cross
references linked to their source
- Document links now stay inside the app
- Merged patches are now sorted by merge time
- The patch list now shows the latest revision's diffstat
- You can seed a missing repository directly from mentions
- Adding new repositories will immediately fetch them from the network
- Issues can now be created with only a subject
- The issue page now matches the patch page design, with the metadata
buttons in the action row
- Collapsed sidebar items now show tooltips, and private repositories show
a lock on their avatar
- Polished sidebar animations and spacing
**Bug fixes**
- Back and Forward are now disabled when they lead nowhere
- Fixed file tree folders flickering and closing when selecting a file
- The source view now keeps the browsed file when navigating
- Fixed muddy diff colors in light mode
- Fixed pasted images not rendering
- Retina screenshots are now shown at their intended size
- Dropped files now go only into the textarea under the cursor
- Files dropped from Windows paths are now named correctly
- Assignee changes are now shown correctly in timelines
- A number of fixes to Markdown rendering
- RIDs with non-base58 characters are now treated as invalid
- Failed CI job lookups are now handled
**Shout-out to our contributors 🙏✨**
- [2color](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MktwkohCx8aHZ1QCjVZUiLmX92oPZFxRiFZkbq32Tk5Tkm)
- [brandonoxendine](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
- [efstajas](https://radicle.network/nodes/iris.radicle.network/users/z6MkqG3Pu18RWuZ8GrqGQ9s4yoi5rfhcLq9rpo1ZZX8en994)
### v0.16.0
**Features**
- Added a collapsible, resizable sidebar that remembers its width and
collapsed state across launches
- Repositories that are only in local storage can now be shown alongside
seeded ones, controlled by a new setting
- Private repositories are now marked with a lock and public ones with a
globe in the sidebar
- Added "Stop seeding" to the sidebar context menu, with the option to
delete the repository files as well
- Patches now show the branch they are opened against, in the patch list,
the patch page and the merge activity item
- The author and committer popover now shows emails, lists co-authors, and
shows both the authored and committed time
- The detected git binary is now shown in the settings
- The Guide button in the sidebar can now be hidden
- Added a Cmd+, shortcut to open Settings
- The issue modal can now be submitted with Cmd+Return from the title field
- The app now logs to a file when it isn't launched from a terminal
**Bug fixes**
- Fixed patch diffs for revisions whose head is a merge commit dropping
most of their commits
- Fixed a single duplicate path, such as a symlink replaced by a regular
file, emptying the whole Changes tab
- Git and rad are now resolved outside the session PATH, fixing git not
being found when the app is launched from the desktop
- Editing a patch title no longer resets its target branch to the default
branch
- The patch description is no longer collapsed while it is being edited
- Reacting or commenting no longer makes the view jump
- Clicking a commit in a patch no longer shifts the layout
- The window stays draggable while a modal is open
- Save buttons are now disabled instead of hidden when there is nothing to
save
- Commit time is now used instead of author time consistently
**Shout-out to our contributors 🙏✨**
- [2color](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MktwkohCx8aHZ1QCjVZUiLmX92oPZFxRiFZkbq32Tk5Tkm)
- [brandonoxendine](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
- [upbeat-molar](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkmRaBHeJuJKQE21aRVSe2uW3j5T7gQQAEAY7UF4tr5jRn)
### v0.15.0
**Features**
- Reworked the patch page UX, review UI and activity timeline
- Patch changes are now rendered with Pierre's diff viewer
- Added a comment column to the review view: every line comment is listed
beside the files, and clicking one scrolls the diff to it
- The review view's column can now switch between comments and a file tree,
show only the commented files, or be put away to give the diff full width
- Added a comment stepper to the Changes tab for walking a diff's comments
- Diff settings now live in the settings modal, grouped with the code font,
instead of a per-view popover
- Patches can now be deleted
- Discussion comments can now be deleted
- Resolved comments now show who resolved them
- Added an author hover card
- Timestamps now show their absolute value on hover
- Added dismissible hints to textboxes
**Shout-out to our contributors 🙏✨**
- [brandonoxendine](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
### v0.14.0
**Features**
- Added a share widget to repo, issue and patch pages, replacing the separate
copy-link and open-in-explorer buttons
- Commit diffs are now rendered with Pierre's diff viewer
**Bug fixes**
- Links now use your configured explorer and preferred seed instead of
hardcoded defaults
- Fixed console windows flashing when navigating repos on Windows
**Shout-out to our contributors 🙏✨**
- [brandonoxendine](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
- [ck](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkuLTraBcQJ1FNVPjN61vWXhMsTznTzr1Rmn1SfFmdhFkY)
- [hlatimer266](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkkwiqeqFrjPNvSNuNACpynpwiuVHqF8YHwGLzCBSfNJzZ)
- [justarandomgeek](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkwfrBy9mKTfcVELcV4wc6zfN379FPMnAqsxnwt4j2TdQ2)
### v0.13.0
**Features**
- Added a diff actions menu with copy-to-clipboard and save-to-disk options
**Performance**
- Virtualized the file tree, commit diff, and patch-review diff views for smoother scrolling on large repositories and diffs
- Sped up opening files and computing diff stats in large repositories
- Sped up commit counting using git's bitmap index
- Improved issues list loading performance
**Bug fixes**
- Fixed patches list pagination loading everything at once instead of paging
- Fixed the update checker reading a stale cached version file
- Fixed the Linux launcher showing the wrong app name
- List scroll position is now restored when navigating back and forth through history
### v0.12.0
**Features**
- Added a branch/tag selector to browse repository source from different users
- A placeholder is now shown when a commit has no message
**Performance**
- Improved overall performance for repository browsing
**Bug fixes**
- Fixed the Linux AppImage failing to launch on non-Debian distributions
- Fixed duplicate CI job runs by deduplicating them by run ID
### v0.11.0
**Features**
- Added a commit history list and single-commit view for repositories
- Added repo pinning to keep favorite repos at the top of the sidebar
- Added a fuzzy filter to the notification inbox
- Added a reload button to the sidebar
- Added a custom in-app context menu for sidebar items and disabled the native browser menu app-wide
- Redesigned the CI job status popover and added it to the single-commit view
- Reviews can now be started directly from a code comment on a revision diff
- Issue and patch breadcrumbs now show status-specific labels and link back to the matching filter
- The first revision description is now shown on the patch view
- Replies are now indented into individual boxes for clearer threading
- Reactions have been restyled and your own reactions are highlighted
- Comment actions now appear only on hover for a calmer reading experience
- Polished comment form footer
- Save actions across the app now use brand styling
- The discussion comment form is now always visible
- Repo header text is now truncated to avoid layout overflow
- Navigating to a repo now expands the All Repos section in the sidebar
**Bug fixes**
- Patch authors can now change the state of their own patches
- Hardened rendered markdown links and restricted job log links to http(s) URLs
- Fixed the update checker not detecting new versions
- Fixed CSP rules so local assets load reliably in release builds
- Fixed a regression where the first patch revision wasn't editable
- Fixed inbox "Show all" behavior and aligned group filter styling
- Fixed emoji substitution in notification teasers and twemoji alt attributes
- Fixed markdown tables rendering text vertically
- Fixed ordered list clipping in rendered README and markdown content
- Fixed text-input autofocus after portal moves
- Fixed the contributor filter in the repo list
- Fixed the add-repo button incorrectly expanding the All Repos section
- Excluded job COBs without runs from the jobs list
- Registered the dialog plugin in release builds so file pickers work
- Worked around alias lookups failing in some cases
- Improved Windows compatibility (CLI detection and npm script hints)
**Shout-out to our contributors 🙏✨**
- [2color](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MktwkohCx8aHZ1QCjVZUiLmX92oPZFxRiFZkbq32Tk5Tkm)
- [brandonhaslegs](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
- [fintohaps](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM)
- [julien](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkgvaRdahQZfnf7ccMHByeHtTYrMrM3MuSGYawF6ZL6DNj)
- [justarandomgeek](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkwfrBy9mKTfcVELcV4wc6zfN379FPMnAqsxnwt4j2TdQ2)
- [killerdevildog](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mkgi3EW1eVVb4REBZspeU9cHrJev8GEZae7uACZJkxCKMz)
- [lorenz](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz)
- [yarikoptic](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkfCGiLM9j7AstSVNGhqtz9zkAhfb863etsbkRnXsipuRr)
### v0.10.0
- Fixed app loading indicator
- Sidebar scroll position is now preserved when navigating between views
- Changed default seed node to iris.radicle.network
- Updated to Heartwood 1.7.1
**Shout-out to our contributors 🙏✨**
- [lorenz](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz)
### v0.9.0
- Redesigned the entire app with a new UI kit — typography, colors, icons,
avatars, and border radii have all been updated for a more polished,
consistent appearance matching the rest of the ecosystem
- Replaced blockies-based avatars with a new DID-based avatar system
- Moved Settings and Create Issue into fullscreen modals
- Default theme now follows the system theme
- Removed window decorations on macOS for a cleaner, more native feel
- Updated app icon
- Rewrote app navigation and layouts
- Added a sidebar that gives you access to all your repos
- App now opens directly to the notification inbox on startup
- Getting started guide shown to new users on first launch
- Added a setting to disable the notification badge
- Added a code font setting
- Fixed reactions and edits incorrectly targeting the root comment instead of the intended reply
- Restricted issue/patch state, labels, and assignees to delegates only
**Shout-out to our contributors 🙏✨**
- [brandonhaslegs](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkpwnLQxFBQXyMK3Es91s8A7Ew7G11BFFyng1dqZR8QhG3)
- [julien](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkgvaRdahQZfnf7ccMHByeHtTYrMrM3MuSGYawF6ZL6DNj)
### v0.8.0
- CI job run statuses are now shown for the default branch and in patch revision commit lists
- Fixed an issue where commit listings reversed when switching between patches
- Fixed a bug that prevented replying to review comments
- Fixed app version check feature
- Fixed incorrect IDs (e.g., patch revision, comments) being copied to clipboard
- Improved accessibility and keyboard navigation in repository filters on the home view
**Shout-out to our contributors 🙏✨**
- [geigerzaehler](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mki9XNNHeVRnYS88U59iCBzKUp2xWM3f4zvA3cXuKJFvWF)
### v0.7.1
- Fixed a bug in patch and notification lists caused by a library incompatibility
### v0.7.0
- Source code can now be browsed directly within the app
- Draft reviews and their comments can now be deleted
- Issue state changes no longer affect the issue list in the sidebar
- Repo cards now support keyboard navigation for easier selection
**Shout-out to our contributors 🙏✨**
- [geigerzaehler](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mki9XNNHeVRnYS88U59iCBzKUp2xWM3f4zvA3cXuKJFvWF)
### v0.6.1
- Fixed a bug where the app wouldn't onboard new users or locked identities
- Fixed regression where the current version of the app wasn't including the commit it was built from
### v0.6.0
- UI polish: scrollbars now auto-hide across the app
- Fixed button overflow in issue and patch sidebars
- Draft reviews can now be composed before publishing
- Added opt-in automatic app update notifications
- Reworked patch view for clearer, more efficient code reviews
**Shout-out to our contributors 🙏✨**
- [geigerzaehler](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mki9XNNHeVRnYS88U59iCBzKUp2xWM3f4zvA3cXuKJFvWF)
### v0.5.0
- The app is now officially available via Arch packaging
- Fuzzy search now supports repo IDs, descriptions, and issue/patch IDs
- Updated Heartwood crates to support Radicle 1.2.0
- Bundled Radicle tooling and Node in Nix for smoother setup
- Added a startup spinner if launch takes more than 1 second
- Fullscreen error shown if COB schemas need upgrading
- UI improvements: themed scrollbars that auto-hide and match the color scheme
- Repos can now be seeded by RID directly from the app
- Added warning and one-click recovery when COB cache is out of date, fixing mismatched patch/issue counters
- Fixed regression where single patch view didn’t load additional items on scroll
**Shout-out to our contributors 🙏✨**
- [geigerzaehler](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mki9XNNHeVRnYS88U59iCBzKUp2xWM3f4zvA3cXuKJFvWF)
- [Kuehle](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkgFWv1K9Lqvi5VHm4mtfDo5MvanWVNYU1gkvT9Rwr1Lu7)
- [lorenz](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz)
- [tippfehlr](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MksSTAFPKk7eQju9aGzK64qpfiSnKQ1tJWv1rdzRd5bMHU)
### v0.4.1
- Fixed a bug in the release pipeline to update the latest artifacts
- Added WSL2 installation instructions to https://radworks.garden
### v0.4.0
- Notification inbox is now accessible from any view without navigating away
- App icon now shows a badge with the unread notification count and polls for updates
- Added global breadcrumbs for easier navigation
- Added quick copy actions for IDs and links to https://radicle.network
- Syntax highlighting added for diffs in markdown code blocks (` ```diff `)
- Improved dropdown UI — triggers are now visually distinct when active
- Fixed AppImage bug affecting Arch, Fedora, and Red Hat users
- App is now officially available for Nix users via https://radworks.garden
**Shout-out to our contributors 🙏✨**
- [fintohaps](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM)
- [geigerzaehler](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6Mki9XNNHeVRnYS88U59iCBzKUp2xWM3f4zvA3cXuKJFvWF)
- [lorenz](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz)
- [tshepang](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MkfPSKW7AgQqXSi8fgEJMduHpm9ABmsPYwPhMeF7PssonK)
- [youthlic](https://radicle.network/nodes/iris.radicle.network/users/did:key:z6MktsSuE4bVYbuTtEPjmhrQWA7dMri7GUg9Qp9o8tRCsmhu)
### v0.3.0
- New onboarding guide to help users get started faster
- Repo homepage now shows README and project info for quick overview
- UI improvements, including clearer buttons and a new "New Patch" button
- Settings now show version and commit hash for easier support
- Fixed notification count and comment placement bugs
### v0.2.0
- Added font size controls for enhanced readability and accessibility
- Introduced contextual explainers in key areas to guide users and improve overall user experience
- Enhanced contrast in both dark and light modes to improve legibility and visual clarity
### v0.1.0
- First public release
+195
View File
@@ -0,0 +1,195 @@
# radicle-desktop
Tauri desktop app for Radicle. Svelte 5 frontend communicates with a Rust
backend via Tauri IPC commands. TypeScript types are generated from Rust
structs using ts-rs (`crates/radicle-types/`).
## Tech stack
- Svelte 5 with runes syntax (`$state`, `$derived`, `$props`, `$effect`)
- TypeScript, Vite, Vitest, Playwright
- Path aliases: `@app` (src), `@bindings` (crates/radicle-types/bindings), `@tests`
## Commands
### Development
```sh
npm run tauri dev # full Tauri dev build with hot reload
npm run start:http # test-http-api backend on :8081 (no Tauri runtime)
npm start # Vite dev server; in a browser it talks to test-http-api
```
Set `VITE_LOG_INVOKE_TIMINGS=true` to log each command's duration
(`[invoke] <command> <ms>ms`) to the browser console. It is off by default.
### Checks and linting
```sh
npm run check # svelte-check, eslint, prettier, then scripts/check-rs
npm run format # auto-fix prettier issues
```
### Unit tests
```sh
npm run test:unit
```
DOMPurify does not sanitize under happy-dom (the unit-test environment):
`<script>` and `onerror=` pass through, and `setConfig` allowlists are
ignored. Don't assert sanitization in `tests/unit/`; verify it in the real
app or in an E2E test.
### E2E tests
```sh
npm run test:e2e
npm run test:e2e -- tests/e2e/<file>.spec.ts
```
Run `./scripts/install-binaries` once after cloning and whenever the Radicle
binaries are updated.
Peer keys have no passphrase, so the app authenticates without an
ssh-agent. Tests that need a running node use the `peer` fixture; tests that
need an ssh-agent use the `sshAuthSock` fixture and create a peer with a
`passphrase`. When a fixture depends on one peer seeing another's changes,
wait for the node event with `waitForEvent` instead of sleeping.
Reload pages with `reload(page)` from `@tests/support/fixtures.js`, not
`page.reload()`, and navigate a page that already shows the app with
`goto(page, url)`: the app polls the backend, and the harness would otherwise
fail the test on the request the navigation cancels.
Tests run against a production build in `tests/tmp/build`, served by
`vite preview`; the build takes a few seconds at startup. Set
`E2E_DEV_SERVER=1` to run against the Vite dev server instead, e.g. for hot
reload while writing tests.
Each run writes `tests/artifacts/results.json` (Playwright's JSON report)
and per-test logs in `tests/artifacts/<test>/`. Read those to see what
failed in a run someone else started.
`SKIP_FIXTURE_CREATION=true` skips fixture creation for faster iteration.
Only use it when you are solely editing `.spec.ts` files and fixtures
already exist from a previous full run. Any change to app code, the Rust
backend, or test fixtures requires a full run.
```sh
SKIP_FIXTURE_CREATION=true npm run test:e2e
```
### Rust backend (`crates/`)
```sh
scripts/check-rs # cargo fmt --check, clippy on all targets, test
```
### Regenerate TypeScript bindings
Run after changing any type annotated with `#[derive(TS)]` in
`crates/radicle-types/`, and commit the regenerated bindings:
```sh
npm run generate-types
```
### Changes across layers
Adding or changing a Tauri command touches these layers in order:
1. `crates/radicle-types/src/` — add/update Rust types with `#[derive(TS)]` and
`#[ts(export)]`, run `npm run generate-types` to update `@bindings`
2. `crates/radicle-types/src/traits/` — add the method to the relevant port trait;
default implementation goes here, not in the command handler
3. `crates/radicle-tauri/src/commands/` — add the `#[tauri::command]` handler
(thin wrapper: `ctx.method()`), register in `crates/radicle-tauri/src/lib.rs`
4. `crates/test-http-api/src/` — mirror the same route so E2E tests keep working;
`cargo test -p test-http-api --test parity` fails until you do. A command
that can't work over HTTP goes in `TAURI_ONLY` in
`crates/test-http-api/tests/parity.rs`, with the reason
5. `src/` — call via `invoke<T>("command_name", args)`, import types from `@bindings`
### Tests for a feature
When adding tests for a feature, go through `docs/testing-checklist.md` and
report which items are covered and which don't apply. The testing strategy is
in `docs/adr/0001-testing-strategy.md`.
### Pre-push checklist
`npm run check:ci` runs everything CI runs on every PR (checks, unit tests,
`install-binaries`, E2E tests) and stops at the first failure. It writes the
full output, with each step's duration and exit code, to
`tests/tmp/check-ci.log`.
## Backend architecture
Three crates in a hexagonal architecture; the reasoning is in
`docs/adr/0002-backend-architecture.md`.
- `radicle-types` — domain types, ports (`src/traits/`), domain services
(`src/domain/`), the SQLite adapter (`src/outbound/`), ts-rs bindings
- `radicle-tauri` — Tauri driver; `AppState` implements the ports
- `test-http-api` — HTTP driver for E2E tests and `npm run start:http`;
`Context` implements the same ports
Ports have full default implementations, so a driver only implements
`Profile`. Paginated list views (issues, patches, notifications) go through
a domain `Service` backed by the SQLite adapter instead of the ports; new
lists over large data sets should do the same.
## Domain glossary
- **NID** — Node ID, the public key in a DID (`did:key:z6Mk...`)
- **COB** — Collaborative Object (issue, patch, or identity as a Git DAG)
- **Delegate** — authorized repo maintainer; signatures determine canonical state
- **Seed** — hosting/replicating a repo; seed nodes are always-on servers
- **Canonical refs** — branches/tags resolved by delegate quorum
## Code conventions
- Prefer `undefined` over `null`
- Do not add comments unless explicitly asked. When writing comments,
use proper English sentences
- Ask before adding new dependencies
- When proposing a bigger architectural change, record it as a new ADR in
`docs/adr/`, numbered after the last one and in the same format
### Svelte components
- Props use `$props()`: `const { foo, bar = undefined }: Props = $props()`
- CSS: scoped styles with design tokens (`var(--color-text-primary)`,
`var(--txt-body-m-regular)`, `var(--border-radius-sm)`); use `:global()`
for styling slotted or `{@html}` content
- Loading states: `{#await promise}` blocks for inline async;
local `loading` boolean with `try/catch` for imperative fetches
### TypeScript
- Import backend types from `@bindings/*` — these are generated by ts-rs, never
hand-write interfaces that duplicate them
- Use ES private fields (`#field`), not the TypeScript `private` keyword
- Call Tauri commands via `invoke<T>("command_name", { arg })` from `@app/lib/invoke`
### Rust backend
- All serialized types live in `crates/radicle-types/src/`; annotate new types
with `#[derive(Serialize, TS)]`, `#[serde(rename_all = "camelCase")]`,
`#[ts(export)]`, and `#[ts(export_to = "<dir>/")]`
- Optional fields: `#[serde(skip_serializing_if = "Option::is_none")]`
- Error type: `radicle_types::error::Error`
- `rust-toolchain.toml` tracks heartwood's. When bumping the `radicle` crate,
check heartwood's toolchain too: an older rustc fails inside the dependency
with a confusing error (e.g. E0382 in `cob/identity.rs` for radicle 0.25)
## Commit messages
- Imperative mood: "Add feature" not "Added feature"
- Capitalize subject, no trailing period, max 50 chars
## Do NOT
- Do not use `npm test` — no default test script exists
- Do not use `yarn` or `pnpm` — use npm
- Do not use `npx vitest` or `npx playwright test` — use the `npm run` scripts
+8450
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
[workspace]
members = ["crates/*"]
resolver = "2"
[patch.crates-io.radicle-job]
git = "https://seed.radicle.dev/z2UcCU1LgMshWvXj6hXSDDrwB8q8M/z6MkwPUeUS2fJMfc2HZN1RQTQcTTuhw4HhPySB8JeUg2mVvx"
branch = "patches/da55667860741ee221483fc42fa7cbbb58e0cfc2"
[workspace.package]
edition = "2024"
# Same as `dev` but with debug_assertions disabled.
[profile.dev-without-assertions]
inherits = "dev"
debug-assertions = false
+109
View File
@@ -0,0 +1,109 @@
FROM --platform=linux/arm64 ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Add amd64 multiarch so we can install x86_64 sysroot libraries alongside
# the native ARM64 toolchain. This lets the Tauri CLI run natively (fast, no
# QEMU) while cross-compiling the Rust binary to x86_64.
# Configure apt: restrict existing ports.ubuntu.com sources to arm64, then add
# archive.ubuntu.com as the amd64 source (ports.ubuntu.com has no amd64 packages).
RUN dpkg --add-architecture amd64 && \
sed -i '/^Types: deb/a Architectures: arm64' /etc/apt/sources.list.d/ubuntu.sources && \
printf 'Types: deb\nURIs: http://archive.ubuntu.com/ubuntu\nSuites: noble noble-updates noble-backports noble-security\nComponents: main restricted universe multiverse\nArchitectures: amd64\nSigned-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n' \
> /etc/apt/sources.list.d/archive-amd64.sources && \
apt-get update
# Native ARM64 build essentials + cross-compilation toolchain.
# Each install runs apt-get update so a cache-invalidated layer can't resolve
# against the stale index from the standalone update above (404s on packages
# the mirror has since superseded).
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
crossbuild-essential-amd64 \
curl \
git \
qemu-user-static \
rustup \
wget \
file \
jq \
zstd \
squashfs-tools
# Tauri system library headers for the amd64 target.
# The :amd64 suffix installs the x86_64 variant via multiarch.
#
# gobject-introspection-bin-linux:amd64 was split out as an arch-specific
# package in Ubuntu 24.04 but is not available for amd64 in the multiarch
# context on an ARM64 host. It is not needed for cross-compilation (it
# contains g-ir-scanner which is a build tool, not a library). We create
# empty dummy packages to satisfy apt's dependency resolver so the webkit
# and related libraries can be installed normally.
RUN for pkg in gobject-introspection-bin gobject-introspection-bin-linux; do \
mkdir -p /tmp/fake/DEBIAN && \
printf "Package: %s\nVersion: 1.80.1-1\nArchitecture: amd64\nMaintainer: fake\nDescription: fake\n" \
"$pkg" > /tmp/fake/DEBIAN/control && \
dpkg-deb --build /tmp/fake /tmp/${pkg}_1.80.1-1_amd64.deb && \
rm -rf /tmp/fake; \
done && \
dpkg -i /tmp/gobject-introspection-bin_1.80.1-1_amd64.deb \
/tmp/gobject-introspection-bin-linux_1.80.1-1_amd64.deb && \
rm -f /tmp/gobject-introspection-bin*.deb
# Refreshes the index in-layer; see the note on the build-essentials install.
RUN apt-get update && apt-get install -y --no-install-recommends \
libxdo-dev:amd64 \
libssl-dev:amd64 \
libayatana-appindicator3-dev:amd64 \
librsvg2-dev:amd64 \
libwebkit2gtk-4.1-0:amd64 \
libjavascriptcoregtk-4.1-0:amd64 \
libwebkit2gtk-4.1-dev:amd64 \
libjavascriptcoregtk-4.1-dev:amd64 \
libjpeg-turbo8:amd64
# Rust: native ARM64 toolchain so the Tauri CLI runs without emulation,
# plus the x86_64 target for the actual compiled output.
#
# The channel is read from rust-toolchain.toml rather than pinned here. rustup
# honours that file inside the mounted workspace, so a hardcoded version is
# silently overridden: rustup auto-installs the workspace toolchain with only
# the host target, and the build fails with "Target x86_64-unknown-linux-gnu is
# not installed". Copying the file also makes the layer cache invalidate on a
# toolchain bump.
#
# `rustup default` must be the command that installs the toolchain: the distro
# rustup only creates its CARGO_HOME proxies along that path, and `rustup target
# add` fails with "rustup is not installed at '/root/.cargo'" without them.
# Installing the toolchain separately first makes `rustup default` a no-op and
# breaks the target add.
COPY rust-toolchain.toml /tmp/rust-toolchain.toml
RUN RUST_VERSION="$(sed -n 's/^channel *= *"\(.*\)"/\1/p' /tmp/rust-toolchain.toml)" \
&& test -n "$RUST_VERSION" \
&& rm -f /tmp/rust-toolchain.toml \
&& rustup default "$RUST_VERSION" \
&& rustup target add x86_64-unknown-linux-gnu
# Node.js 24 (ARM64, runs natively); matches the engines requirement in package.json
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y nodejs
# Cross-compilation environment for Cargo and cc-rs.
# crossbuild-essential-amd64 provides x86_64-linux-gnu-{gcc,g++,pkg-config}.
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
ENV CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc
ENV CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++
ENV AR_x86_64_unknown_linux_gnu=x86_64-linux-gnu-ar
# pkg-config must resolve against the amd64 sysroot, not the ARM64 one.
ENV PKG_CONFIG=x86_64-linux-gnu-pkg-config
# Default pkg-config search paths for tools that call `pkg-config` directly
# (e.g. linuxdeploy-plugin-gtk.sh). Already in x86_64-linux-gnu-pkg-config but
# not in the plain `pkg-config` binary that runs on the ARM64 host.
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
# Ubuntu 24.04 installs gtk-query-immodules-3.0 under libgtk-3-0t64.
# binfmt_misc routes it through QEMU when invoked by the GTK linuxdeploy plugin.
ENV PATH="/usr/lib/x86_64-linux-gnu/libgtk-3-0t64:${PATH}"
SHELL ["/bin/bash", "-c"]
+621
View File
@@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
+94
View File
@@ -0,0 +1,94 @@
# Radicle Desktop
This desktop application lets you interact with [Radicle][rad], a peer-to-peer code collaboration and publishing stack.
## Installation
See [radicle.dev/desktop#install](https://radicle.dev/desktop#install).
### From source
**Prerequisites:**
- [Node.js][nod] (24 or higher) and [npm][npm]
- [Rust][rus] toolchain (1.77 or higher)
- [Tauri system dependencies][tau]
On Windows, NPM's script shell must be set to a POSIX compatible shell such as
[Git Bash][gfw]:
```
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
```
Run the following commands to build the desktop app locally:
```
git clone https://seed.radicle.dev/z4D5UCArafTzTQpDZNQRuqswh3ury.git radicle-desktop
cd radicle-desktop
npm install
npm run tauri build
```
Then run one of the builds that the script outputs at the end.
## Development
To start the app in development mode with hot reload:
```
npm run dev
```
To log how long every backend command takes, for performance work, set
`VITE_LOG_INVOKE_TIMINGS=true`. Each call then prints `[invoke] <command> <ms>ms`
to the browser console (visible at debug level):
```
VITE_LOG_INVOKE_TIMINGS=true npm run dev
```
A dev build uses its own identifier, so it runs next to an installed release,
and it never registers itself as the handler for `rad:` links. On Linux and
Windows, open a link in it by starting the dev binary a second time with the
link as its argument, while `npm run dev` is running:
```
target/dev-without-assertions/radicle-desktop rad:z4D5UCArafTzTQpDZNQRuqswh3ury
```
On macOS links only reach app bundles. Quit the installed app, then build and
open a debug bundle:
```
npm run tauri build -- --debug --bundles app
```
## Releasing
Releases are driven by an interactive, phased script. Start one with:
```
scripts/release --phase prep --version X.Y.Z
```
Each phase does its mechanical work, then prints the manual tasks for its gate
and the exact flag to resume with. List the phases and see the configuration
with `scripts/release --list` and `scripts/release --help`.
## Getting in touch
To get in touch with the maintainers, sign up to our [official chat on Zulip][zul].
## License
The UI is distributed under the terms of GPLv3. See [LICENSE][lic] for details.
[gfw]: https://gitforwindows.org
[lic]: ./LICENSE
[rad]: https://radicle.dev
[nod]: https://nodejs.org
[npm]: https://www.npmjs.com
[rus]: https://www.rust-lang.org/
[tau]: https://v2.tauri.app/start/prerequisites/#system-dependencies
[zul]: https://radicle.zulipchat.com/#narrow/stream/444463-desktop
+34
View File
@@ -0,0 +1,34 @@
# Generated by `cargo cooldown init`.
# Edit values as needed for your project.
[cooldown]
incompatible-publish-age = "deny"
# `floor` keeps initial Cargo.lock versions as the minimum; `ignore` allows lower versions.
lockfile-baseline = "floor"
[registry]
global-min-publish-age = "7 days"
# Optional allow rules.
# Add as many `allow.exact` and `allow.package` entries as you need.
# `allow.exact` fully allows one exact crate version.
# `allow.package` lowers the cooldown for one crate name.
# Use `min-publish-age = "0"` in `allow.package` to exclude that crate from cooldown.
# [allow.global]
# minutes = 1440
# [[allow.package]]
# crate = "tokio"
# min-publish-age = "1 hour"
# [[allow.package]]
# crate = "openssl"
# min-publish-age = "0"
# [[allow.exact]]
# crate = "serde"
# version = "1.0.218"
# [[allow.exact]]
# crate = "serde_json"
# version = "1.0.145"
+3
View File
@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/gen/schemas
+48
View File
@@ -0,0 +1,48 @@
[package]
name = "radicle-tauri"
version = "0.0.0"
authors = ["Rudolfs Osins <rudolfs@osins.org>", "Sebastian Martinez <me@sebastinez.dev>"]
license = "MIT OR Apache-2.0"
edition.workspace = true
publish = false
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "lib"]
doctest = false
[build-dependencies]
tauri-build = { version = "2.6.1", features = ["isolation"] }
[dependencies]
anyhow = { version = "1.0.90" }
base64 = { version = "0.22.1" }
either = { version = "1.15" }
git2 = { version = "0.21", default-features = false, features = ["vendored-libgit2"] }
infer = { version = "0.19.0" }
log = { version = "0.4.22" }
radicle = { version = "0.25", features = ["tor", "i2p"] }
radicle-types = { version = "0.1.0", path = "../radicle-types" }
serde = { version = "1.0.0", features = ["derive"] }
serde_json = { version = "1.0.0" }
tauri = { version = "2.11.1", features = ["isolation"] }
tauri-plugin-clipboard-manager = { version = "2.3.2" }
tauri-plugin-deep-link = { version = "2.4.10" }
tauri-plugin-dialog = { version = "2.7.0" }
tauri-plugin-log = { version = "2.8.0" }
tauri-plugin-shell = { version = "2.3.5" }
tauri-plugin-single-instance = { version = "2.4.5", features = ["deep-link"] }
tauri-plugin-window-state = { version = "2.4.1" }
thiserror = { version = "2.0.12" }
ts-rs = { version = "12.0.1", features = ["serde-json-impl", "no-serde-warnings"] }
ssh-key = { version = "0.6.3" }
zeroize = { version = "1.8.1", features = ["serde"] }
[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = ["custom-protocol"]
# this feature is used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = ["tauri/custom-protocol"]
devtools = ["tauri/devtools"]
+15
View File
@@ -0,0 +1,15 @@
use std::env;
use std::process::Command;
fn main() {
let head = env::var("GIT_HEAD").unwrap_or_else(|_| {
Command::new("git")
.args(["rev-parse", "--short", "HEAD"])
.output()
.map(|output| String::from_utf8(output.stdout).expect("output from Git is UTF-8"))
.unwrap_or("unknown".into())
});
println!("cargo::rustc-env=GIT_HEAD={head}");
tauri_build::build()
}
@@ -0,0 +1,25 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"clipboard-manager:allow-write-text",
"clipboard-manager:default",
"core:app:default",
"core:event:default",
"core:image:default",
"core:menu:default",
"core:path:default",
"core:resources:default",
"core:tray:default",
"core:webview:default",
"core:window:allow-set-badge-count",
"core:window:allow-start-dragging",
"core:window:default",
"deep-link:default",
"dialog:default",
"log:default",
"shell:allow-open"
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+26
View File
@@ -0,0 +1,26 @@
{{!--
Custom .desktop template for Linux bundles, referenced from
tauri.linux.conf.json (bundle.linux.deb.desktopTemplate).
On Linux, Tauri derives the package name (deb/rpm) from `productName`, with
no way to set the two independently (https://github.com/tauri-apps/tauri/issues/13999,
still open). We override `productName` to "radicle-desktop" in
tauri.linux.conf.json so the package and its artifacts are named
"radicle-desktop". The cost is that the launcher/menu entry would otherwise
read "radicle-desktop" too.
This template is Tauri's built-in default with a single change: `Name` is
hardcoded to "Radicle" instead of `{{name}}`, so the app shows as "Radicle"
in the desktop environment while the package stays "radicle-desktop". Keep
every other line in sync with Tauri's default template on major upgrades.
--}}
[Desktop Entry]
Categories={{categories}}
{{#if comment}}
Comment={{comment}}
{{/if}}
Exec={{exec}}
Icon={{icon}}
Name=Radicle
Terminal=false
Type=Application
@@ -0,0 +1,27 @@
pub mod auth;
pub mod cob;
pub mod diff;
pub mod identity;
pub mod inbox;
pub mod profile;
pub mod repo;
pub mod startup;
pub mod thread;
use radicle_types::AppState;
use radicle_types::error::Error;
/// Run a blocking, synchronous port method on the async runtime's blocking
/// pool instead of a worker thread. The port methods do blocking libgit2/COB
/// work; running them inline on an `async` command would pin a runtime worker
/// for the call's full duration and let a slow read (e.g. listing refs or
/// jobs) stall every other command queued behind it. Cloning `AppState` is
/// cheap — it only clones the `Profile` (paths and keys, not open handles).
pub(crate) async fn blocking<T, F>(ctx: tauri::State<'_, AppState>, f: F) -> Result<T, Error>
where
F: FnOnce(AppState) -> Result<T, Error> + Send + 'static,
T: Send + 'static,
{
let state = (*ctx).clone();
tauri::async_runtime::spawn_blocking(move || f(state)).await?
}
@@ -0,0 +1,17 @@
use radicle::crypto::ssh::Passphrase;
use radicle_types::error::Error;
use crate::AppState;
#[tauri::command]
pub fn authenticate(
ctx: tauri::State<AppState>,
passphrase: Option<Passphrase>,
) -> Result<(), Error> {
radicle_types::auth::authenticate(&ctx.profile, passphrase)
}
#[tauri::command]
pub(crate) fn init(alias: String, passphrase: Passphrase) -> Result<(), Error> {
radicle_types::auth::init(alias, passphrase)
}
@@ -0,0 +1,76 @@
use std::path::PathBuf;
use radicle::git;
use radicle::identity;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::thread::Thread;
use tauri_plugin_dialog::DialogExt;
use crate::AppState;
pub mod issue;
pub mod job;
pub mod patch;
pub mod release;
#[tauri::command]
pub async fn get_embed(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
name: Option<String>,
oid: git::Oid,
) -> Result<tauri::ipc::Response, Error> {
let embed = ctx.get_embed(rid, name, oid)?;
Ok(tauri::ipc::Response::new(embed.into_bytes()))
}
#[tauri::command]
pub async fn save_embed_by_path(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
path: PathBuf,
) -> Result<git::Oid, Error> {
ctx.save_embed_by_path(rid, path)
}
#[tauri::command]
pub async fn save_embed_by_bytes(
ctx: tauri::State<'_, AppState>,
request: tauri::ipc::Request<'_>,
) -> Result<git::Oid, Error> {
let tauri::ipc::InvokeBody::Raw(body) = request.body() else {
return Err(Error::SaveEmbedError);
};
let rid = request
.headers()
.get("rid")
.and_then(|rid| rid.to_str().ok())
.and_then(|rid| rid.parse().ok())
.ok_or(Error::SaveEmbedError)?;
let (name, bytes) = types::cobs::split_embed_upload(body).ok_or(Error::SaveEmbedError)?;
ctx.save_embed_by_bytes(rid, name, bytes)
}
#[tauri::command]
pub async fn save_embed_to_disk(
app_handle: tauri::AppHandle,
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
oid: git::Oid,
name: String,
) -> Result<(), Error> {
let Some(path) = app_handle
.dialog()
.file()
.set_file_name(name)
.blocking_save_file()
else {
return Err(Error::SaveEmbedError);
};
let path = path.into_path()?;
ctx.save_embed_to_disk(rid, oid, path)
}
@@ -0,0 +1,98 @@
use radicle::git;
use radicle::identity;
use radicle::issue::TYPENAME;
use radicle_types as types;
use radicle_types::domain::issue::service::Service;
use radicle_types::domain::issue::traits::IssueService;
use radicle_types::error::Error;
use radicle_types::outbound::sqlite::Sqlite;
use radicle_types::traits::Profile;
use radicle_types::traits::cobs::Cobs;
use radicle_types::traits::issue::Issues;
use radicle_types::traits::issue::IssuesMut;
use crate::AppState;
#[tauri::command]
pub fn create_issue(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
new: types::cobs::issue::NewIssue,
opts: types::cobs::CobOptions,
) -> Result<types::cobs::issue::Issue, Error> {
ctx.create_issue(rid, new, opts)
}
#[tauri::command]
pub fn edit_issue(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
cob_id: git::Oid,
action: types::cobs::issue::Action,
opts: types::cobs::CobOptions,
) -> Result<types::cobs::issue::Issue, Error> {
ctx.edit_issue(rid, cob_id, action, opts)
}
#[tauri::command]
pub fn delete_issue(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
cob_id: git::Oid,
opts: types::cobs::CobOptions,
) -> Result<(), Error> {
ctx.delete_issue(rid, cob_id, opts)
}
#[tauri::command]
pub(crate) async fn list_issues(
ctx: tauri::State<'_, AppState>,
issue_service: tauri::State<'_, Service<Sqlite>>,
rid: identity::RepoId,
status: Option<types::cobs::query::IssueStatus>,
skip: Option<usize>,
// None: return all issues, `skip` is ignored.
take: Option<usize>,
) -> Result<types::cobs::PaginatedQuery<Vec<types::cobs::issue::Issue>>, Error> {
let profile = ctx.profile();
let aliases = profile.aliases();
Ok(issue_service.list_paginated(rid, status.unwrap_or_default(), skip, take, &aliases)?)
}
#[tauri::command]
pub(crate) fn issue_by_id(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Option<types::cobs::issue::Issue>, Error> {
ctx.issue_by_id(rid, id)
}
#[tauri::command]
pub(crate) fn comment_threads_by_issue_id(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Option<Vec<types::cobs::thread::Thread>>, Error> {
ctx.comment_threads_by_issue_id(rid, id)
}
#[tauri::command]
pub fn activity_by_issue(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Vec<types::cobs::Operation<types::cobs::issue::Action>>, Error> {
ctx.activity_by_id(rid, &TYPENAME, id)
}
#[tauri::command]
pub async fn rebuild_issue_cache(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
on_event: tauri::ipc::Channel<types::cobs::CacheEvent>,
) -> Result<(), Error> {
ctx.rebuild_issue_cache(rid, |event| on_event.send(event).map_err(Error::from))
}
@@ -0,0 +1,17 @@
use radicle::git;
use radicle::identity::RepoId;
use radicle_types::cobs::job;
use radicle_types::error::Error;
use radicle_types::traits::job::Jobs;
use crate::AppState;
use crate::commands::blocking;
#[tauri::command]
pub async fn list_jobs(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
sha: git::Oid,
) -> Result<Vec<job::Job>, Error> {
blocking(ctx, move |ctx| ctx.list_jobs(rid, sha)).await
}
@@ -0,0 +1,99 @@
use radicle::patch::{ReviewId, TYPENAME};
use radicle::storage::{ReadRepository as _, ReadStorage};
use radicle::{git, identity};
use radicle_types as types;
use radicle_types::cobs;
use radicle_types::domain::patch::models;
use radicle_types::domain::patch::service::Service;
use radicle_types::domain::patch::traits::PatchService;
use radicle_types::error::Error;
use radicle_types::outbound::sqlite::Sqlite;
use radicle_types::traits::Profile;
use radicle_types::traits::cobs::Cobs;
use radicle_types::traits::patch::Patches;
use radicle_types::traits::patch::PatchesMut;
use crate::AppState;
#[tauri::command]
pub async fn list_patches(
ctx: tauri::State<'_, AppState>,
sqlite_service: tauri::State<'_, Service<Sqlite>>,
rid: identity::RepoId,
status: Option<types::cobs::query::PatchStatus>,
skip: Option<usize>,
// None: return all patches, `skip` is ignored.
take: Option<usize>,
) -> Result<types::cobs::PaginatedQuery<Vec<models::patch::Patch>>, Error> {
let profile = ctx.profile();
let aliases = profile.aliases();
let doc = profile.storage.repository(rid)?.identity_doc()?;
Ok(sqlite_service.list_paginated(rid, status, skip, take, &doc, &aliases)?)
}
#[tauri::command]
pub fn patch_by_id(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Option<models::patch::Patch>, Error> {
ctx.get_patch(rid, id)
}
#[tauri::command]
pub fn revisions_by_patch(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Option<Vec<models::patch::Revision>>, Error> {
ctx.revisions_by_patch(rid, id)
}
#[tauri::command]
pub fn edit_patch(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
cob_id: git::Oid,
action: models::patch::Action,
opts: cobs::CobOptions,
) -> Result<models::patch::Patch, Error> {
ctx.edit_patch(rid, cob_id, action, opts)
}
#[tauri::command]
pub fn delete_patch(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
cob_id: git::Oid,
opts: cobs::CobOptions,
) -> Result<(), Error> {
ctx.delete_patch(rid, cob_id, opts)
}
#[tauri::command]
pub fn create_patch_review(
ctx: tauri::State<AppState>,
args: models::patch::CreateReviewArgs,
) -> Result<ReviewId, Error> {
ctx.create_patch_review(args)
}
#[tauri::command]
pub fn activity_by_patch(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Vec<types::cobs::Operation<models::patch::Action>>, Error> {
ctx.activity_by_id(rid, &TYPENAME, id)
}
#[tauri::command]
pub async fn rebuild_patch_cache(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
on_event: tauri::ipc::Channel<cobs::CacheEvent>,
) -> Result<(), Error> {
ctx.rebuild_patch_cache(rid, |event| on_event.send(event).map_err(Error::from))
}
@@ -0,0 +1,314 @@
use radicle::git;
use radicle::identity;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::artifact_node::ArtifactNode;
use radicle_types::traits::release::{ReleaseFilter, Releases};
use radicle_types::traits::release_mut::ReleasesMut;
use tauri::Emitter;
use tauri_plugin_dialog::DialogExt;
use crate::AppState;
use crate::commands::blocking;
#[tauri::command]
pub(crate) async fn list_releases(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
filter: Option<ReleaseFilter>,
skip: Option<usize>,
// None: return all releases, `skip` is ignored.
take: Option<usize>,
) -> Result<types::cobs::PaginatedQuery<Vec<types::cobs::release::Release>>, Error> {
blocking(ctx, move |ctx| ctx.list_releases(rid, filter, skip, take)).await
}
#[tauri::command]
pub(crate) async fn release_by_id(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
id: git::Oid,
) -> Result<Option<types::cobs::release::Release>, Error> {
blocking(ctx, move |ctx| ctx.release_by_id(rid, id)).await
}
#[tauri::command]
pub(crate) async fn release_counts(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
) -> Result<types::cobs::release::ReleaseCounts, Error> {
blocking(ctx, move |ctx| ctx.release_counts(rid)).await
}
#[tauri::command]
pub async fn compute_artifact_cid(
ctx: tauri::State<'_, AppState>,
path: std::path::PathBuf,
) -> Result<types::cobs::release::ArtifactDigest, Error> {
blocking(ctx, move |ctx| ctx.compute_artifact_cid(path)).await
}
#[tauri::command]
pub async fn create_or_open_release(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
oid: git::Oid,
tag: Option<git::Oid>,
) -> Result<String, Error> {
blocking(ctx, move |ctx| ctx.create_or_open_release(rid, oid, tag)).await
}
#[tauri::command]
pub async fn register_artifact(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
name: String,
size_bytes: u64,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.register_artifact(rid, release_id, cid, name, size_bytes)
})
.await
}
#[tauri::command]
pub async fn attest_artifact(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
path: std::path::PathBuf,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.attest_artifact(rid, release_id, cid, path)
})
.await
}
#[tauri::command]
pub async fn set_artifact_metadata(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
key: String,
value: serde_json::Value,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.set_artifact_metadata(rid, release_id, cid, key, value)
})
.await
}
#[tauri::command]
pub async fn remove_artifact_metadata(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
key: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.remove_artifact_metadata(rid, release_id, cid, key)
})
.await
}
#[tauri::command]
pub async fn add_artifact_location(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
url: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| ctx.add_location(rid, release_id, cid, url)).await
}
#[tauri::command]
pub async fn remove_artifact_location(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
url: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.remove_location(rid, release_id, cid, url)
})
.await
}
#[tauri::command]
pub async fn redact_artifact(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
reason: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.redact_and_unseed_artifact(rid, release_id, cid, reason)
})
.await
}
/// Pick one or more files to attach to a release. Returns an empty list when
/// the user cancels. The blocking dialog runs off the main thread, which the
/// plugin requires.
#[tauri::command]
pub async fn pick_artifact_files(app: tauri::AppHandle) -> Result<Vec<std::path::PathBuf>, Error> {
let paths = tauri::async_runtime::spawn_blocking(move || {
app.dialog()
.file()
.blocking_pick_files()
.unwrap_or_default()
})
.await?;
Ok(paths
.into_iter()
.filter_map(|path| path.into_path().ok())
.collect())
}
/// Pick a single directory to attach as a collection artifact.
#[tauri::command]
pub async fn pick_artifact_directory(
app: tauri::AppHandle,
) -> Result<Option<std::path::PathBuf>, Error> {
let path =
tauri::async_runtime::spawn_blocking(move || app.dialog().file().blocking_pick_folder())
.await?;
Ok(path.and_then(|path| path.into_path().ok()))
}
/// Whether the local artifact node is running. A node that is down is not an
/// error here: the UI shows setup guidance instead of stats.
#[tauri::command]
pub async fn artifact_node_running(ctx: tauri::State<'_, AppState>) -> Result<bool, Error> {
blocking(ctx, |ctx| Ok(ctx.artifact_node_running())).await
}
/// Which artifact binaries are installed, so a node that is down can be told
/// apart from one that was never installed. Off the main thread, since the
/// CLI's version comes from running it.
#[tauri::command]
pub async fn artifact_binaries() -> Result<radicle_types::binaries::ArtifactBinaries, Error> {
Ok(tauri::async_runtime::spawn_blocking(radicle_types::binaries::artifact_binaries).await?)
}
#[tauri::command]
pub async fn artifact_node_status(
ctx: tauri::State<'_, AppState>,
) -> Result<types::artifact::ArtifactNodeStatus, Error> {
blocking(ctx, |ctx| ctx.artifact_node_status()).await
}
/// Content ids the node seeds under this release. The release view asks once
/// and matches its rows against the result.
#[tauri::command]
pub async fn seeded_artifacts(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
) -> Result<Vec<String>, Error> {
blocking(ctx, move |ctx| ctx.seeded_artifacts(rid, release_id)).await
}
#[tauri::command]
pub async fn seed_artifact(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
source_path: std::path::PathBuf,
) -> Result<String, Error> {
blocking(ctx, move |ctx| {
ctx.seed_artifact(rid, release_id, cid, source_path)
})
.await
}
#[tauri::command]
pub async fn unseed_artifact(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| ctx.unseed_artifact(rid, release_id, cid)).await
}
/// Download an artifact, forwarding the node's progress frames to the
/// frontend as `artifact_progress` events keyed by content id.
///
/// With `save_as`, the user picks where to save it in the OS save dialog,
/// seeded with that name, and the path never reaches the webview. Without it,
/// the artifact is only fetched into the node's store. Returns `false` when
/// the user cancels the dialog.
#[tauri::command]
pub async fn download_artifact(
app: tauri::AppHandle,
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
cid: String,
save_as: Option<String>,
seed: bool,
) -> Result<bool, Error> {
let dest = match save_as {
Some(name) => {
let dialog = app.clone();
let Some(dest) = tauri::async_runtime::spawn_blocking(move || {
dialog
.dialog()
.file()
.set_file_name(name)
.blocking_save_file()
})
.await?
else {
return Ok(false);
};
Some(dest.into_path()?)
}
None => None,
};
blocking(ctx, move |ctx| {
ctx.download_artifact(
rid,
release_id,
cid.clone(),
dest.as_deref(),
seed,
|progress| {
let _ = app.emit(
"artifact_progress",
types::artifact::ArtifactProgress::new(&cid, progress),
);
},
)
})
.await?;
Ok(true)
}
#[tauri::command]
pub async fn delete_release(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
release_id: String,
) -> Result<(), Error> {
blocking(ctx, move |ctx| {
ctx.delete_and_unseed_release(rid, release_id)
})
.await
}
@@ -0,0 +1,50 @@
use radicle::git;
use radicle::identity;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::repo::Repo;
use tauri_plugin_dialog::DialogExt;
use crate::AppState;
#[tauri::command]
pub async fn get_diff(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
options: radicle_types::cobs::diff::DiffOptions,
) -> Result<types::diff::Diff, Error> {
ctx.get_diff(rid, options)
}
#[tauri::command]
pub async fn get_diff_text(
ctx: tauri::State<'_, AppState>,
rid: identity::RepoId,
base: Option<git::Oid>,
head: git::Oid,
unified: Option<u32>,
path: Option<String>,
) -> Result<String, Error> {
ctx.get_diff_text(rid, base, head, unified, path)
}
#[tauri::command]
pub async fn save_diff_to_disk(
app_handle: tauri::AppHandle,
name: String,
content: String,
) -> Result<(), Error> {
let Some(path) = app_handle
.dialog()
.file()
.set_file_name(name)
.blocking_save_file()
else {
// User cancelled the save dialog.
return Ok(());
};
let path = path.into_path()?;
std::fs::write(path, content)?;
Ok(())
}
@@ -0,0 +1,15 @@
use radicle::identity::RepoId;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::identity::Identity;
use crate::AppState;
use crate::commands::blocking;
#[tauri::command]
pub async fn identity_by_repo(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
) -> Result<types::identity::Identity, Error> {
blocking(ctx, move |ctx| ctx.identity_by_repo(rid)).await
}
@@ -0,0 +1,31 @@
use radicle_types::AppState;
use radicle_types::domain::inbox::models::notification;
use radicle_types::domain::inbox::service::Service;
use radicle_types::error::Error;
use radicle_types::outbound::sqlite::Sqlite;
use radicle_types::traits::inbox::Inbox;
#[tauri::command]
pub fn list_notifications(
ctx: tauri::State<AppState>,
sqlite_service: tauri::State<Service<Sqlite>>,
params: notification::RepoGroupParams,
) -> Result<notification::NotificationsByRepoList, Error> {
ctx.list_notifications(&sqlite_service, params)
}
#[tauri::command]
pub fn notification_count(
ctx: tauri::State<AppState>,
inbox: tauri::State<Service<Sqlite>>,
) -> Result<usize, Error> {
ctx.notification_count(&inbox)
}
#[tauri::command]
pub fn clear_notifications(
ctx: tauri::State<AppState>,
params: notification::SetStatusNotifications,
) -> Result<(), Error> {
ctx.clear_notifications(params)
}
@@ -0,0 +1,26 @@
use radicle::node::NodeId;
use radicle_types::cobs::AliasSuggestion;
use radicle_types::config::Config;
use radicle_types::error::Error;
use radicle_types::traits::Profile;
use crate::AppState;
use crate::commands::blocking;
#[tauri::command]
pub fn config(ctx: tauri::State<AppState>) -> Config {
ctx.config()
}
#[tauri::command]
pub fn alias(ctx: tauri::State<AppState>, nid: NodeId) -> Option<radicle::node::Alias> {
ctx.alias(nid)
}
#[tauri::command]
pub async fn search_aliases(
ctx: tauri::State<'_, AppState>,
query: Option<String>,
) -> Result<Vec<AliasSuggestion>, Error> {
blocking(ctx, move |ctx| Ok(ctx.search_aliases(query))).await
}
@@ -0,0 +1,208 @@
use std::collections::BTreeMap;
use radicle::git;
use radicle::identity::RepoId;
use radicle::node::NodeId;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::repo::{Repo, Show};
use crate::AppState;
use crate::commands::blocking;
#[tauri::command]
pub async fn list_repos(
ctx: tauri::State<'_, AppState>,
show: Show,
) -> Result<Vec<types::repo::RepoInfo>, Error> {
blocking(ctx, move |ctx| ctx.list_repos(show)).await
}
#[tauri::command]
pub async fn list_repos_summary(
ctx: tauri::State<'_, AppState>,
show: Show,
) -> Result<Vec<types::repo::RepoSummary>, Error> {
blocking(ctx, move |ctx| ctx.list_repos_summary(show)).await
}
#[tauri::command]
pub async fn repo_count(ctx: tauri::State<'_, AppState>) -> Result<types::repo::RepoCount, Error> {
blocking(ctx, |ctx| ctx.repo_count()).await
}
#[tauri::command]
pub async fn list_repo_refs(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
) -> Result<types::repo::RepoRefs, Error> {
blocking(ctx, move |ctx| ctx.list_repo_refs(rid)).await
}
#[tauri::command]
pub async fn list_canonical_tags(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
) -> Result<BTreeMap<String, types::repo::Tag>, Error> {
blocking(ctx, move |ctx| ctx.list_canonical_tags(rid)).await
}
#[tauri::command]
pub async fn repo_by_id(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
) -> Result<types::repo::RepoInfo, Error> {
blocking(ctx, move |ctx| ctx.repo_by_id(rid)).await
}
#[tauri::command]
pub async fn repo_readme(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
sha: Option<git::Oid>,
peer: Option<NodeId>,
revision: Option<String>,
) -> Result<Option<types::repo::Readme>, Error> {
blocking(ctx, move |ctx| ctx.repo_readme(rid, sha, peer, revision)).await
}
#[tauri::command]
pub async fn repo_tree(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
path: std::path::PathBuf,
sha: Option<git::Oid>,
peer: Option<NodeId>,
revision: Option<String>,
) -> Result<types::source::tree::Tree, Error> {
blocking(ctx, move |ctx| {
ctx.repo_tree(rid, path, sha, peer, revision)
})
.await
}
#[tauri::command]
pub async fn repo_blob(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
path: std::path::PathBuf,
sha: Option<git::Oid>,
) -> Result<types::source::blob::Blob, Error> {
blocking(ctx, move |ctx| ctx.repo_blob(rid, path, sha)).await
}
#[tauri::command]
pub async fn repo_blob_bytes(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
path: std::path::PathBuf,
sha: git::Oid,
) -> Result<tauri::ipc::Response, Error> {
let bytes = blocking(ctx, move |ctx| ctx.repo_blob_bytes(rid, path, sha)).await?;
Ok(tauri::ipc::Response::new(bytes))
}
#[tauri::command]
pub async fn diff_stats(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
base: git::Oid,
head: git::Oid,
) -> Result<types::diff::Stats, Error> {
blocking(ctx, move |ctx| ctx.diff_stats(rid, base, head)).await
}
#[tauri::command]
pub async fn list_commits(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
base: String,
head: String,
) -> Result<Vec<types::repo::Commit>, Error> {
blocking(ctx, move |ctx| ctx.list_commits(rid, base, head)).await
}
#[tauri::command]
pub async fn get_commit_diff(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
sha: git::Oid,
) -> Result<types::diff::Diff, Error> {
blocking(ctx, move |ctx| ctx.get_commit_diff(rid, sha)).await
}
#[tauri::command]
pub async fn list_repo_commits(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
head: Option<git::Oid>,
peer: Option<NodeId>,
revision: Option<String>,
skip: Option<usize>,
take: Option<usize>,
) -> Result<types::cobs::PaginatedQuery<Vec<types::repo::Commit>>, Error> {
blocking(ctx, move |ctx| {
ctx.list_repo_commits(rid, head, peer, revision, skip, take)
})
.await
}
#[tauri::command]
pub async fn repo_commit_count(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
head: git::Oid,
) -> Result<usize, Error> {
blocking(ctx, move |ctx| ctx.repo_commit_count(rid, head)).await
}
#[tauri::command]
pub async fn repo_commit(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
sha: Option<git::Oid>,
peer: Option<NodeId>,
revision: Option<String>,
) -> Result<types::repo::Commit, Error> {
blocking(ctx, move |ctx| ctx.repo_commit(rid, sha, peer, revision)).await
}
#[tauri::command]
pub async fn repo_commits_by_prefix(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
prefix: String,
) -> Result<Vec<types::repo::Commit>, Error> {
blocking(ctx, move |ctx| ctx.repo_commits_by_prefix(rid, prefix)).await
}
#[tauri::command]
pub async fn repo_split_tree_path(
ctx: tauri::State<'_, AppState>,
rid: RepoId,
peer: Option<NodeId>,
path: String,
) -> Result<types::repo::TreePath, Error> {
blocking(ctx, move |ctx| ctx.repo_split_tree_path(rid, peer, path)).await
}
#[tauri::command]
pub fn seed(ctx: tauri::State<'_, AppState>, rid: RepoId) -> Result<(), Error> {
ctx.seed(rid)
}
#[tauri::command]
pub fn unseed(ctx: tauri::State<'_, AppState>, rid: RepoId) -> Result<(), Error> {
ctx.unseed(rid)
}
#[tauri::command]
pub fn clean(ctx: tauri::State<'_, AppState>, rid: RepoId) -> Result<(), Error> {
ctx.clean(rid)
}
#[tauri::command]
pub async fn seeded_not_replicated(ctx: tauri::State<'_, AppState>) -> Result<Vec<RepoId>, Error> {
ctx.seeded_not_replicated()
}
@@ -0,0 +1,71 @@
use tauri::{AppHandle, Emitter, Manager};
use radicle::cob::cache::COBS_DB_FILE;
use radicle::node::{Handle, NOTIFICATIONS_DB_FILE, Node};
use radicle_types::binaries::GitInfo;
use radicle_types::config::{Config, Version};
use radicle_types::error::Error;
use radicle_types::traits::Profile;
use radicle_types::traits::artifact_node::ArtifactNode;
use radicle_types::{AppState, domain};
#[tauri::command]
pub(crate) fn version(app: AppHandle) -> Result<Version, Error> {
Ok(Version {
version: app.config().version.clone().unwrap_or("unknown".into()),
head: env!("GIT_HEAD").to_string(),
})
}
#[tauri::command]
pub(crate) fn check_radicle_cli(ctx: tauri::State<AppState>) -> Result<(), Error> {
radicle_types::binaries::check_radicle_cli(&ctx.profile())
}
#[tauri::command]
pub(crate) fn git_info() -> GitInfo {
radicle_types::binaries::git_info()
}
#[tauri::command]
pub(crate) fn startup(app: AppHandle) -> Result<Config, Error> {
let profile = radicle::Profile::load()?;
let state = AppState { profile };
state.check_cobs_cache()?;
let profile = &state.profile;
let inbox_db = radicle_types::outbound::sqlite::Sqlite::reader(
profile.node().join(NOTIFICATIONS_DB_FILE),
)?;
let cobs_db =
radicle_types::outbound::sqlite::Sqlite::reader(profile.cobs().join(COBS_DB_FILE))?;
let inbox_service = domain::inbox::service::Service::new(inbox_db);
let patch_service = domain::patch::service::Service::new(cobs_db.clone());
let issue_service = domain::issue::service::Service::new(cobs_db);
let node_handle = app.app_handle().clone();
let node = Node::new(profile.home().socket_from_env());
app.manage(inbox_service);
app.manage(patch_service);
app.manage(issue_service);
// Both probes are blocking socket calls, so they get their own thread. The
// radicle node's event goes out first, so a slow artifact node can't
// delay it.
let probe_state = state.clone();
std::thread::spawn(move || {
loop {
let _ = node_handle.emit("node_running", node.is_running());
let _ = node_handle.emit("artifact_node_running", probe_state.artifact_node_running());
std::thread::sleep(std::time::Duration::from_secs(2));
}
});
app.manage(state.clone());
Ok(state.config())
}
@@ -0,0 +1,27 @@
use radicle::identity;
use radicle_types as types;
use radicle_types::error::Error;
use radicle_types::traits::thread::Thread;
use crate::AppState;
#[tauri::command]
pub fn create_issue_comment(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
new: types::cobs::thread::NewIssueComment,
opts: types::cobs::CobOptions,
) -> Result<types::cobs::thread::Comment<types::cobs::Never>, Error> {
ctx.create_issue_comment(rid, new, opts)
}
#[tauri::command]
pub fn create_patch_comment(
ctx: tauri::State<AppState>,
rid: identity::RepoId,
new: types::cobs::thread::NewPatchComment,
opts: types::cobs::CobOptions,
) -> Result<types::cobs::thread::Comment<types::cobs::thread::CodeLocation>, Error> {
ctx.create_patch_comment(rid, new, opts)
}

Some files were not shown because too many files have changed in this diff Show More