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
|
# 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
|
||||||
|
|||||||
@@ -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 = ''
|
||||||
|
|||||||
@@ -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 ''
|
||||||
@@ -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/
|
||||||
|
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 =
|
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';
|
||||||
|
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 |