Commit Graph
83 Commits
Author SHA1 Message Date
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
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
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
Rūdolfs Ošiņš cdd0b9c7b6 Set page title in the router
This improves UX making it easier to find the tab that I'm looking for
when I have multiple tabs open.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-14 08:38:15 +02:00
Thomas Scholtes d0a280be02 Simplify project route resolving
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-12 15:24:06 +02:00
Rūdolfs Ošiņš 74fa05cf26 Rewrite markdown link navigation
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-07-09 15:17:43 +02:00
Thomas Scholtes f3e5b47124 Don’t replace path on internal navigation
We don’t replace the path when we navigate internally. This means we
keep the hash part of the URL even if it is not part of the route and we
can remove the workaround for that.

This also means that we keep the original URL if the parsed route would
result in a different URL. This change is visible through a slight
adjustments in the tests.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-09 14:46:26 +02:00
Thomas Scholtes 2386b7c154 Move project route to path code into project router module
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-09 13:34:11 +02:00
Thomas Scholtes e0e659f54a Only log errors when something unexpected happens in local node connection
We remove a couple of calls to `console.error()` in the code for the
local node connection. It’s not necessary to log errors that are
expected, for example, if the node is down.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-06 10:14:34 +02:00
Thomas Scholtes 5d535ff604 Use dedicated commitId parameter for commits route
We use the new parameter instead of the shared revision parameter.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-03 15:03:53 +02:00
Thomas Scholtes b11e4840f9 Eliminate top-level search parameter from project route
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-03 13:42:26 +02:00
Thomas Scholtes c6afc56beb Test that route building and parsing leave routes invariant
We replace the tests for `routeToPath` with a test that calls
`pathToRoute(routeToPath(route))`. These test do not only cover the
assertions of the previous tests but also check an important invariant
for route parsing and building.

I’m not using `test.each` here because this makes the tests less
readable.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-07-03 13:24:00 +02:00
Sebastian Martinez c04d399cf3 Revert HTML tag escaping
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-30 10:01:14 +02:00
Thomas Scholtes 8ef8ce5b81 Run source highlighting in router to prevent showing intermediate state
Fixes #709

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-06-30 09:52:08 +02:00
Rūdolfs Ošiņš 3f7a58c489 Handle app URL translation into seed BaseUrl in one place
To make the code easier to reason about we handle all app URL encoding
and decoding and the related seed BaseUrl extraction in a single place.

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-06-28 10:51:59 +02:00
Rūdolfs Ošiņš bc25367ecb Add remote count to PeerSelector
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-06-28 09:31:08 +02:00
Sebastian Martinez ba57506d6d Update svelte to version 4
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-26 14:13:22 +02:00
Sebastian Martinez ecabe9b7a8 Escape html tags in marked found outside of code blocks
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-26 13:00:20 +02:00
Sebastian Martinez 4df9810088 Rename hostnamePort to hostAndPort
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-14 16:19:05 +02:00
Sebastian Martinez 52cece4680 Handle custom httpd port
We only supported fetching the default httpd port (8080).
This commit removes navigation to `radicle.local` which represents
`0.0.0.0:8080`, and prepares the app for defining custom port.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-14 16:17:21 +02:00
Rūdolfs OšiņšandThomas Scholtes a331721c9f Move project source browsing loading into the router
Co-authored-by: Thomas Scholtes <geigerzaehler@axiom.fm>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-06-13 14:24:27 +02:00
Sebastian MartinezandRūdolfs Ošiņš c230731ce0 Redesign Connect button to reflect httpd status
Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-06-01 14:49:22 +02:00
Sebastian Martinez 99f27350c1 Fix out-of-state commit listing when refreshing page after push
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-01 10:09:12 +02:00
Rūdolfs Ošiņš dd3b514dfc Properly await promises
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-05-29 15:54:00 +02:00
Sebastian Martinez 380366be2e Fix padding and linebreaks in markdown
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-17 12:55:43 +02:00
Sebastian Martinez 02aa591c84 Lowercase all markdown inline link and heading ids
By having different casings between heading and link ids we avoid
getting case mismatches on navigation.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-17 11:00:04 +02:00
Thomas Scholtes 5c7806ecff Fix anchor links
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2023-05-11 10:51:35 +02:00
Rūdolfs Ošiņš b997b12353 Implement data loading in router
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-05-11 10:51:35 +02:00
Rūdolfs Ošiņš 85dc1c3552 Port mutexExecutor from Upstream
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-05-11 10:50:26 +02:00
Sebastian Martinez b87a6735b5 Add hr before first footnote in footer
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-08 15:44:00 +02:00
Sebastian Martinez 03c05edeca Updates marked to v5.0
Disables some of the deprecated options to avoid the console warnings.
Removes obfuscation of plain-text emails.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-05-08 10:35:24 +02:00
Rūdolfs Ošiņš 1f09d8a2a8 Allow opening links in a new tab
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-27 15:54:53 +02:00
Rūdolfs Ošiņš 26419a74e2 Simplify the ProjectCard component
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-20 14:41:19 +02:00
Rūdolfs Ošiņš d80c46e085 Rename the search bar placeholder
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-20 08:36:16 +02:00
Sebastian Martinez 534430b2ec Fix relative markdown file links
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-14 17:05:42 +02:00
Sebastian Martinez e5ec6e33fb Improve general UX
- Hide issue title edit button when not logged in
- Show Blob placeholder when empty file
- Allow selecting blob code without the lines
- Add Clipboard component to object id in CobHeader
- Add blockies to Patch and Issueteasers
- Reduce formatted object ids to 7 instead of 11 chars
- Remove line breaking on soft wraps from Markdown
- Reduce font size of code blocks in Markdown
- Improve margins in IssueTeaser
- Reduce font size in FileDiffs
- Improve teasers, assignees and tags highlighting
- Reduce font size of code
- Change commit teaser subtitle
- Show Clipboard in commit sha1
- Add blockies to PeerSelector
- Adjust commit view CSS

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-14 16:15:51 +02:00
Rūdolfs Ošiņš 7682d9e215 Refactor issue/patch side inputs
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-13 10:06:29 +02:00
Rūdolfs Ošiņš 6efe60984b Update logo and favicon
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-12 08:22:28 +02:00
Rūdolfs Ošiņš c8c251fabd Add httpd-client api library
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-11 15:31:08 +02:00
Rūdolfs Ošiņš 9e1fc49ae7 Fix mixed content warning when connecting to local node
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-04-05 13:49:52 +02:00
Sebastian Martinez 016b5e9d0a Patch states fallback to disable and show default if undefined
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-03 15:35:56 +02:00
Sebastian Martinez 5fbbd824ff Add merged patch state
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-03 14:59:37 +02:00
Sebastian Martinez a6bc6d3c27 Fix small markdown spacing issue
Adds a listitem renderer overwrite to marked which
wraps everything that is inside a <li> which isn't only single <p> tag
into a <div class="list-content"> which we give a margin: 1rem 0;

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-03 14:30:58 +02:00
Sebastian Martinez a168a4d126 Pluralize values instead of parenthesis
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-03 14:10:47 +02:00
Sebastian Martinez 4c3bd7ee04 Fix statically replaced HASH_ROUTING env variables
Also moves the HASH_ROUTING env variable from being modified inside the
hashRouter.spec.ts into the webserver config in the
playwright.config.ipfs.ts

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-04-03 11:50:24 +02:00