Commit Graph
1293 Commits
Author SHA1 Message Date
Rūdolfs Ošiņš 449ed1d79b Simplify project header props
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 17:40:43 +02:00
Rūdolfs Ošiņš fc87a8822a Get rid of ProjectMeta component by moving it into Layout
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 17:40:43 +02:00
Rūdolfs Ošiņš 3bb56e6613 Organize project components
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 17:40:43 +02:00
Rūdolfs Ošiņš 5cd098187c Rename "project.tree" to "project.source"
This aligns better with the component and tab naming.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 15:35:27 +02:00
Rūdolfs Ošiņš 3cc485dce2 Flatten ProjectLoadedRoute type
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 15:24:26 +02:00
Rūdolfs Ošiņš d39fee871d Move project view into App.svelte
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 14:50:58 +02:00
Rūdolfs Ošiņš 723509a267 Extract top-level menu into a layout
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 14:40:45 +02:00
Rūdolfs Ošiņš 0146ca00b5 Update the UI to work with the new COB schema
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-08 10:53:49 +02:00
Rūdolfs Ošiņš 0d024759d3 Upgrade to the latest heartwood version
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-08-01 16:41:22 +02:00
Thomas Scholtes cbe1fa5c9a Simplify and align project view props
We simplify the properties of the project views `Issue`, `Issues`,
`NewIssue`, and `Patch`. This aligns them with other project views and
makes the view selection consistent.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-31 17:53:30 +02:00
Thomas Scholtes 8acb2410d5 Remove redundant project route parameters
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-31 17:33:43 +02:00
Sebastian Martinez 4525771264 Use /nodes/ in URL instead of /seeds/
We still allow already published URLs with `/seeds/` in them to be
resolved.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-31 16:58:45 +02:00
Sebastian Martinez 8d798cc93f Adding a new defaultLocalHttpdPort property to the config.json
We use `defaultHttpdPort` for both exposed ports like on
seed.radicle.xyz as also for local ports e.g. radicle.local.
This worked fine, for now but has shown the first issues, when external
ports like 443 show up in the radicle.local connection dashboard.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 15:38:36 +02:00
Sebastian Martinez 910c103a9b Change rad web command when httpd port changes
Instead of using always the `config.seeds.defaultHttpdPort` which is
443, we should take into account the `customPort` variable that is set by the
user.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 15:38:36 +02:00
Sebastian Martinez adc0660e87 Make seed hostname reactive in seed project listing
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 14:05:53 +02:00
Sebastian Martinez f4bf5b9c6a Sort projects in seed view by most recent activity
Uses the projects activity, fetched from `/projects/${id}/activity`
which is an array of commit timestamps.
So could suffer from some errors if commits with non current timestamps
are being used.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 13:05:56 +02:00
Sebastian Martinez 99ec07e0a3 Add e2e tests for patch and issue counters
When creating a new patch or issue, we want the counters to reflect on
that on navigation.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 10:16:41 +02:00
Sebastian Martinez 1f5751dbcb Remove some values that are now defaults
- prettier assumes now that we want to ignore files listed in .gitignore
  by default
- trailingComma: all is now the default value

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-31 09:28:49 +02:00
Rūdolfs OšiņšandThomas Scholtes 391f188b69 Fix navigating to history when a file is selected
Co-authored-by: Thomas Scholtes <geigerzaehler@axiom.fm>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-26 14:17:18 +02:00
Rūdolfs Ošiņš b5980a12ac Update dependencies
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-26 10:36:50 +02:00
Rūdolfs Ošiņš 653bacd8d0 Replace deprecated substr with substring
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-25 17:20:38 +02:00
Rūdolfs Ošiņš 69d2f9bff9 Make issues/patches tab counters reactive
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-25 15:47:06 +02:00
Thomas Scholtes 8f4b788a65 Simplify SourceBrowsingHeader props
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-25 11:56:33 +02:00
Thomas Scholtes afbdf2f041 Introduce TreeView and HistoryView
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-25 11:56:33 +02:00
Rūdolfs Ošiņš 251d97cdde Load issue list in project router
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-25 11:33:52 +02:00
Rūdolfs Ošiņš fbe133cd95 Load patch list in project router
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-25 11:32:28 +02:00
Thomas Scholtes 1b6bed73a6 Lift branch/peer selector data into main views
We prepare the data for `PeerSelector` and `BranchSelector` in the
`History` and `Browser` instead of `SourceBrowsingHeader`. This makes
the component APIs overall simpler and allows us to remove
`LoadedSourceBrowsingView`.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-24 14:25:53 +02:00
Thomas Scholtes 9c1392598a Simplify BranchSelector
There’s no need for the outer `if branches.length > 0`. We already
disable the dropdown unless `branches.length > 1`.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-24 14:10:26 +02:00
Thomas Scholtes 29e3295f45 Represent issue status filter in route
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-24 12:15:35 +02:00
Thomas Scholtes dd7f3a850e Simplify project route loading
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-24 12:15:35 +02:00
Sebastian Martinez f631c7f171 Fix absolute links with files in markdown
We had a regression because of introducing marked-linkify-it, which took
links for CONTRIBUTING.md or HACKING.md as domains of a new page instead
than files to be navigating to.

