Skip to content

Commit aa61f0e

Browse files
committed
feat: interactive report + removed generate + submission flow
1 parent 16b6800 commit aa61f0e

File tree

16 files changed

+2474
-1062
lines changed

16 files changed

+2474
-1062
lines changed

README.md

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -196,64 +196,41 @@ hourgit checkout --prev <branch> --next <branch> [--project <project_name>]
196196
| `--next` | Next branch name (required) |
197197
| `--project` | Project name or ID (auto-detected from repo if omitted) |
198198

199-
### `hourgit generate`
200-
201-
Generate editable time entries from checkout history. Materializes checkout-derived time into log entries that you can review and edit before they appear in reports.
202-
203-
**With flags:**
204-
205-
```bash
206-
hourgit generate --today
207-
hourgit generate --week
208-
hourgit generate --month [--year <YYYY>]
209-
hourgit generate --date 2025-06-10
210-
```
199+
### `hourgit report`
211200

212-
**Interactive** — prompted for timeframe:
201+
Interactive time report with inline editing. Shows tasks (rows) × days (columns) with time attributed from branch checkouts and manual log entries. Checkout-derived time is generated in-memory and can be edited, added to, or removed directly in the table. Pressing `s` submits the period, persisting all generated entries.
213202

214203
```bash
215-
hourgit generate
204+
hourgit report [--month <1-12>] [--week <1-53>] [--year <YYYY>] [--project <project_name>] [--output <path>]
216205
```
217206

218207
| Flag | Description |
219208
|------|-------------|
220-
| `-p`, `--project` | Project name or slug (auto-detected from repo if omitted) |
221-
| `--today` | Generate for today |
222-
| `--week` | Generate for the current week (Monday–Sunday) |
223-
| `--month` | Generate for the current month |
224-
| `--date` | Generate for a specific date (`YYYY-MM-DD`) |
225-
| `--year` | Year (used with `--month`) |
226-
| `--yes` | Skip confirmation prompts |
209+
| `--month` | Month number 1-12 (default: current month) |
210+
| `--week` | ISO week number 1-53 (default: current week) |
211+
| `--year` | Year (complementary to `--month` or `--week`) |
212+
| `--project` | Project name or ID (auto-detected from repo if omitted) |
213+
| `--output` | Export report as a PDF timesheet to the given path (auto-named if empty) |
227214

228215
Notes:
229-
- Only one timeframe flag can be used at a time
230-
- Shows a preview of entries to be created before confirming
231-
- If the range has already been generated, prompts to overwrite (deletes old generated entries first)
232-
- Generated entries have `source: "generate"` and use the branch name as the task label
233-
- Days with generated entries are marked as "generated" — `report` skips checkout attribution for those days
234-
- Generated entries are editable via `hourgit edit` like any other log entry
216+
- `--month` and `--week` cannot be used together
217+
- `--year` alone is not valid — it must be paired with `--month` or `--week`
218+
- Neither flag defaults to the current month
235219

236-
### `hourgit report`
220+
**Interactive table keybindings:**
237221

238-
Generate a monthly time report as an interactive table showing tasks (rows) × days (columns). Time is attributed to branches based on checkout events clipped to your configured schedule, with manual log entries shown alongside.
222+
| Key | Action |
223+
|-----|--------|
224+
| ``/``/``/`` or `h`/`l`/`k`/`j` | Navigate cells |
225+
| `e` | Edit selected cell entry |
226+
| `a` | Add a new entry to selected cell |
227+
| `r` or `Del` | Remove entry from selected cell |
228+
| `s` | Submit period (persists all generated entries) |
229+
| `q` or `Esc` | Quit |
239230

240-
```bash
241-
hourgit report [--month <1-12>] [--year <YYYY>] [--project <project_name>] [--output <path>]
242-
```
243-
244-
| Flag | Description |
245-
|------|-------------|
246-
| `--month` | Month number 1-12 (default: current month) |
247-
| `--year` | Year (default: current year) |
248-
| `--project` | Project name or ID (auto-detected from repo if omitted) |
249-
| `--output` | Export report as a PDF timesheet to the given path (auto-named if empty) |
231+
In-memory generated entries (from checkout attribution) are marked with `*` in the table. Editing a generated entry persists it immediately. Submitting persists all remaining generated entries and creates a submit marker.
250232

251-
The table shows:
252-
- Each row is a task (branch name or manual log task/message)
253-
- Each column is a day of the month
254-
- Totals are shown in brackets next to task names
255-
- Use ``/`` arrow keys to scroll horizontally
256-
- Press `q`, `Esc`, or `Ctrl+C` to quit
233+
Previously submitted periods show a warning banner and can be re-edited and re-submitted.
257234

258235
In non-interactive environments (piped output), a static table is printed instead.
259236

0 commit comments

Comments
 (0)