2
1
Fork 0

Adds readme update, images, and removes dead code branch

This commit is contained in:
sloum 2021-03-26 22:57:00 -07:00
parent 3a4d66220f
commit e02b21076b
6 changed files with 125 additions and 6 deletions

123
README.md
View File

@ -10,5 +10,126 @@ A Makefile has been provided with targets for `make` to just build in the local
## Usage
_swim_ has a decent sized, and growing, number of commands and "hot" keys. They will be detailed in this section, but are also avialable via the manpage.
_swim_ has a number of commands and "hot" keys. They will be detailed in this section, but are also avialable via the manpage.
The main view of the program is the `swim lane` view. You can add as many lanes as you like. Lanes have titles and contain stories. A story shows up in a lane as the story title on the first row of the card and the assigned users (initials) and the number of story points together on the second row of the card.
![a screenshot of the swim lane view of the application 'swim'](swim-lane-view.png)
When viewing a story you will see the story title, when the story was last updated, the user(s) assigned to the story, a description of the story, a checklist in the form of tasks, and a comments section.
![a screenshot of the story view of the application 'swim'](swim-story-view.png)
### "Hot" Keys
These can be pressed at appropriate times to quickly control the board/program.
#### Lane View
These keys have the following effect while looking at the main 'swim lane' view:
- `h` - Move focus one lane to the left
- `j` - Move focus one story down
- `k` - Move focus one story up
- `l` - Move focus one lane to the right
- 'H' - Move focused story one lane to the left
- 'J' - Move focused story one story down in the current lane
- 'K' - Move focused story one story up in the current lane
- 'L' - Move focused story one lane to the right
- `Q` - Quit swim immediately
- `N` - Create a new lane, will query for lane name
- `n` - Create a new story in the focused lane, will query for story name
- `<Enter>` - View the currently focused story
- `g` - Move focus to the first (top) story in the currently focused lane
- `G` - Move focus to the last (bottom) story in the currently focused lane
- `:` - Enter command mode; all commands work from any view/screen
- `+` - Zoom in; show fewer, but wider, lanes on the screen at one time
- `-` - Zoom out; show more, but narrower, lanes on the screen at one time
#### Story View
While looking at a story's detailed view these keys have the following effects to the story being viewed:
- `h` - Return to 'swim lane' view
- `j` - Scroll down
- `k` - Scroll up
- `g` - Scroll to top
- `G` - Scroll to bottom
- `:` - Enter command mode; all commands work from any view
- `c` - Add a new comment; will query for comment value
- `t` - Add a new task; will query for comment value
- `T` - Set a new title; will query for title value
- `d` - Set a new description; will query for description value
- `D` - Delete a task, will query for task number
- `u` - Toggle assigned user(s); will query for a space separated list of users and will toggle each user's state on/off (if they are already on the card they will be removed, otherwise they will be added)
- `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `0` - Will toggle the task with the given number (un)complete. `0` represents `10`. This is quicker than having to type `:toggle 2` or the like
### Commands
Command mode can be accessed via the "hot" key `:`. Most of the commands can be abbreviated. For example: `:set story points 2` could also be `:s s p 2` or `:s st points 2`. In most cases any portion of the word will work.
This tree style listing shows commands and their sub-commands. Anything inside of `{curly braces}` represents an optional value that can be added. These optional values can be as many words as you like and the command that you are issuing will put them together as needed. If an optional value is not passed as a part of the command then the user will be queried for the value and their response will be verified (with a yes/no/cancel prompt).
- `create`
- `lane`
- `{title}`
- `story` - Will be added to the currently selected lane
- `{title}`
- `task` - Will be added to the currently selected story
- `{value}`
- `coment`
- `{value}`
- `delete`
- `lane` - Always refers to the currently selected lane
- `story` - Always refers to the currently selected story
- `task` - Always refers to the currently selected story
- `{task number}`
- `quit`
- `set`
- `board`
- `title`
- `{value}`
- `lane` - Always refers to the currently selected lane
- `title`
- `{value}`
- `story` - Always refers to the currently selected story
- `title`
- `{value}`
- `description`
- `{value}`
- `points`
- `{value}`
- `user`
- {space separated list of usernames to (un)assign}
- `toggle` - Marks a task as (in)complete. Always refers to the currently selected story
- `{task number}`
- `user` - Always refers to the currently selected story
- `{space separated list of usernames to (un)assign}`
- `write`
- `{path}` - Will use the current path if nothing is passed
- `wq` - Same as `write`, but quits afterward
- `{path}` - Will use the current path if nothing is passed
## Files
swim writes data to files as json data representing program state. This allows swim files to be flexible. In theory an alternate client could be built around the same data models and interoperate pretty easily with swim, allowing end users choice of control application for underlying data.
## Colors
Reliably getting a value for what color modes are supported for a given terminal is tricky business. _swim_ does some sniffing and makes a conservative guess for what color mode your terminal will support. Three modes are supported: 4-bit (Simple), 8-Bit (256), and 24-Bit (True). The colors can be found in the file `colors.go` and can be edited and recompiled if desired. They use [ansi escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) and work in a mostly straightforward manner.
Any of the three color modes can be forced with the runtime flag `-color`. For example:
- `swim -color simple ./my-file.swim`
- `swim -color 256 ./my-file.swim`
- `swim -color true ./my-file.swim`
- `swim -color none ./my-file.swim`
That last one, `none`, will never be used automatically, but can be passed with the given flag to turn off color and just use your terminal's foreground/background colors (plus occasional bold and inverse coloring).
## Sizing and Signals
_swim_ will automatically resize and redraw when your terminal is resized. It also handled common signals well, allowing for suspend/resume job control to work nicely and for other signals (^c and ^d come to mind) to behave as expected.

View File

@ -98,8 +98,6 @@ func (b *Board) Run() {
case 'h', 'j', 'k', 'l', 'H', 'L', 'K', 'J':
b.ClearMessage()
b.Move(ch)
case 'D':
// Delete current story
case ':':
b.EnterCommand()
case '+':

View File

@ -223,7 +223,7 @@ func DefaultBoard(cols, rows int) Board {
func SetColorFromFlag(f string) int {
f = strings.ToUpper(f)
switch f {
case "8":
case "SIMPLE":
return SimpleColor
case "256":
return EightBitColor
@ -237,7 +237,7 @@ func SetColorFromFlag(f string) int {
}
func main() {
colors := flag.String("color", "", "Color mode: 8, 256, True, None" )
colors := flag.String("color", "", "Color mode: Simple, 256, True, None" )
flag.Parse()
args := flag.Args()
style.Init(SetColorFromFlag(*colors))

BIN
swim-lane-view.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
swim-story-view.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because one or more lines are too long