This commit sets the `fuzzyLink` option for marked-linkify-it to false,
which disables this behavior

Also tests that the browser tree expands itself when navigating to a
file inside a directory

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-22 08:02:00 +02:00
Sebastian Martinez 50d046ce86 Fix URL not updating when using navigateInternalOnAnchor
We were always calling `replace` and not passing the desired action in
the `navigateInternalOnAnchor`, this was leading to the URL not updating
when e.g. clicking on file URLs in Markdown renders.

By passing the action to the `navigate` fn instead we can also take the
`push` action into account.

Test have been written to guarantee this works

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-21 22:36:53 +02:00
Thomas Scholtes b76db5dfa3 Remove source browsing header from commit view
For a single commit view the source browsing header (peer selector,
branch selector, commits, contributor count) does not contain meaningful
information. We remove the header and simply show the commit.

See #938.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-20 17:14:12 +02:00
Thomas Scholtes c44cd5771b Fix movement of diff text when lines are selected
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-20 15:56:05 +02:00
xphoniex 5ee8c8281b Make diff line selectable and shareable
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-20 11:37:57 +02:00
Sebastian Martinez 910f151c7f Update dependencies
Gets prettier to v3, which starts to write doctype in lowercase, see
https://prettier.io/blog/2023/07/05/3.0.0.html#print-html5-doctype-in-lowercase-7391httpsgithubcomprettierprettierpull7391-by-fiskerhttpsgithubcomfisker

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-19 16:32:37 +02:00
Thomas Scholtes aae50a2fda Use structured routing for patch views
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-19 15:14:53 +02:00
Thomas Scholtes fdd074fd13 Simplify BranchSelector and PeerSelector props
We greatly reduce the numbers of properties that need to be passed to
`BranchSelector` and `PeerSelector` by constructing routes in
`SourceBrowsingHeader`. We’ll lift the logic out of
`SourceBrowsingHeader` in a follow-up.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-19 15:00:39 +02:00
Sebastian Martinez afbc57079b Switch page.locator with page.getByRole and page.getByText
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-19 11:35:20 +02:00
Sebastian Martinez 6151729a6d Add empty file test case
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-19 11:35:20 +02:00
Sebastian Martinez e4a051b17a Add auto linking in Markdown components
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-19 09:07:01 +02:00
Sebastian Martinez 78b988af95 Replace custom extension with marked-katex-extension
- Add a visual test to check math rendering

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-17 17:18:07 +02:00
Thomas Scholtes fabd98fb57 Extract tree and history route loading
The `loadProjectRoute` function has become too big too understand. To
address this, we extract and separate the loading for the `tree` and
`history` views. This also gives us the opportunity to simplify some of
the code and parallelize more HTTP requests.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-17 15:48:37 +02:00
Sebastian Martinez 14ba807e55 Set the httpd port for the test suite to be 8081.
Also where possible use the `config.seeds.defaultHttpdPort` instead of
hardcoding it.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-17 15:19:31 +02:00
Sebastian Martinez 69946f5d8c Replace marked namespaces with Marked instance
Based on a new addition to marked, this commits replaces the imported
marked namespaces with a Marked class, that doesn't change when
`marked.use` introduces new options or extensions.

Also changes the naming slighty to use `markdown` as module, so it
sounds more generic.

Reference: https://github.com/markedjs/marked/pull/2831

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-17 14:47:53 +02:00
Thomas Scholtes 50088a5c8a Make pathToRoute tests more readable
We switch the test for `pathToRoute` from a paramterized test to regular
tests. I had a lot of trouble finding the right properties to change
when a test in this group failed. The line number was not helpful at all
and the test description was burried inside an object.

We also rename `pathToRoute` to `urlToRoute` because the function takes
a `URL` as an argument.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-17 11:44:27 +02:00
Thomas Scholtes 283b665b31 Switch to flat project route type
We switch to a project route type that is just a union. This has the
following advantages

* It’s much easier to construct project routes. Fewer properties are
  needed and there are no nested objects.
* We eliminate the implicitly shared properties `path`, `peer`,
  `revision` and `route` which only belonged to the tree route.
* The structure of the project route is more regular and thus easier to
  understand.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-17 11:27:57 +02:00
Thomas Scholtes 684700a24d Don’t flood Playwright traces with route.continue()
We determine URLs to mock with a URL matcher instead of mocking every
URL and determining the behavior in the route handler. This should be
slightly faster and should result in better debugging experience because
we don’t come across the `route.continue()` event that often.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-14 09:29:19 +02:00
Thomas Scholtes f80b193bbd Don’t intercept navigation to external URLs in Markdown
Fixes 928

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-14 09:29:19 +02:00
Rūdolfs Ošiņš b797c6a3f7 Reverse revision commit ordering
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-14 09:26:34 +02:00