Giter Club home page Giter Club logo

velo's Introduction

Velo πŸš΅β€β™€οΈπŸš΅

Rustcodecov

velo alt text

Demo

This app is primarily designed for native desktop platforms, and its WebAssembly (wasm) target has a limited feature set. wasm target is best suited for quick document sharing, currently, only WebGPU backend enabled for the demo:

https://staffengineer.github.io/velo?document=https://gist.githubusercontent.com/StaffEngineer/bf7d94759abbd7aa722330e5fe4f0bd5/raw/e817be0ba700e94be472d435638d762b9deadf33/velo.json

What's implemented:

  • support rectangle/circle/paperlike notes
  • add/remove note
  • note resizing
  • note repositioning
  • wrapped text inside notes
  • paste screenshot from clipboard [native target only πŸ–₯️]
  • connect notes with arrows
  • make app snapshot in memory and load from it (MacOs: Command + s[l])
  • save app state to database and load from it
  • change background color of notes
  • move note to front/back
  • positioning text inside note
  • multiple documents/tabs support
  • load app state from url
  • ability to create sharable url of the document using "Share Document" button (.velo.toml should be created in user's home directory containing GitHub access token with "gist" scope) [native target only πŸ–₯️]:
github_access_token = "<github_access_token>"
  • initial markdown support
    • italic/bold text style
    • links
    • syntax highlighting
    • headings (proper headings support was temporarily removed)
    • inline code
    • ordered/unordered lists
  • particles effect [native target only πŸ–₯️]
  • filter documents by text in notes (fuzzy search) [native target only πŸ–₯️]
  • highlight notes containing searched text [native target only πŸ–₯️]
  • ligature/emoji rendering support [emoji native target only πŸ–₯️]
  • dark/light theme support (app restart is required for now)
  • infinite canvas with zooming (right click to move camera, mouse wheel to zoom)
  • undo/redo for text editing [native target only πŸ–₯️]
  • drawing mode (click on pencil icon to enable it)
  • draw line, arrow, rhombus or rectangle by choosing 2 points
  • hide/show children notes for selected note
  • navigation to random note

Installation

Archives of precompiled binaries for velo are available for Windows, macOS and Linux.

Compiling from Source

If you want to compile from source you can use

cargo install --path .

ATTENTION If you have set your cargo target directory in .cargo/config.toml you must provide the fullpath to the assets directory like this

BEVY_ASSET_PATH=$(realpath assets) cargo install --path .

Run

Native:

cargo r --release

Wasm:

cargo install wasm-server-runner
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo r --release --target wasm32-unknown-unknown

To create app bundle with icon (tested only on MacOS):

cargo install cargo-bundle
cargo bundle

Pre-commit actions

cargo fmt
cargo clippy -- -A clippy::type_complexity -A clippy::too_many_arguments

Basic usage

  • click on rectangle icon to create rectangle note
  • double-click to select note
  • start typing to add text to selected note
  • resize note by dragging its corners
  • click on canvas to deselect note
  • move note by dragging it (only unselected note can be dragged to allow mouse text selection for selected note)
  • click on little arrow connector icon to connect notes, arrow connector icons are placed on each side of note
  • for native target there is search box that allows to filter documents by text in notes (fuzzy search)
  • for wasm target there is url query parameter ?document=<url> to load document from url
  • click save icon to save document to database on native platform or to localStorage on wasm target
  • click on drawing pencil to enable drawing mode

Troubleshooting

If the application fails to start, you can try resolving the issue by removing velo data folder. This problem may occur due to changes in the data schema between different versions of the application.

  • MacOS: /Users/<username>/Library/Application Support/velo
  • Windows: C:\Users\<username>\AppData\Roaming\velo
  • Linux: /home/<username>/.config/velo
  • wasm: localStorage.clear()

License

All code in this repository dual-licensed under either:

MIT License or http://opensource.org/licenses/MIT Apache License, Version 2.0 or http://www.apache.org/licenses/LICENSE-2.0 Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contributing

Contributions are always welcome! Please adhere to this project's code of conduct.

❀️

velo's People

Contributors

adethormiwa avatar dependabot[bot] avatar nx2k3 avatar sagudev avatar staffengineer avatar tigregalis avatar toastedbreadandomelette avatar toasterson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

velo's Issues

Rename functionality doesn't work properly

Description

When using the rename functionality, I've noticed that it stops working properly if I keep the delete key pressed for a prolonged period of time. This behavior doesn't occur if the key is pressed singularly.

To Reproduce

  1. Select a tab or filename that you want to rename.
  2. Press the rename button.
  3. Press and hold the delete key.

Expected behavior

The renaming process should work properly and be able to handle the deletion of characters even if the delete key is pressed continually.

Actual behavior

The renaming process freezes and stops working.

Hex color widget

Instead of having 5 colors for rectangles background let's have one default color (yellow one):
image
and text input near to it to change to any color: [] #7d26cd

Add exporting/importing document feature

Currently app uses database to store app data (documents) on native platform. Prior to storing data in database it was stored in json files in the first version of the app. PR that introduced database usage: #17 and removed saving/loading data from json file. It's useful feature to have ability to just export/import document to json file to share it with a buddy. Let's have an option to export/import document from database to json file.

Implement second type of rectangle node

image

Have 2 types of rectangles... one with border and rounded corners (already implemented, rounded corners separate issue) and one without border but nice shadow beneath.

Support more forms

Currently velo supports only one form: rectangle. Let's add more forms:
image
image
image
image
etc

Add tagging/untagging for documents

Add editable field that allows adding/removing tags from document (position of red rectangle in the right bottom corner):

image

Proposed syntax for tags is #tag_name1, #tag_name2, by pressing Enter editing of tags is ended.

Add app icon

Make sure that it’s embedded in release binary

Workaround `WebGL: INVALID_OPERATION drawArrays` error in bevy

Let's change the logic to workaround the issue bevyengine/bevy#5732

  • update position of arrow instead of re-creation of it on rectangle position change (this is a good improvement)
  • for wasm platform, let's not remove arrows at all and just hide them (this is a temporary workaround until the issue is fixed upstream)

This will allow to run application on wasm without errors.

Text fuzzy search

Let's add text fuzzy search support.

As the first iteration for this feature we can just filter documents and show document only if it has node with searched text.

Support portrait view

Portrait view is currently broken:

photo_5913336039018183421_y

We can make layout mobile-friendly: restyle left panel on narrow screen, add opening keyboard, add touch handlers, etc.

Decrease wasm size

We use bevy_embedded_assets to embed assets, let's not do it for wasm, so assets is requested by separate request (this is default behaviour of bevy). Bevy loading screen have to be implemented as part of this issue.
@nx2k3 idea πŸ’‘ to use running bicycle gif during loading.

Start adding tests

  • test for button
    • color
    • bring front and back
    • new tab ,rename and delete
    • new document,rename and delete
  • test for rectangle
    • test spawn and de-spawn
    • test re size and re position
  • test for arrows
    • test spawn and de-spawn
    • test re size and re position
    • test different types of arrow
  • test save and load

UX improvements

Just a first baby steps in this direction, proposed improvements:
Screenshot_2023-04-13_161340

Arrows parallel mode

Currently it's possible to connect nodes like so:
image
Let's implement another mode for arrows:
image

Note: assets for buttons that enable the mode are already in assets folder

⭐ Ideas to explore

Just noting the ideas to explore... feel free to contribute your ideas here:

  • executable code in rectangles (see org-babel, jupyter for inspiration)
  • org-mode, markdown support in rectangles
  • connection between documents and meta view of connected documents (see org-roam for inspiration)
  • collaborative editing (use bevy_matchbox)
  • code based drawing (see plantuml for inspiration)
  • ChatGPT assistance

Allow deleting document on app start

Currently, velo doesn't allow to remove document if there is only one document in memory:

 if app_state.docs.len() < 2 {
    return;
}

On app start velo loads only one document from database to memory, so user can't remove document on app start.
One of the options to fix this: if there is only one document in memory query database and load one more document to allow deleting.

Wasm small improvements

  • currently velo uses localStorage on wasm target that is very limited in size (it may change in the future if bevy-pkv will have indexeddb backend option for wasm target), let's add button that clears localStorage velo data
  • currently "Export To File" button is disabled for wasm, let's have similar button but store document on global js object that can be easily accessed in console. Fixed by #75

Highlight nodes containing searched text

Native platform supports fuzzy search feature that is used for filtering documents that contain nodes with particular text. Let's developer fuzzy search feature further and highlight found nodes if they are on viewport.

Add curve arrows

Lucid.app has 3 types of arrows:

image

Velo currently supports two types of arrows, let's implement third.

Multiple nodes selection

Currently, it's possible to select only one node, let's have ability to select few nodes simultaneously, e.g to be able to move them together.

GitHub Integration (share document feature)

Currently it's possible to load app state via document url param on wasm target. It's nice way to share a document but it requires some manual steps to create public gist with app state. Let's implement GitHub integration, so user can sign in/give velo permissions to create public gist with document state.

Say, by clicking "Share Document" button the following steps are performed:

Implement simple bevy-markdown renderer

Support markdown syntax in rectangle. Render markdown once a user stops editing rectangle.

Features:

  • bold text style
  • italic text style
  • links
  • inline images
  • headings
  • inline code
  • code block with syntax highlighting
  • ordered/unordered lists
  • quotes
  • tables
  • strikethrough text
  • checkboxes

Add status bar

Instead of silently ignore errors or crash the app (during import/export from file/url) let's have a status bar that will report the error (status) to a user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.