Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
smallhadroncollider committed Aug 2, 2018
2 parents 00e5afd + 9c8b53b commit c741c0f
Show file tree
Hide file tree
Showing 69 changed files with 1,783 additions and 949 deletions.
1 change: 1 addition & 0 deletions .bin/analytics
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -s https://formulae.brew.sh/analytics/install/30d/ | grep taskell -A 1 | sed -e 's/<[^>]*>//g'
4 changes: 2 additions & 2 deletions .bin/build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resolver="lts-11.8"
ghcv="8.2.2"
resolver="lts-12.0"
ghcv="8.4.3"

branch=$(git rev-parse --abbrev-ref HEAD)

Expand Down
1 change: 1 addition & 0 deletions .bin/ghcid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~/.local/bin/ghcid --command "stack ghci taskell:lib taskell:test:taskell-test --ghci-options=-fobject-code" --test "main"
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@ A CLI kanban board/task manager for Mac and Linux
- Support for sub-tasks and due dates
- Trello board imports

<a href="https://www.buymeacoffee.com/shc" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

Follow [@taskellcli](https://twitter.com/taskellcli) on Twitter for updates

![Demo](https://taskell.app/img/demo.gif)

<a href="https://www.buymeacoffee.com/shc" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
---

## Contents

- [Installation](#installation)
- [Running](#running)
- [Options](#options)
- [Trello](#trello)
- [GitHub](#github)
- [Controls](#controls)
- [Storage](#storage)
- [Configuration](#configuration)
- [Theming](#theming)
- [Roadmap](#roadmap)
- [Contributing](#contributing)

## Installation

Expand Down Expand Up @@ -54,7 +70,8 @@ If none of the above options work you can build taskell using [Stack](https://do

- `-h`: show help
- `-v`: show version number
- `-t <trello-board-id>`: import a Trello board (see below)
- `-t <trello-board-id>`: import a Trello board ([see below](#trello))
- `-g <github-project-id>`: import a GitHub project ([see below](#github))

## Trello

Expand Down Expand Up @@ -94,9 +111,42 @@ Make sure you have permission to view the Trello board, otherwise you'll get an
- Card due dates
- Card checklists (merged into one list per card)

### Plans

- Full syncing with Trello: effectively using taskell as a CLI Trello front-end
## GitHub

Taskell includes the ability to fetch a GitHub project and store it as local taskell file.

### Authentication

Before fetching a GitHub board, you'll need to create a person access token and store it in `~/.taskell/config.ini`.

- First, [get a GitHub personal access token](https://github.com/settings/tokens/new)
- Make sure to tick the `repo` scope
- Then add it to `~/.taskell/config.ini`:

```ini
[github]
token = <your-github-personal-access-token>
```

You can delete personal access tokens [on GitHub](https://github.com/settings/tokens/)

### Fetching

Running the following would pull down the GitHub project with the ID "1234567" into a file named `github.md` and then open taskell with that file.

```bash
taskell -g 1234567 github.md
```

Make sure you have permission to view the GitHub project, otherwise you'll get an error.

### Limitations

- This is a one-off procedure: it effectively imports a GitHub project to taskell
- Currently imports:
- Columns
- Cards


## Controls
Expand Down
2 changes: 1 addition & 1 deletion docs/html/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: taskell
tagline: Command-line Kanban board/task managment
baseurl: ""
locale: "en"
version: 1.2.6
version: 1.3.0
destination: _site/public
exclude: [deployment, Capfile, log, Gemfile, Gemfile.lock]

Expand Down
Binary file added github.paw
Binary file not shown.
41 changes: 28 additions & 13 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: taskell
version: '1.2.6.0'
version: '1.3.0.0'
category: CLI
author: Mark Wales
maintainer: mark@smallhadroncollider.com
Expand All @@ -20,38 +20,50 @@ dependencies:
library:
source-dirs: src
ghc-options:
- -Wall
- -Werror
- -O0
exposed-modules:
- App
- Events.State
- IO.Taskell
- IO.Config
- IO.Taskell

# tests
- Data.Taskell.Date
- Data.Taskell.Lists
- Data.Taskell.List
- Data.Taskell.List.Internal
- Data.Taskell.Lists
- Data.Taskell.Lists.Internal
- Data.Taskell.Seq
- Data.Taskell.Subtask
- Data.Taskell.Subtask.Internal
- Data.Taskell.Task
- Data.Taskell.Task.Internal
- Events.State.Types
- Events.State.Types.Mode
- IO.Config.Markdown
- IO.Markdown.Internal
- IO.Trello.List
- IO.Trello.ChecklistItem
- UI.Field

dependencies:
- base <=5
- vty
- text
- time
- mtl
- brick
- aeson
- brick
- bytestring
- config-ini
- containers
- directory
- file-embed
- http-conduit
- http-client
- http-types
- lens
- mtl
- template-haskell
- text
- time
- vty

executables:
taskell:
Expand All @@ -75,11 +87,14 @@ tests:
- -with-rtsopts=-N
dependencies:
- base
- time
- aeson
- containers
- text
- file-embed
- lens
- taskell
- tasty
- tasty-hunit
- tasty-discover
- tasty-expected-failure
- tasty-hunit
- text
- time
33 changes: 26 additions & 7 deletions roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@

## Refactoring

- Use a Makefile instead of bash script
- Update Task field naming
* [ ] Task: description -> name/title
* [ ] Task: summary -> description
* [x] UI.Modal.SubTasks -> UI.Modal.Detail
- Use Shake instead of bash script
- Break up State module
- Parse checkItems Trello JSON using Aeson FromJSON rather than needing extra record type
- Use a map in Actions to tidy things up/add custom key support
- Avoid having to normalise the state?
- Remove duplication of config - currently using ini and hard-coded defaults
- Move Help modal creation into Template Haskell
- Use lenses for nested data?
- Add a List widget for common actions between tasks and sub-tasks
- Tidy up load functions in IO.Taskell
- Remove `~` style sub-task complete parsing
Expand All @@ -33,11 +29,14 @@
- Modal boxes shouldn't be full height unless they need to be
- Up and down in search gets a bit lost
- Multiple spaces in a line don't show up as more than one, but are saved as more than one
- The isBlank check on tasks could potentially delete a task with no description but which does have sub-tasks
- Task description should be visible by default in task detail
> Visibility should be on the description by default?
- No obvious way to know if there are more items in a list off-screen
> Lowest item should be "..." if more items
- Can't remove a description
- Date should update if taskell is left open
- Blank trello token should show info about setting it up rather than auth error
> Auth error should show setup info too?
## Features

Expand Down Expand Up @@ -66,6 +65,16 @@
## In Progress

- Add ability to list GitHub projects
> Give an organisation or username and repo, list the possible projects to fetch - avoid having to look up the project ID manually first
- Refactor IO.Taskell
> Avoid repeating basically the same code for Trello and GitHub fetching
- Should be able to have new-lines in task descriptions
* [x] Trello import
* [ ] Regular input (Shift + Enter for new line?)
* [x] Markdown parsing
* [ ] Text line breaks go a bit funny with multi-line descriptions
- Add tests for IO.GitHub

## Done

Expand Down Expand Up @@ -224,3 +233,13 @@
* [x] Find someone to submit it
* [x] Use `install_cabal_package`
* [x] Use `depends_on "cabal-install" => :build`
- Update Task field naming
* [x] Task: description -> name/title
* [x] Task: summary -> description
* [x] UI.Modal.SubTasks -> UI.Modal.Detail
- The isBlank check on tasks could potentially delete a task with no description but which does have sub-tasks
- Blank task names should appear as something
- Use lenses for nested data
- Add more tests
* [x] Trello response parsing
- Add GitHub Project support
30 changes: 17 additions & 13 deletions src/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
module App (go) where

import ClassyPrelude

import Control.Lens ((^.))

import Control.Concurrent (forkIO)

import Brick
Expand All @@ -11,41 +14,42 @@ import Graphics.Vty.Input.Events (Event(..))
import Data.Taskell.Lists (Lists)
import Data.Taskell.Date (currentDay)
import Events.Actions (event)
import Events.State (continue, path, mode, io, current, lists, countCurrent)
import Events.State.Types (State, Mode(..), ModalType(..), InsertMode(..), InsertType(..))
import Events.State (continue, countCurrent)
import Events.State.Types (State, path, mode, io, current, lists)
import Events.State.Types.Mode (Mode(..), ModalType(..), InsertMode(..), InsertType(..))
import IO.Config (Config, layout, generateAttrMap)
import IO.Taskell (writeData)
import UI.Draw (draw, chooseCursor)
import UI.Types (ResourceName(..))

-- store
store :: Config -> Lists -> State -> IO State
store config ls s = do
_ <- forkIO $ writeData config ls (path s)
return (Events.State.continue s)
store config ls state = do
_ <- forkIO $ writeData config ls (state ^. path)
return (Events.State.continue state)

next :: Config -> State -> EventM ResourceName (Next State)
next config s = case io s of
Just ls -> invalidateCache >> liftIO (store config ls s) >>= Brick.continue
Nothing -> Brick.continue s
next config state = case state ^. io of
Just ls -> invalidateCache >> liftIO (store config ls state) >>= Brick.continue
Nothing -> Brick.continue state

-- cache clearing
clearCache :: State -> EventM ResourceName ()
clearCache state = do
let (li, ti) = current state
let (li, ti) = state ^. current
invalidateCacheEntry (RNList li)
invalidateCacheEntry (RNTask (li, ti))

clearAllTitles :: State -> EventM ResourceName ()
clearAllTitles state = do
let count = length (lists state)
let count = length (state ^. lists)
let range = [0 .. (count - 1)]
void . sequence $ invalidateCacheEntry . RNList <$> range
void . sequence $ invalidateCacheEntry . (\x -> RNTask (x, -1)) <$> range

clearList :: State -> EventM ResourceName ()
clearList state = do
let (list, _) = current state
let (list, _) = state ^. current
let count = countCurrent state
let range = [0 .. (count - 1)]
invalidateCacheEntry $ RNList list
Expand All @@ -56,13 +60,13 @@ handleVtyEvent :: Config -> State -> Event -> EventM ResourceName (Next State)
handleVtyEvent config previousState e = do
let state = event e previousState

case mode previousState of
case previousState ^. mode of
Search _ _ -> invalidateCache
(Modal MoveTo) -> clearAllTitles previousState
(Insert ITask ICreate _) -> clearList previousState
_ -> return ()

case mode state of
case state ^. mode of
Shutdown -> Brick.halt state
(Modal MoveTo) -> clearAllTitles state >> next config state
(Insert ITask ICreate _) -> clearList state >> next config state
Expand Down
2 changes: 1 addition & 1 deletion src/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ClassyPrelude
import Data.FileEmbed (embedFile)

version :: Text
version = "1.2.6"
version = "1.3.0"

usage :: Text
usage = decodeUtf8 $(embedFile "templates/usage.txt")
Loading

0 comments on commit c741c0f

Please sign in to comment.