rename ui to clan-app and move clan-app one layer up

This commit is contained in:
Jörg Thalheim
2025-05-15 13:19:20 +02:00
parent 5753109b80
commit 57dcd47992
190 changed files with 128 additions and 192 deletions

8
.gitignore vendored
View File

@@ -46,3 +46,11 @@ dist
# TODO: remove after bug in select is fixed # TODO: remove after bug in select is fixed
select 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

View File

@@ -45,7 +45,7 @@ pkgs.stdenv.mkDerivation {
ln -snf ${fira-code}/share/fonts/truetype/FiraCode-VF.ttf ./site/static/ ln -snf ${fira-code}/share/fonts/truetype/FiraCode-VF.ttf ./site/static/
# Copy icons into place # 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 = '' buildPhase = ''

View File

@@ -1,7 +1,7 @@
# shellcheck shell=bash # shellcheck shell=bash
source_up 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 # Because we depend on nixpkgs sources, uploading to builders takes a long time
use flake .#ui --builders '' use flake .#ui --builders ''

View File

@@ -1,6 +1,8 @@
# 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`: Enter the `pkgs/ui` directory and allow [direnv] to load the `ui` devshell with `direnv allow`:
@@ -42,6 +44,93 @@ From there you can start `clan-app` again with `F7`.
> >
> 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/ [direnv]: https://direnv.net/
[process-compose]: https://f1bonacc1.github.io/process-compose/ [process-compose]: https://f1bonacc1.github.io/process-compose/
[vite]: https://vite.dev/ [vite]: https://vite.dev/

View File

@@ -1,13 +1,26 @@
{ ... }:
{ {
imports = [
./webview-ui/flake-module.nix
];
perSystem = perSystem =
{ {
config,
pkgs,
self', 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 { devShells.clan-app = pkgs.callPackage ./shell.nix {
inherit (config.packages) clan-app webview-lib; inherit (config.packages) clan-app webview-lib;
inherit self'; inherit self';

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

View File

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

View File

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

View File

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 370 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

View File

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

View File

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

View File

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 168 B

View File

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View File

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

View File

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 467 B

View File

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 142 B

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 342 B

View File

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 363 B

View File

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View File

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

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