rename ui to clan-app and move clan-app one layer up
8
.gitignore
vendored
@@ -46,3 +46,11 @@ dist
|
||||
|
||||
# TODO: remove after bug in select is fixed
|
||||
select
|
||||
|
||||
# Generated files
|
||||
pkgs/ui/webview-ui/app/api/API.json
|
||||
pkgs/ui/webview-ui/app/api/API.ts
|
||||
pkgs/ui/webview-ui/app/api/Inventory.ts
|
||||
pkgs/ui/webview-ui/app/api/modules_schemas.json
|
||||
pkgs/ui/webview-ui/app/api/schema.json
|
||||
pkgs/ui/webview-ui/app/.fonts
|
||||
|
||||
@@ -45,7 +45,7 @@ pkgs.stdenv.mkDerivation {
|
||||
ln -snf ${fira-code}/share/fonts/truetype/FiraCode-VF.ttf ./site/static/
|
||||
|
||||
# Copy icons into place
|
||||
cp -af ../pkgs/ui/webview-ui/app/icons ./site/static/
|
||||
cp -af ../pkgs/clan-app/webview-ui/app/icons ./site/static/
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# shellcheck shell=bash
|
||||
source_up
|
||||
|
||||
watch_file flake-module.nix shell.nix clan-app/flake-module.nix webview-ui/flake-module.nix
|
||||
watch_file flake-module.nix shell.nix webview-ui/flake-module.nix
|
||||
|
||||
# Because we depend on nixpkgs sources, uploading to builders takes a long time
|
||||
use flake .#ui --builders ''
|
||||
@@ -1,17 +1,19 @@
|
||||
# Clan UI
|
||||
# Clan App
|
||||
|
||||
## Getting started
|
||||
A powerful application that allows users to create and manage their own Clans.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Enter the `pkgs/ui` directory and allow [direnv] to load the `ui` devshell with `direnv allow`:
|
||||
|
||||
```console
|
||||
❯ direnv allow
|
||||
direnv: loading ~/Development/lol/clan/git/clan/clan-core/pkgs/ui/.envrc
|
||||
direnv: loading ~/Development/lol/clan/git/clan/clan-core/pkgs/ui/.envrc
|
||||
direnv: loading ~/Development/lol/clan/git/clan/clan-core/.envrc
|
||||
direnv: using flake
|
||||
direnv: nix-direnv: Renewed cache
|
||||
switch to another dev-shell using: select-shell
|
||||
direnv: using flake .#ui --builders
|
||||
direnv: using flake .#ui --builders
|
||||
path '/home/brian/Development/lol/clan/git/clan/clan-core/pkgs/ui' does not contain a 'flake.nix', searching up
|
||||
direnv: ([/nix/store/rjnigckx9rmga58562hxw9kr5hynavcd-direnv-2.36.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
|
||||
path '/home/brian/Development/lol/clan/git/clan/clan-core/pkgs/ui' does not contain a 'flake.nix', searching up
|
||||
@@ -21,7 +23,7 @@ switch to another dev-shell using: select-shell
|
||||
direnv: export +AR +AS +CC +CLAN_CORE_PATH +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +GETTEXTDATADIRS +GETTEXTDATADIRS_FOR_BUILD +GETTEXTDATADIRS_FOR_TARGET +GIT_ROOT +GSETTINGS_SCHEMAS_PATH +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +PC_CONFIG_FILES +PKG_ROOT_CLAN_APP +PKG_ROOT_UI +PKG_ROOT_WEBVIEW_UI +PRJ_ROOT +PYTHONHASHSEED +PYTHONNOUSERSITE +PYTHONPATH +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +WEBVIEW_LIB_DIR +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~GDK_PIXBUF_MODULE_FILE ~GI_TYPELIB_PATH ~PATH ~XDG_DATA_DIRS
|
||||
```
|
||||
|
||||
Once that has loaded, you can run the local dev environment by running `process-compose`.
|
||||
Once that has loaded, you can run the local dev environment by running `process-compose`.
|
||||
|
||||
This will start a [process-compose] instance containing two processes:
|
||||
|
||||
@@ -29,20 +31,107 @@ This will start a [process-compose] instance containing two processes:
|
||||
* `clan-app` which is a [foreground process](https://f1bonacc1.github.io/process-compose/launcher/?h=foreground#foreground-processes),
|
||||
that is started on demand and provides the [webview] wrapper for the UI.
|
||||
|
||||
Wait for the `webview-ui` process to enter the `Running` state, then navigate to the `clan-app` process and press `F7`.
|
||||
Wait for the `webview-ui` process to enter the `Running` state, then navigate to the `clan-app` process and press `F7`.
|
||||
This will start the [webview] window and bring `clan-app`'s terminal into the foreground, allowing for interaction with
|
||||
the debugger if required.
|
||||
the debugger if required.
|
||||
|
||||
If you need to restart, simply enter `ctrl+c` and you will be dropped back into the `process-compose` terminal.
|
||||
If you need to restart, simply enter `ctrl+c` and you will be dropped back into the `process-compose` terminal.
|
||||
From there you can start `clan-app` again with `F7`.
|
||||
|
||||
> **Note**
|
||||
> If you are interacting with a breakpoint, do not continue/exit with `ctrl+c` as this will introduce a quirk
|
||||
> the next time you start `clan-app` where you will be unable to see the input you are typing in a debugging session.
|
||||
> the next time you start `clan-app` where you will be unable to see the input you are typing in a debugging session.
|
||||
>
|
||||
> Instead, exit the debugger with `q+Enter`.
|
||||
> Instead, exit the debugger with `q+Enter`.
|
||||
|
||||
Follow the instructions below to set up your development environment and start the application:
|
||||
|
||||
|
||||
## Start clan-app without process-compose
|
||||
|
||||
|
||||
1. **Navigate to the Webview UI Directory**
|
||||
|
||||
Go to the `clan-core/pkgs/clan-app/webview-ui/app` directory and start the web server by executing:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
vite
|
||||
```
|
||||
|
||||
2. **Start the Clan App**
|
||||
|
||||
In the `clan-core/pkgs/clan-app` directory, execute the following command:
|
||||
|
||||
```bash
|
||||
./bin/clan-app --debug --content-uri http://localhost:3000
|
||||
```
|
||||
|
||||
This will start the application in debug mode and link it to the web server running at `http://localhost:3000`.
|
||||
|
||||
### Debugging Style and Layout
|
||||
|
||||
```bash
|
||||
# Enable the GTK debugger
|
||||
gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
|
||||
|
||||
# Start the application with the debugger attached
|
||||
GTK_DEBUG=interactive ./bin/clan-app --debug
|
||||
```
|
||||
|
||||
Appending `--debug` flag enables debug logging printed into the console.
|
||||
|
||||
### Profiling
|
||||
|
||||
To activate profiling you can run
|
||||
|
||||
```bash
|
||||
CLAN_CLI_PERF=1 ./bin/clan-app
|
||||
```
|
||||
|
||||
### Library Components
|
||||
|
||||
> Note:
|
||||
>
|
||||
> we recognized bugs when starting some cli-commands through the integrated vs-code terminal.
|
||||
> If encountering issues make sure to run commands in a regular os-shell.
|
||||
|
||||
lib-Adw has a demo application showing all widgets. You can run it by executing
|
||||
|
||||
```bash
|
||||
adwaita-1-demo
|
||||
```
|
||||
|
||||
GTK4 has a demo application showing all widgets. You can run it by executing
|
||||
|
||||
```bash
|
||||
gtk4-widget-factory
|
||||
```
|
||||
|
||||
To find available icons execute
|
||||
|
||||
```bash
|
||||
gtk4-icon-browser
|
||||
```
|
||||
|
||||
### Links
|
||||
|
||||
Here are some important documentation links related to the Clan App:
|
||||
|
||||
- [GTK4 PyGobject Reference](http://lazka.github.io/pgi-docs/index.html#Gtk-4.0): This link provides the PyGObject reference documentation for GTK4, the toolkit used for building the user interface of the clan app. It includes information about GTK4 widgets, signals, and other features.
|
||||
|
||||
- [Adw Widget Gallery](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/widget-gallery.html): This link showcases a widget gallery for Adw, allowing you to see the available widgets and their visual appearance. It can be helpful for designing the user interface of the clan app.
|
||||
|
||||
- [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/): This link provides the GNOME Human Interface Guidelines, which offer design and usability recommendations for creating GNOME applications. It covers topics such as layout, navigation, and interaction patterns.
|
||||
|
||||
## Error handling
|
||||
|
||||
> Error dialogs should be avoided where possible, since they are disruptive.
|
||||
>
|
||||
> For simple non-critical errors, toasts can be a good alternative.
|
||||
|
||||
|
||||
[direnv]: https://direnv.net/
|
||||
[process-compose]: https://f1bonacc1.github.io/process-compose/
|
||||
[vite]: https://vite.dev/
|
||||
[webview]: https://github.com/webview/webview
|
||||
[vite]: https://vite.dev/
|
||||
[webview]: https://github.com/webview/webview
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,13 +1,26 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./webview-ui/flake-module.nix
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
self',
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
packages = {
|
||||
webview-lib = pkgs.callPackage ./webview-lib { };
|
||||
};
|
||||
|
||||
devShells.ui = pkgs.callPackage ./shell.nix {
|
||||
inherit self';
|
||||
inherit (self'.packages) clan-app webview-lib webview-ui;
|
||||
inherit (config.packages) clan-ts-api;
|
||||
};
|
||||
|
||||
devShells.clan-app = pkgs.callPackage ./shell.nix {
|
||||
inherit (config.packages) clan-app webview-lib;
|
||||
inherit self';
|
||||
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 370 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
|
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
|
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 467 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 342 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |