Status Desktop client made in Nim & QML https://status.app
Go to file
Michael Bradley, Jr d673915975 feat: layouts for the Profile screens
Work on this PR started before the build system was updated and at one point I
upgraded `nim_status_client.nimble` to use NimScript so the nimble command
would stop warning that the old format was being used. In team chat it was
discussed that since we're no longer using nimble for package management we
could simply delete `nim_status_client.nimble` to avoid confusion, which can be
done in another PR.

Introduce a BrowserLayout stub so the index will be calcualted correctly re:
the active tab.

Reorganize ChatLayout and NodeLayout into subdirs `Chat` and `Node`,
respectively.

Introduce ProfileLayout which uses a "LeftTab" approach similar to that of
WalletLayout. There remains quite a bit of styling work to be done in
ProfileLayout and its LeftTab. Also, it may be better to start over using a
SplitView like the ChatLayout, I'm not really sure.

It wasn't clear what should be the default view for the right-pane when Profile
is selected in the left-most TabBar. In this PR, it defaults to showing the
view corresponding to the ENS usernames button.

In the archived Figma for the desktop design, it seemed a picture could be set,
e.g. there is a headshot of a woman used in the Profile screen. To that end I
explored how to take a square image and clip/mask it so it appears round and I
included a larger placeholder image for that purpose. In the new design, and
with respect to mobile, it may not be possible to set a profile picture so the
code that rounds the image can maybe be dropped.
2020-05-19 20:02:21 -04:00
fonts/Inter feat: add chat box, fonts and padding size 2020-05-12 16:42:19 -04:00
sqlite Update README.md 2020-05-13 09:27:27 -04:00
src display identicons; display correct details for the user own messages 2020-05-19 19:40:40 -04:00
ui feat: layouts for the Profile screens 2020-05-19 20:02:21 -04:00
vendor bump vendor/nimbus-build-system 2020-05-19 16:29:21 -04:00
.gitignore feat: layouts for the Profile screens 2020-05-19 20:02:21 -04:00
.gitmodules fix: signal handler integration with status-go 2020-05-18 11:42:50 -04:00
AppRun ft: AppImage 2020-05-15 18:03:55 -04:00
Makefile Makefile: don't run the "setup-dev" target in vendor/status-go 2020-05-19 15:01:28 -04:00
README.md Add minor trouble shooting instructions 2020-05-19 11:15:12 +02:00
build-linux.sh ft: AppImage 2020-05-15 18:03:55 -04:00
docker-linux-app-image.sh ft: AppImage 2020-05-15 18:03:55 -04:00
env.sh Adding nimbus-build-system 2020-05-15 17:18:20 -04:00
nim-status.desktop AppImg packaging 2020-05-15 17:18:20 -04:00
nim_status_client.nimble feat: layouts for the Profile screens 2020-05-19 20:02:21 -04:00
screenRec.gif Initial commit 2020-05-06 13:40:00 -04:00
status.ico add status icon 2020-05-11 16:41:45 -04:00
status.svg Adding nimbus-build-system 2020-05-15 17:18:20 -04:00

README.md

nim-status-client

Experiments calling status-go from nim, inspired in nim-stratus by @arnetheduck

Building

0. Prerequesites

  • QT

install QT https://www.qt.io/download-qt-installer and add it to the PATH

# Linux
export PATH=$PATH:/path/to/Qt/5.14.2/gcc_64/bin

# macos
export PATH=$PATH:/path/to/Qt/5.14.2/clang_64/bin

Linux users can also install Qt through the system's package manager:

# Debian/Ubuntu:
sudo apt install qtbase5-dev qtdeclarative5-dev qml-module-qt-labs-platform
  • go - (used to build status-go)
# linux
<TODO>

# macos
brew install go

1. Install QT, and add it to the PATH

# Linux
export PATH=$PATH:/path/to/Qt/5.14.2/gcc_64/bin

# macos
export PATH=$PATH:/path/to/Qt/5.14.2/clang_64/bin

2. Clone the repo and build nim-status-client

git clone https://github.com/status-im/nim-status-client/ --recurse-submodules
make

if you previously cloned the repo without the --recurse-submodule options, then do

git submodule update --init --recursive
make

for more output use make V=1

Trouble Shooting:

If the make command fails due to already installed homebrew packages, such as:

Error: protobuf 3.11.4 is already installed
To upgrade to 3.11.4_1, run `brew upgrade protobuf`.
make[1]: *** [install-os-dependencies] Error 1
make: *** [vendor/status-go/build/bin/libstatus.a] Error 2

This can be fixed by uninstalling the package e.g. brew uninstall protobuf followed by rerunning make.

3. Setup Library Path

export LD_LIBRARY_PATH=vendor/DOtherSide/build/lib/

4. Run the app

./bin/nim_status_client

Development

If only making changes in QML ui/ re-rerunning the app is enough If making changes in the nim code src/ then doing make again is needed (it's very fast after the first run)

Cold Reload

5. "Cold" reload using VSCode

We can setup a "cold" reload, whereby the app will be rebuilt and restarted when changes in the source are saved. This will not save state, as the app will be restarted, but it will save us some time from manually restarting the app. We can handily force an app rebuild/relaunch with the shortcut Cmd+Shift+b (execute the default build task, which we'll setup below).

To enable a meagre app reload during development, first creates a task in .vscode/tasks.json. This task sets up the default build task for the workspace, and depends on the task that compiles our nim:

({
  "label": "Build Nim Status Client",
  "type": "shell",
  "command": "nim",
  "args": [
    "c",
    "-L:lib/libstatus.dylib",
    "-L:-lm",
    "-L:\"-framework Foundation -framework Security -framework IOKit -framework CoreServices\"",
    "--outdir:./bin",
    "src/nim_status_client.nim"
  ],
  "options": {
    "cwd": "${workspaceRoot}"
  }
},
{
  "label": "Run nim_status_client",
  "type": "shell",
  "command": "bash",
  "args": ["./run.sh"],
  "options": {
    "cwd": "${workspaceRoot}/.vscode"
  },
  "dependsOn": ["Build Nim Status Client"],
  "group": {
    "kind": "build",
    "isDefault": true
  }
})

Next, add a .vscode/run.sh file, changing the DOtherSide lib path to be specific to your environment:

export LD_LIBRARY_PATH="/Users/emizzle/repos/github.com/filcuc/DOtherSide/build/lib"
../bin/nim_status_client

Auto build on save (for the "cold" reload effect)

Finally, to get trigger this default build task when our files our saved, we need to enable a task to be run while .nim files are saved, and when .qml files are saved.

Build on save

To build on save of our source files, first install the "Trigger Task on Save" VS Code extension to detect changes to our changable files, which will trigger a build/run. Once installed, update settings.json like so:

"files.autoSave": "afterDelay",
"triggerTaskOnSave.tasks": {
  "Run nim_status_client": ["ui/**/*", "src/*.nim"]
},
"triggerTaskOnSave.restart": true,
"triggerTaskOnSave.showStatusBarToggle": true