Commit Graph

352 Commits

Author SHA1 Message Date
Evan Simkowitz
a2974a3e6d
Fix escape getting eaten by global event handler (#1668)
The terminal keydown handler was set to filter out all key bindings that
have a registered global handler, regardless of whether they actually
propagated or not. This allowed the global handlers to still work
despite the terminal input having precedence, but it also meant that
global key bindings that were invalid for the current context would
still get eaten and not sent to stdin.

Now, the terminal keydown handler will directly call the global handlers
so we can actually see whether or not the global key binding is valid.
If the global handler is valid, it'll be processed immediately and stdin
won't receive the input. If it's not handled, we'll let xterm pass it to
stdin. Because anything xterm doesn't handle gets sent to the
globally-registered version of the handler, we need to make sure we
don't do extra work to process an input we've already checked. We'll
store the last-handled keydown event as a static variable so we can
dedupe later calls for the same event to prevent doing double work.
2025-01-02 08:38:07 -08:00
Evan Simkowitz
da2291f889
Terminal search (#1654)
This adds support for searching the terminal buffer using the
`@xterm/addon-search` library. It also adds three options for searching:
regex, case-sensitive, and whole-word. These can be included or excluded
from the search options for `useSearch` depending on whether the search
backend supports it.


![image](https://github.com/user-attachments/assets/e0b7e2ed-641b-463f-94a2-f24969fb3b06)

I didn't like any of the Font Awesome icons for these toggles so until
we have time to make some of our own icons that better match the Font
Awesome style, I've appropriated VSCode's icons from their [codicons
font](https://github.com/microsoft/vscode-codicons).

To implement the toggle-able buttons for these options, I've introduced
a new HeaderElem component, `ToggleIconButton`. This is styled similarly
to `IconButton`, but when you hover over it, it also shows a highlighted
background and when active, it shows as fully-opaque and with an
accented border.

Also removes the `useDismiss` behavior for the search box to better
match behavior in other apps.

Also fixes the scrollbar observer from my previous PR so it's wider.
2025-01-01 10:43:02 -08:00
Mike Sawka
91a54442b7
implement web:hidenav (#1639), and file:/// urls (#1638) (#1645) 2024-12-30 16:51:00 -08:00
Evan Simkowitz
477052e8fc
Web Search (#1631)
Adds support for Cmd:f, Ctrl:f, and Alt:f to activate search in the Web
and Help widgets
2024-12-29 09:58:11 -08:00
Evan Simkowitz
93b9432f99
Add support for Google AI models (#1612) 2024-12-27 14:52:38 -05:00
Mike Sawka
73561dc12d
new utility fn, deepCompareReturnPrev. use for settings prefix atom to do a deep equal (#1630) 2024-12-26 11:09:48 -08:00
Evan Simkowitz
b7a5dea0a0
Fix Term Widget not registering pointer events (#1614)
This is a bit janky. The problem is that we were placing the
`xterm-viewport` div, which contains the scroll observer for the xterm
contents, at a higher z-index than the xterm contents, meaning that the
contents couldn't register any pointer events. If we don't put a
z-index, though, the scroll bar can't accept pointer events. To get
around this, I've added two observer divs, which control whether the
contents or the viewport have pointer event priority. The first div, the
`term-scrollbar-show-observer`, sits above where the scrollbar will be
rendered. When the user hovers over it, it will cause the viewport div
to move to a z-index above the contents. It will also enable a second
div, the `term-scrollbar-hide-observer`, which sits above the viewport
and the term contents, but not blocking the scrollbar. When the user
hovers over this div (indicating their mouse has left the scrollbar),
the viewport div is moved back to its original z-index and the hide
observer is set to `display: none`. This gives pointer event priority
back to the contents div.

This resolves an issue where the user could not click links in the
terminal output.

Resolves #1357
2024-12-23 23:35:51 -05:00
Evan Simkowitz
dbacae8a99
Rename outdated WaveAI types (#1609)
A bunch of the Wave AI types still mentioned OpenAI. Now that most of
them are being used for multiple AI backends, we need to update the
names to be more generic.
2024-12-23 10:55:04 -08:00
Evan Simkowitz
4280a0981f
Fix more WaveAI scroll issues (#1597)
This adds a split atom for the messages so that the WaveAI component and
the ChatWindow component don't actually need to watch changes to all of
the messages. This makes the repaining a lot less expensive and makes it
easier to scroll while new messages come in.

I also increased the tolerance on the `determineUnsetScroll` callback so
that the bottom message won't get unattached as easily.
2024-12-20 14:01:19 -08:00
Evan Simkowitz
e0c875afeb
Remove WaveAI dynamic height adjustment, use pure CSS, also fix scrolling (#1594)
This makes the chat window flex-grow so we no longer need to manually
fix its height. It also cleans up some other styling.

It also fixes the scroll handlers so we detect when the user is at the
bottom of the chat window so we can follow the latest message. It also
fixes some circular references in the callbacks that were causing React
to bug out.
2024-12-20 11:49:29 -08:00
Sylvie Crowe
9f9190b93c
fix: dynamically determine the chat window height (#1588)
The AI chat window was not allowing the user to resize it due to an
interacting scss class being removed. This replaces the max-height from
the removed class with a dynamic calculation to resize properly.
2024-12-20 03:18:44 -08:00
Sylvie Crowe
2c5aae1a98
fix: bound code editor font size (#1581) 2024-12-19 14:10:19 -08:00
Mike Sawka
eff12635d7
transparent terminal themes (#1561) 2024-12-19 10:41:28 -08:00
Mike Sawka
95b1767c45
fix terminal escape sequence printing bug (#1544)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved handling of terminal data processing by ensuring it only
occurs when the terminal is fully initialized.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-17 11:55:34 -08:00
Evan Simkowitz
1ba370e4dd
Fix iconbutton styling (#1538) 2024-12-16 18:31:01 -08:00
Sylvie Crowe
71961b373f
Extra Font Size Controls (#1537)
This adds:
- "editor:fontsize" to modify the code editor's font size
- "ai:fontsize" to modify the ai widget's font size (for general text)
- "ai:fixedfontsize" to modify the ai widget's fixed font size (for code
fragments)
2024-12-16 18:23:42 -08:00
Mike Sawka
f1cd6b933d
relative markdown text (#1489) 2024-12-16 16:04:07 -08:00
Mike Sawka
38deb28da5
webview zoom (#1531) 2024-12-16 14:16:21 -08:00
Evan Simkowitz
9ce0093751
Fix errors in loading of help view (#1501)
When clicking on one of the cards from the home page of the docsite and
when initially loading the home page of the docsite, the webviewTag was
emitting a `did-frame-navigate` event, which we weren't tracking. This
meant that we were not properly recording that a navigation had
occurred. This caused three separate issues:

- We were never setting the meta url for the block, which meant that
when you navigated to a different tab or reloaded the app, you'd lose
what page you were last on.
- The site would reload after we fixed a broken docsite url, but we
wouldn't remove the error text that blocks the broken site.
- Clicking on the "open in external browser" button wouldn't do
anything.
2024-12-11 16:09:47 -08:00
Mike Sawka
164c15f1b2
create ref in model, also remove isRunning (#1496) 2024-12-11 12:26:56 -08:00
Evan Simkowitz
7ecdf249bd
Remove some unnecessary logs from webview (#1490) 2024-12-11 10:39:12 -08:00
Evan Simkowitz
6684a5c2b8
Only call WebViewModel.handleNavigate for main frame navigations (#1488)
Navigation events are issued not just for main page navigations, but
also for iframes, among other things. With our old behavior, if an
iframe tries to load in a webpage, we would update the webview url and
make the iframe the primary page, which is wrong. Now, we only do this
for main frame navigations.

closes #1487
2024-12-11 10:33:37 -08:00
Evan Simkowitz
c95f3b2283
Fix unawaited promises in dir preview (#1474) 2024-12-10 15:13:11 -08:00
Sylvie Crowe
e49480e628
Fix Preview for Uninitialized Connections (#1473)
If a connection had not been previously initialized, selecting it in the
preview dropdown was bug-prone. This ensures the connection is complete
before checking the mimetype and selecting the type of preview.
2024-12-10 15:03:35 -08:00
systemshift
c071cc04c3
Perplexity api (#1432)
I have added Perplexity to the default AI models. I see Anthropic models
are becoming part of the default as well, so I thought I should add a
model that is specific for web search.

This pull request is a work in progress; reviews and edit
recommendations are welcome.

---------

Co-authored-by: sawka <mike@commandline.dev>
2024-12-09 15:48:33 -08:00
Mike Sawka
ac8dc25ead
fix block controller status (add version) (#1430) 2024-12-06 19:39:58 -08:00
Evan Simkowitz
7a61f25331
Auditing async usage in frontend code (#1402)
I found a lot of places where asyncs weren't being properly wrapped or
awaited
2024-12-05 18:09:54 -08:00
Evan Simkowitz
cb50023d79
Fix issue where WaveAI text area would resize on launch (#1397) 2024-12-05 14:06:52 -08:00
Sylvie Crowe
b4b0222c9d
New Connections Configs (#1383)
This adds the following connections changes:
- connections can be hidden from the dropdown in our internal
connections.json config
- `wsh ssh` -i will write identity files to the internal
connections.json config for that connection
- the internal connections.json config will also be used to get identity
files when connecting
- the internal connections.json config allows setting theme, fontsize,
and font for specific connections
- successful connections (including those using wsh ssh) are saved to
the internal connections.json config
- the connections.json config will be used to help pre-populate the
dropdown list
- adds an item to the dropdown to edit the connections config in an
ephemeral block

---------

Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com>
2024-12-05 10:02:07 -08:00
Mike Sawka
72f36a9639
wsh run (#1376)
implements `wsh run` command.  lots of fixes (and new options) for command blocks.  cleans up the UX/UI for command blocks.  lots of bug fixes for blockcontrollers.  other minor bug fixes.

also makes editor:* vars into settings override atoms.
2024-12-04 14:16:50 -08:00
Evan Simkowitz
d8edea9fbc
Oops i actually made the tabs wrong (#1384)
forgot to update .editorconfig to include scss...
2024-12-04 13:49:14 -08:00
Evan Simkowitz
0145e8fe99
Fix SCSS formatting after migration (#1382)
The migration tool we used didn't take into account our formatting
standards so I'm bulk-formatting the SCSS files to bring them back up to
our standards. Basically this just changes the tab size for all the
files.
2024-12-04 12:49:44 -08:00
Evan Simkowitz
60031ef8c0
Add Save and Cancel buttons to dir preview entry manager (#1381) 2024-12-04 11:48:26 -08:00
Evan Simkowitz
04c4f0a203
Create and rename files and dirs in dirpreview (#1156)
New context menu options are available in the directory preview to
create and rename files and directories

It's missing three pieces of functionality, none of which are a
regression:
- Editing or creating an entry does not update the focused index. Focus
index right now is pretty dumb, it doesn't factor in the column sorting
so if you change that, the selected item will change to whatever is now
at that index. We should update this so we use the actual file name to
determine which element to focus and let the table determine which index
to then highlight given the current sorting algo
- Open in native preview should not be an option on remote connections
with the exception of WSL, where it should resolve the file in the
Windows filesystem, rather than the WSL one
- We should catch CRUD errors in the dir preview and display a popup
2024-12-02 22:23:44 -08:00
Mike Sawka
b6ce2cd022
misc v0.9.3 fixes -- numToString, block counts, fix docsite images/video (#1354) 2024-11-25 18:07:29 -08:00
Evan Simkowitz
2e91ee843c
Switch from Less to Scss (#1335)
Less hasn't received an update in over a year and the parser is missing
some modern syntax like relative colors so this switches us to scss
2024-11-21 16:05:04 -08:00
Mike Sawka
b2b9432a7a
fix terminal theming when applying global defaults #1287 (#1332) 2024-11-21 10:44:16 -08:00
Mike Sawka
9c6eed1ab4
add globaleventtype to globalkeys (#1296) 2024-11-15 09:56:54 -08:00
Mike Sawka
c4d7779003
wsh ai file attachments -- renderer in waveai (#1281) 2024-11-14 16:20:33 -08:00
Evan Simkowitz
2dfdf66169
Opening HelpView pages in external browser uses the public docsite equivalent (#1289)
Before, when you clicked the "Open in External Browser" button from the
`HelpView`, the browser would attempt to open the embedded url, which
may or may not still exist, depending on whether the content was cached
from the last time the app was opened (since the embedded docsite uses a
random port). Now, we'll swap the embedded url for the public docsite
equivalent when you open in an external browser.
2024-11-14 11:03:10 -08:00
Evan Simkowitz
d38f889bd6
Add tooltip for clear chat history (#1276) 2024-11-13 18:02:47 -08:00
Evan Simkowitz
3fcf209b52
Add ephemeral block support (#1275)
Ephemeral blocks can now be added to the LayoutModel for a tab. Only one
ephemeral block can exist at a time. It is placed above all other
blocks, including the magnified blocks.

Updates how magnified and ephemeral blocks overlay the other blocks.
Now, there's a blurred backdrop behind them that will obscure the other
blocks. As a result of this, the overlayed blocks are now translucent.
2024-11-13 18:00:13 -08:00
Sylvie Crowe
31d0aa114d
AI Clear Button (#1274)
Adds a button and Cmd:l keybinding to clear the ai message history in
the current block
2024-11-13 15:00:33 -08:00
Sylvie Crowe
d96542f691
Rerun Command Button (#1265)
Adds a button in widgets with a "cmd" controller that allows the command
to be rerun without accessing a context menu.
2024-11-11 15:30:40 -08:00
Mike Sawka
3fc45c63f3
vdom terminal toolbar (#1263) 2024-11-11 13:11:09 -08:00
Mike Sawka
de902ec2b7
ai backend refactor + claude/anthropic API support (#1262) 2024-11-11 11:39:08 -08:00
Mike Sawka
045405aa5e
new wsh ai command (#1257) 2024-11-08 16:34:50 -08:00
Mike Sawka
58f2f4ae8e
fix display order sort (#1256) 2024-11-08 15:46:44 -08:00
Mike Sawka
f50ce9565c
VDom 11 (#1224)
* Fix VDom url caching -- use regular requests 
* new boilerplate to make writing apps easier
* render-blocking global styles (to prevent render flash)
* bug fixes and new functionality etc.
2024-11-07 00:07:23 -08:00
Mike Sawka
42e85aea6f
VDom 10 (#1206)
* get RefOperations and RefUpdates working. 
* implement a <canvas> API that can be called using RefOperations
* prop to disable rehype/markdown (memory leak)
2024-11-05 23:07:45 -08:00