Skip to content

Commit

Permalink
Updatre README
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech committed Nov 10, 2024
1 parent 91042b0 commit b46c544
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 9 deletions.
67 changes: 58 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,73 @@ Strava TUI written in Rust! This is an experimental TUI for Strava.
Features:

- List activities in a comparable way
- Filter activites by name
- Filter activites by with expressions
- Sort listed activities
- Display the route
- Show laps
- Race predictions
- Filter by route similarity ("anchoring")

## Screenshots

### List activities

![image](https://github.com/dantleech/strava-rs/assets/530801/7187befb-65e2-4fbc-b5b4-8710510c5e1a)
*Numbers*
![image](https://github.com/user-attachments/assets/f13ed611-d764-4941-a3df-c95db8636ba7)

### Acivity View

![image](https://github.com/user-attachments/assets/88c9b34a-7cee-409d-9d01-39bd22ef8259)

## Key Map

- `q`: **Quit**: quit!
- `k`: **Up** - select previous activity
- `j`: **Down** - select next activity
- `n`: **Next** - (in activity view) next split
- `p`: **Previous** - (in activity view) previous split
- `o`: **ToggleSortOrder** - switch between ascending and descending order
- `u`: **ToggleUnitSystem** - switch between imperial and metric units
- `s`: **Sort** - show sort dialog
- `S`: **Rank** - choose ranking
- `f`: **Filter** - filter (see filter section below)
- `r`: **Refresh** - reload activities
- `a`: **Anchor** - show activities with similar routes
- `+`: **IncreaseTolerance** - incease the anchor tolerance
- `-`: **DecreaseTolerance** - descrease the ancor tolerance
- `0`: **ToggleLogView** - toggle log view

## Filter

Press `f` on the activity list view to open the filter input.

### Examples

Show all runs that are of a half marathon distance or more:

```
type = "Run" and distance > 21000
```

Show all runs with "Park" in the title:

```
type = "Run" and title ~ "Park"
```

### Filter activities
### Fields

![image](https://github.com/dantleech/strava-rs/assets/530801/42a5a2e2-0925-4d1f-a780-e1a5d11b0ab1)
*Chronological*
- `distance`: Distance (in meters)
- `type`: `Run`, `Ride` etc.
- `heartrate`: Heart rate in BPM.
- `title`: Activity title
- `elevation`: Elevation (in meters)
- `time`: Time (in seconds, 3600 = 1 hour)

### Details
### Operators

![image](https://github.com/dantleech/strava-rs/assets/530801/633ea4ff-12c8-4ead-817b-80db8efcf61a)
*Detailed Maps*
- `>`, `<`: Greater than, Less than (e.g. `distance > 21000`)
- `and`, `or`: Logical operators (e.g. `type = "Run" and time > 0`)
- `=`: Equal to
- `~`: String contains
- `!=`: Not equal to (e.g. `type != "Run"`)
- `!~`: String does not contain (e.g. `title ~ "Parkrun"`)
2 changes: 2 additions & 0 deletions src/store/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ impl Activities {
("type".to_string(), Evalue::String(a.activity_type.to_string())),
("heartrate".to_string(), Evalue::Number(a.average_heartrate.unwrap_or(0.0))),
("title".to_string(), Evalue::String(a.title.clone())),
("elevation".to_string(), Evalue::Number(a.total_elevation_gain)),
("time".to_string(), Evalue::Number(a.moving_time as f64)),
])) {
Ok(v) => v,
Err(_) => false,
Expand Down

0 comments on commit b46c544

Please sign in to comment.