Commit Graph

50 Commits

Author SHA1 Message Date
David Dworken
6575c8ae42
Fix handling of new lines in commands for #163 (#170)
* Fix handling of new lines in commands for #163

* Move code for table from lib.go to query.go

* Update goldens
2024-02-06 20:04:21 -08:00
David Dworken
4b93240948
Log OpenAI error to debug log for #167 2024-02-05 21:34:03 -08:00
David Dworken
a3f1282368
Add ability to configure a default filter (for #76) (#161)
* Add ability to configure a default filter (for #76)

* Add test for color of default filter

* Add basic test for default filter

* Add goldens for tests

* Add more tests for default filters

* Update goldens

* Add another golden

* Update goldens

* Remove debug log

* Add golden to allowlist

* Update goldens
2024-01-07 21:06:22 -08:00
David Dworken
77313dfb48
Add better color support detection, for #134 2023-12-31 13:00:56 -08:00
David Dworken
30f94c1c78
Fix broken custom color scheme support as reported in #134 2023-12-28 19:25:09 -08:00
David Dworken
3c33513fa3 Improve logic for padding for highlighting search queries to fix off-by-one error that happens when there are no matches 2023-12-20 14:56:09 -08:00
David Dworken
8b7e54eab4
Add support for configuring the TUI color scheme, for #134 (#146)
* Add support for configuring the TUI color scheme, for #134

* Add tests for getting and setting the custom color scheme, and support full colors where terminals support them

* Add comments to document termenv.ANSI setting, and fix tests so they work uniformly
2023-12-18 20:32:11 -08:00
David Dworken
2d2c393bf9
Fix TUI code that tracked whether a search query is pending so it doesn't show the pending message when no query is pending 2023-12-09 15:51:04 -08:00
David Dworken
a26fc5b360
Add more special handling for extra tiny terminals (#140)
* Add more special handling for extra tiny terminals

* Add tests for extra compact terminals
2023-12-06 16:12:41 -08:00
Ben
c8643d5a2b
Filter duplicates with map (#139)
The previous method of filtering duplicates only worked on duplicates that occurred consecutively. Since dupes happen out of order often, this switches the logic to instead use a map of seen commands and filter based on that.
2023-12-05 21:43:01 -08:00
David Dworken
8b83e2bbb5
Improve vertical sizing for small terminals, fixes #137 (#138)
* Improve vertical sizing for small terminals, fixes #137

* Add tests for tiny terminals + update test goldens for tiny terminals after compact sizing
2023-12-03 21:56:45 -08:00
David Dworken
bdaf0f8a65
Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table (#136)
* Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table

* Update TUI goldens for more accurate TUI sizing

* More golden updates for wider table sizing

* Include failed test goldens as artifacts for easier test fixing on github actions
2023-12-03 13:15:38 -08:00
David Dworken
af8ace69dd Add loading spinner for slow searches, primarily to benefit AI queries since they are quite slow 2023-11-21 05:53:10 +01:00
David Dworken
0be6fe9724
Swap AI completions to be behind a dedicated config option and add docs on it 2023-11-12 03:09:56 -08:00
David Dworken
dd6cf710c7 Remove outdated TODO 2023-11-12 02:57:23 -08:00
David Dworken
0ea3ce2399 Add basic debouncing for AI integration + implement AI suggestions via hishtory API endpoint 2023-11-12 02:57:23 -08:00
David Dworken
eb835fe52c Add initial version of AI searching, but with a broken implementation of debouncing 2023-11-12 02:57:23 -08:00
David Dworken
19b9f67724
Fix bug with automatic cd-ing where quoting the directory caused tildes to not get expanded into the user's homedir 2023-11-06 21:39:01 -08:00
David Dworken
e1f69f8731
Add TODO 2023-11-06 18:44:28 -08:00
David Dworken
588e2f4405
Fix bug where cd-ing wouldn't work if the changeDir contained a space 2023-11-01 18:03:14 -07:00
David Dworken
a6e6f6504c
Remove TODO that is out of date 2023-10-28 15:13:24 -07:00
David Dworken
00129a5372
Add extra new lines to fix warnings ending up on the same line 2023-10-25 20:26:41 -07:00
David Dworken
93cffd98b4
Replace e50f4d164 with query IDs so that we properly handle deletions. See e50f4d164 for full details on the bug that this fixes. 2023-10-25 20:07:09 -07:00
David Dworken
e50f4d164b
Fix race condition in TUI code for handling async queries
If someone types in "l" and then "s" to search for "ls", then this will dispatch two async queries. If the query for "l" finishes after the query for "ls", then this will lead to the results for "l" getting incorrectly displayed. In practice, this is quite rare for human typing speeds so I had never noticed this. But, it causes an issue for test flakes and is the root cause of many of my recent changes around test flakes. Fixing this should improve test reliability significantly.
2023-10-24 22:52:52 -07:00
David Dworken
4bcc5fb335
Periodically call query endpoint and retrieve data to ensure that the local DB is always reasonably up to date 2023-10-15 12:29:50 -07:00
David Dworken
1c4fe0d379
Add TODO 2023-10-14 17:30:12 -07:00
David Dworken
fca2b1441f
Always include user and device ID in API request headers, so that they're available in all server-side handlers 2023-10-14 10:52:51 -07:00
David Dworken
253ad7f6b6
Bold matches for search queries in TUI for #112. This was previously available behind the beta-mode flag, but will now be enabled by default 2023-10-12 19:34:09 -07:00
David Dworken
3efe62401c
Change semicolon to && so that if the cd fails, the command doesn't run. Per feedback on #83 2023-10-06 16:49:50 -07:00
David Dworken
0b57034c39
Revert "Revert all commits since v0.223 to enable me to release a patch on top of v0.223"
This reverts commit 68ed9f2d5d.
2023-09-29 18:21:23 -07:00
David Dworken
68ed9f2d5d
Revert all commits since v0.223 to enable me to release a patch on top of v0.223 2023-09-28 22:15:30 -07:00
David Dworken
06ee1bd6fe
Add comments/clean up TUI highlighting code 2023-09-28 22:14:30 -07:00
David Dworken
e04583f62f
Move regexp compilation out of render function so it isn't run once for every single cell 2023-09-28 22:14:15 -07:00
David Dworken
3feb267038
Remove debug log statements 2023-09-28 22:14:11 -07:00
David Dworken
beb907d59e
Add bolding of matching search results for #112, currently behind the beta-mode flag 2023-09-28 22:13:11 -07:00
David Dworken
ec44e94565
Fix NPE that occurs if the initial sqlite query is slow, the user starts typing, and then the latter query is faster and completes first, by forcing an update of the table if it is nil before calling SetRows() on it 2023-09-28 21:52:00 -07:00
David Dworken
6d5a86a8bb
Revert all commits since v0.223 to enable me to release a patch on top of v0.223 2023-09-28 21:49:37 -07:00
David Dworken
6d95b759f6
Add comments/clean up TUI highlighting code 2023-09-24 18:06:32 -07:00
David Dworken
d2fec54ec0
Move regexp compilation out of render function so it isn't run once for every single cell 2023-09-24 17:19:51 -07:00
David Dworken
5a70a3b776
Remove debug log statements 2023-09-24 17:18:56 -07:00
David Dworken
0f375aacfc
Add bolding of matching search results for #112, currently behind the beta-mode flag 2023-09-24 15:57:39 -07:00
David Dworken
1d878195b2
Rework ff98a7907c to use the newly added EntryId column rather than deleting based on the start time 2023-09-22 14:03:41 -07:00
David Dworken
2a5a6d65c4
Roll-forward "Add preliminary support for persisting pre-saved history entries remotely"
This rolls-forward commit 66916c27cb.
2023-09-22 13:13:46 -07:00
David Dworken
66916c27cb
Revert "Add preliminary support for persisting pre-saved history entries remotely"
This reverts commit ff98a7907c. That commit is incomplete since it doesn't include support for the continous deletion of pre-saved history entries as soon as they
finish running. Support for this will require a good bit more work/thought, so reverting for and keeping this code in the git history.
2023-09-21 12:39:20 -07:00
David Dworken
ff98a7907c
Add preliminary support for persisting pre-saved history entries remotely 2023-09-21 12:39:04 -07:00
David Dworken
216803f325
Bring back logic that was removed in c9da7a10e4 that made it so invalid initial search queries will get replaced with a query for the empty string 2023-09-18 22:21:10 -07:00
David Dworken
c9da7a10e4
Make the initial search query for the TUI async so that the UI opens immediately, so that user's can start typing their query without any delay 2023-09-18 19:35:53 -07:00
David Dworken
48e33d5034
Make the query input box in the TUI match the terminal dimensions 2023-09-14 21:14:16 -07:00
David Dworken
9fcdb7f960
Add TODO for tui UX improvement 2023-09-14 20:40:35 -07:00
David Dworken
e8ceb02138
Move tui.go out of lib and into a separate package 2023-09-13 22:47:48 -07:00