What is Roost?

  • Roost consists of three crates:

    • roost: A server binary crate to be run on our machine. (Depends upon roost-app)
    • roost-app: An application crate that is a library handling most of the components of Roost.
      • app/src/views: Handles the available views in Roost, such as a FileView and a DirView respectively
      • app/src/state: Handles the application state of Roost, such as obtaining the file and directory contents.
    • roost-client: A client crate that is built to web assembly and served by the roost crate. (Depends upon roost-app)
  • Roost is a fork of the isomorphic web app example within Percy's Github repository.

    • Percy allows for modern web app development features such as:
      • A virtual DOM
      • Server side rendering of a single page application (SPA)
    • Since Roost is an isomorphic web app, other clients could be added such as an electron client.
    • Writing HTML and CSS with Percy is simple because of the html! and css! macros.
      • Examples that use the html! and css! macros can be found in app/src/views/
    • Roost was forked from Percy's isomorphic web app example shortly after the on_visit attribute was added to the route handlers in app/src/lib.rs.
      • This on_visit attribute was a key element of the download example I added to Percy.
  • At the moment Roost allows you to navigate the current state of contents in a local Pijul repository.

    • The repository contents that Roost currently allows you to view are:
      • File contents from the latest patch
      • Current state of directory contents
        • Any changes made to the repository are characterized with colored backgrounds in the directory view
      • Information about previous patches applied to the current file or directory
    • By "current state", it is meant that if you make adjustments to the local repository, those adjustments are reflected in Roost.

Glossary

  • Entry is used as a generic term for a file or directory.
    • Hence our SPA is always displaying the EntryView, but displays a FileView or DirView depending on the file type of the given entry

Existing Issues

  • Does not yet support changing to a previous patch.
  • Can not show current state of a file's contents
  • Can not open an empty directory.
  • Can not change the selected patch, but clicking an element that should change the current patch will change the URL based on that patch's hash.
  • We are leaking memory to fetch JSON of the next selected route.
    • Check out download_patch_json() in app/src/lib.rs
  • Can not toggle diff_mode on the application state

Future Plans

Original Route Design

Header view:

  • Inluded in all routes
  • Has a hyperlink to /list-patches route
  • Has a hyperlink to root directory of repo

Routes:

  • /
    • Selected Values:
      • branch: current
      • path: /
  • /path/:path
    • Selected Values:
      • branch: current
      • path
  • /branch/:branch_name
    • Selected Values:
      • branch_name
      • path: /
  • /branch/:branch_name/:path
    • Selected Values:
      • branch_name
      • path

Directory View:

  • Shows read dir view of current directory
  • Displays the markdown view for the README.md file in the current directory

File view:

  • Shows the name of the current file
  • Shows information about the file, such as file permissions?
  • If markdown filetype, shows the markdown view of the file
    • This view can be toggled to the source code view without changing routes
  • If not markdown, shows the source code view of the current file

Read dir view:

  • Can be in diff-mode
  • Shows the name of each entry
  • Shows the record message of the last patch on that entry as a hyperlink, along with the date of the patch
    • The hyperlink leads to the /patch/:patch/:path route for that entry on the latest patch

Markdown view:

  • Shows the parsed markdown file

Source code view:

  • Can be in diff-mode
  • Shows the source code of the current file

Subheader view:

  • Only available for above routes
  • Has a drop-down of branches this path exists within
  • Has a drop-down of patches that affected this path

Handling the current state of the repo (only possible from the above routes):

  • If the current state of the repo differs from the latest patch of the selected branch:

    • Show in diff-mode, similar to route /patch/:patch/:path. Showing the differences between the current state and the latest patch of the selected branch (if any).
      • The only difference between this and the /patch/:patch/:path route is the need to include and mark untracked files.
  • If the current state of the repo does not differ from the latest patch of the selected branch, don't show any differences and show the latest patch.

  • /patch/:patch

    • Links to /patch/:patch/:path routes
    • Values:
      • patch
  • /patch/:patch/:path

    • Has a drop-down of patches that affected this path
    • Values:
      • patch
      • path

Patch subheader view:

  • For two above routes

  • Record message

  • Author

  • Date

  • Branches this patch exists within

  • /list-patches

  • Links to /patch/:patch routes

  • Record message

  • Author

  • Date