This prevents polyfills being installed that break node-only
libraries. Also silences warnings when a vite server is not running
while running the tests.
We consolidate the code that fetches the data for `ProjectCard` in one
module, adjacent to the `ProjectCard` component. We also consolidate all
the data into one interface to simplify the component API.
With the data loading in one place we can eliminate duplicate code and a
handful of helper functions.
The consolidation also allows us to discover some optimizations to
fetching: We parallelize requests and we use the commit detail endpoint
instead of the commit list endpoint. For the latter to pay off, we need
to deploy caching to the API.
We make source code browsing faster by re-using project-level data when
navigating between files. This comes at a cost: Project info (like the
issue counter), remotes and branches are only updated when the page is
hard-refreshed or the user navigates away from the source code view.
We change the instructions to connect to a local node to use the
simplified authentication flow.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We stop using the disabled `Popover` component. Instead of using the
disabled component it is simpler to just not use the component at all.
This also avoids issues where the toggle button of the `Popover` was
nested inside the button in `src/App/Header/Authenticate.svelte` which
in turn created problems with `.getByRole` selectors in tests.
Because of this change we can also drop the use of `NodeId` in places
where it simply displays the node ID and avatar.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
When setting up the global fixtures we need to ensure that the peers
that create changes sync their changes to the seed (palm). The only
thing necessary is for the peer to discover palm as the seed for the
project. Then `git push rad --all` will sync all changes to palm.
It’s not necessary to listen for any other event and we remove the
corresponding calls to `waitForEvent` or `waitForRoutes`.
In fact, these calls never did anything besides sleep since the
implementation of `waitForEvent` was faulty. We fix that, too.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We stop asking for confirmation to remove the folders containing the
static generated fixtures. All the data is programatically generated so
it’s not a big deal if it is lost. In any case the data is retained
after a test run and only deleted before the next test run.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
When a Playwright action (like click) fails we want it to throw an error
after 5 seconds instead of waiting 30 seconds for the test timeout.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
* The log prefix now includes the command name in addition to the peer
name. This allows us to distinguish `radicle-node` and `radicle-httpd`
logs as well as the output of commands.
* We also log prettify the JSON event log so it is easier to debug.
* Don’t log ouput of `waitForRoutes`
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
The update resulted in changes to all issue and patch IDs. We adapt the
tests so that they do not rely on fixed IDs.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We elminitate the element with the “button” role that wrapped the
Popover toggle slot. The element rendered into the slot is in all cases
already a button. This prevents issues where `getByRole("button")` finds
_two_ buttons for popover toggles.
We take the opportunity to simplify the popover toggling by making the
slot responsible for the toggle. This has a couple of advantages:
* We don’t need a `disabled` property for Popover. This is handled by
the button. (This fixes a bug we did not disable the PeerSelector
Popover properly.)
* The popover is opened on key events
In the future this also gives us more flexibility in determining how to
toggle the Popover.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
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>
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>
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>
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>
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>
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>
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>
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>
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>
We simplify some of the choices for `ProjectLoadedView` by reducing the
nesting and removing redundant properties.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We move the `peer` and `revision` properties from the shared
`ProjectLoadedParams` interface to the `tree` and `history` subroutes
where they are needed.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We remove the requirement that `LoadedSourceBrowsingView` needs to be
assignable to `ProjectParams["view"]`. This decouples `ProjectRoute` and
`ProjectLoadedRoute` and lets us modify them independently.
I did not use a common `routeParamsView` function because I prefer the
flexibility of being able to modify them independently while this area
of code changes a lot.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We refactor the code that builds a URL from a project route so that it
is clearer that only the `tree` and `history` resource have some
complicated logic. We also eliminate the use of the shared `suffix`
variable. We now build the URL left-to-right.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
* We remove all styling related lints and use `eslint-config-prettier`.
There’s no need to bother developers with styling lints because
Prettier already takes care of that. (This is the [recommended
integration with Prettier][1])
* We use the “warning” level for lints that are code style related. This
allows developers to distinguish issues that need to be fixed now
(like type errors) and issues that can be fixed later (like style
errors). We do enforce all lints on CI by settings
`--max-warnings=0`.
[1]: https://prettier.io/docs/en/integrating-with-linters.html
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We stop handling the URL hash through the routing system. Hashes are
local to the current view and can be handled by the shown components.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
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>
The end-to-end tests no run against the app served on port 3001 so that
we don’t need to shut down the development server.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
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>
* Don’t load branches in `commits` view. We the branch selector is not
enabled there.
* Don’t silently swallow errors when fetching branches. Let the route
loading mechanism handle errors.
* Don’t use the default branch as the fallback for `branches`. They are
allowed to be empty and the empty case is handled properly now.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We remove logic used in the `BranchSelector` component. Instead we
restructure the component properties and rely on the `Browser`,
`History` and `Commit` components to pass values that result in the same
behavior.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We restricted the allowed parameters that are used for project-relative
navigation. This allows us to better understand which of the parameters
are used.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
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>
It’s not necessary anymore to add the folder with the heartwood test
binaries to `PATH` before running the end-to-end tests.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>