Commit Graph
1488 Commits
Author SHA1 Message Date
l0ng-ai cd2971682f Merge branch 'ide/multicursor' into feat/editor-ide 2026-09-28 18:22:55 +08:00
l0ng-ai 69888a52ef test(nav): spell out LineEdit's new at_line_start field
gpui-component's LineEdit now records an insertion at column 0, which
moves the whole line down. The literal edits in this test are mid-line.
2026-09-28 18:22:32 +08:00
l0ng-ai d95fc3442f fix(lsp): owner-only sync, stale-edit checks, request timeouts, re-enable
- Only the buffer that owns a document may use its server. The same file
  open in another window used to send its own text as didChange on F12,
  rename, references or signature help, swapping the document under the
  owner. LspStore::context now takes the requester and refuses a
  non-owner quietly, before anything is sent.
- apply_workspace_edit checks every open buffer an edit touches against
  a baseline: the texts when a rename was asked for or the code-action
  menu was filled, or the text the server last heard for its own
  workspace/applyEdit (which then answers applied: false). A buffer typed
  in, opened or closed since means nothing is applied.
- A request made after the server's output closed fails at once instead
  of waiting forever. Requests time out after 10 s (initialize after 60 s,
  shutdown after 2 s) and cancel themselves on the server.
- Turning editor_lsp back on asks every window for its open files again,
  which starts their servers. Windows register how to be asked; closed
  ones are forgotten.
2026-09-28 18:18:55 +08:00
l0ng-ai e95f7682fd fix(editor): forget a swept orphan buffer's navigation state
The orphan sweep dropped clean buffers without calling forget_buffer, so
each one's outline cache (a full copy of its text), LSP symbols and
edit-log cursor stayed in EditorNav for the life of the window.
2026-09-28 18:05:53 +08:00
l0ng-ai 699b262ee4 fix(editor): restore a split whose left group had no recorded files
The recorder writes files: [] with a split when the left group held only
untitled or remote buffers, but restore returned early on an empty left
list and dropped the right group too.
2026-09-28 18:05:32 +08:00
l0ng-ai 4b7def2d74 fix(lsp): close a window's documents when the window closes
Documents were only closed by sync_window, which runs when a window's
buffer set changes. Closing a window never ran it, so no didClose was
sent, the idle shutdown never started, and a language server lived on
until quit (forever, with the app retired to the tray).
2026-09-28 18:03:05 +08:00
l0ng-ai 9aec58688b Merge branch 'ide/nav' into feat/editor-ide
# Conflicts:
#	src/ui/app.rs
#	src/ui/code_editor.rs
#	src/ui/code_editor/nav.rs
#	src/ui/search/command.rs
2026-09-28 17:55:26 +08:00
l0ng-ai 54c1f9c0b7 test(keymap): the editor group chords win inside the editor 2026-09-28 17:54:46 +08:00
l0ng-ai 467da40a95 feat(editor): split the editor into two groups
Cmd-\ (Ctrl-\ off macOS, bound only inside the editor so the terminal keeps
SIGQUIT) opens the file in front in a second group on the right. Each group
has its own file in front and, for different files, its own caret and
scroll; Cmd-Alt-Left/Right (Ctrl-Alt off macOS) or a click moves the focus
between them, and a group whose last file closes goes away. The split is
saved with the tab's other editor state.

The focused group is always TabCode's own files/active and the other waits
beside it, so everything that acts on the file in front - saving, go to
line, language servers, change markers, multiple cursors, history - follows
the focus unchanged. A file shown in both groups is drawn once, in the
focused one; the other shows a placeholder that brings the focus over. A
second InputState kept in sync would have needed every hook attached twice.

Also: palette rows and View menu items for Go to Symbol, Back, Forward and
Split; Cmd-Shift-O closes Go to Symbol when it is open; the status bar no
longer repeats the path the breadcrumbs show (a rendered Markdown file keeps
its breadcrumb path); change markers are kept current in both groups.
2026-09-28 17:54:04 +08:00
l0ng-ai e53e9d539b Merge branch 'ide/lsp' into feat/editor-ide
# Conflicts:
#	src/core/actions.rs
#	src/ui/keymap.rs
2026-09-28 17:50:58 +08:00
l0ng-ai 6f033156d9 Merge branch 'ide/editing' into feat/editor-ide 2026-09-28 17:50:19 +08:00
l0ng-ai 0d1922ea90 feat(editor): text commands in the palette and keymap
Transform to Upper/Lower/Title Case, Trim Trailing Whitespace, Join Lines
and Remove Surrounding Brackets, as tty7 actions (bindable on the
Keybindings page, unbound by default) and as palette rows offered while a
buffer is open. Both run gpui-component's editing action on the active
buffer. Join Lines gets VS Code's ctrl-j as a fixed CodeEditor binding on
macOS, where the terminal keeps it as a line feed. Strings in en, zh, ja.
2026-09-28 17:49:56 +08:00
l0ng-ai 5cf9ca6897 feat(lsp): outline, references, workspace symbols, signature help
- documentSymbol feeds the editor's outline (breadcrumbs, Go to Symbol)
  through editor_set_document_symbols, refreshed 500 ms after typing
  pauses. Flat answers are nested by range; an empty answer from a server
  still indexing leaves the tree's outline in place.
- Find All References (shift-F12) and a definition with several answers
  open a Locations tab in the search. Arrowing through it previews a place
  in the file in front, and Return goes there, into any file.
- Go to Symbol in Workspace (secondary-T inside the editor) asks the
  server's workspace/symbol as the query is typed, into the same list.
- Completion items are resolved for their documentation and auto-import
  edits, which are applied on accept (with the gpui-component fork).
- Signature help opens on the server's trigger characters (or on '(' and
  ','), stays current while typing in the call, and closes when the server
  says the cursor has left it or on Escape.
- Diagnostics are replaced wholesale on publish; between publishes the
  fork now carries them through edits instead of dropping them.
- workspace/configuration answers from per-server settings, with an empty
  object for a section tty7 sets nothing for. rust-analyzer gets
  checkOnSave with cargo check, also as initializationOptions, and every
  server gets didChangeConfiguration after initialized.
2026-09-28 17:49:55 +08:00
l0ng-ai eff1ee7359 Merge branch 'ide/gutter' into feat/editor-ide 2026-09-28 17:48:25 +08:00
l0ng-ai 734ceb5d1a feat(editor): Problems list, keyboard change peek, Editor settings
- Problems: every error, warning and note the language servers published
  for the open files, grouped by file, at the foot of the code panel.
  The status bar's counts and ToggleEditorProblems (Cmd/Ctrl+Shift+M)
  open it; a row opens its file at the line and column. Read through a
  new LspStore::diagnostics_snapshot, mapped to editor columns.
- EditorPeekChange (Alt+F3 in the editor) peeks the change under the
  caret, or goes to the next one. The peek now takes the keyboard from
  a click too: Enter reverts, Escape closes and hands focus back.
- Settings > General gains an Editor group: git change markers,
  language servers, soft wrap and rendered Markdown, searchable and
  resettable like every other row.
2026-09-28 17:47:59 +08:00
l0ng-ai ebbeaaca60 feat(editor): history follows edits, and paging is not a jump
Places in the back/forward history now move with lines inserted or deleted
above them, read from the editor's line-edit log on every change. The caret
move a Page Up/Down, paste, undo or redo makes is heard through the
keystroke that caused it and is not recorded as a jump.
2026-09-28 17:36:44 +08:00
l0ng-ai 6012b4d82c fix(keymap): route cmd-K cmd-D to the code editor's skip-occurrence
The chord starts with ClearScrollback's key on macOS, and gpui drops a
pending chord that ranks below a complete match, so the fork's binding
never got its second key. Re-add it after tty7's table, in the CodeEditor
context only, so other text fields don't wait on cmd-K.
2026-09-28 17:36:18 +08:00
l0ng-ai 59ea010347 Merge branch 'ide/editing' into feat/editor-ide
# Conflicts:
#	src/ui/code_editor.rs
#	src/ui/keymap.rs
2026-09-28 17:20:38 +08:00
l0ng-ai 367b44b4f8 Merge branch 'ide/nav' into feat/editor-ide
# Conflicts:
#	src/ui/code_editor.rs
#	src/ui/keymap.rs
2026-09-28 17:20:29 +08:00
l0ng-ai bc55dba11d Merge branch 'ide/gutter' into feat/editor-ide
# Conflicts:
#	crates/tty7-core/src/core/config.rs
#	src/core/actions.rs
#	src/ui/code_editor.rs
#	src/ui/keymap.rs
2026-09-28 17:20:16 +08:00
l0ng-ai e20e42aef7 fix(keymap): let the code editor's line commands beat the app's chords
The editor binds toggle comment, move/copy/delete line, insert line, select
line and go-to-bracket on its CodeEditor key context. A context-free app
binding ranks as deep as the focused context and wins the tie by being
added later, so ⌘/ (shortcut sheet), ⌘↵ (fullscreen), ⌘⇧↵ (maximize) and,
off macOS, ⌥↑/⌥↓ (pane focus) took those keys inside the editor. Re-add
them in fixed_bindings on CodeEditor, which only a multi-line code editor
declares, so plain text fields and the terminal keep the app's keys.
2026-09-28 17:19:06 +08:00
l0ng-ai b2697bc05b test(keymap): the editor's navigation chords win inside the editor, not in a terminal 2026-09-28 17:18:55 +08:00
l0ng-ai d52774c6b6 Merge branch 'ide/lsp' into feat/editor-ide
# Conflicts:
#	src/ui/keymap.rs
2026-09-28 17:18:38 +08:00
l0ng-ai 4f8c4dfabe fix(editor): clear the change markers when the file loses its base
A file that becomes untracked or leaves its repository kept the markers
of its last diff; clear them when the base goes away. Guard the base read
against a panic, which would otherwise leave the fetch flagged forever,
and test the read against a real repository: the base is the staged
version, and untracked files have none.
2026-09-28 17:18:34 +08:00
l0ng-ai 5003c4d733 feat(editor): language servers for the code editor
A new ui::lsp module runs language servers for local files the editor
opens: rust-analyzer, typescript-language-server, pyright (or pylsp),
gopls and clangd, from a registry table. Each server is keyed by
(server, project root), found from markers such as a Cargo workspace,
package.json, go.work/go.mod or pyproject.toml, and shared by every buffer
under that root. A server missing from PATH (which tty7 already fills from
the login shell) means no LSP for that language and a one-line hint in the
status bar.

The JSON-RPC client frames Content-Length messages over the server's stdio
on dedicated threads, holds everything back until initialize is answered,
cancels requests nobody waits for any more, and answers the server's own
requests (configuration, capability registration, applyEdit). Documents
use full-text sync, debounced, and flushed before every request. A server
whose last file closed shuts down after a grace period, every server exits
with the app, and one that crashes is restarted a few times before it is
left down.

Features: diagnostics as underlines with hover messages and an error and
warning count in the status bar; completion (snippets flattened to plain
text); hover; go to definition by secondary-click or F12, across files
through open_file_in_editor_at; code actions on the editor's own menu
(cmd-.), resolved and executed as the server needs; Format Document
(shift-alt-f); and Rename Symbol (F2) in the editor's bar, applied to open
buffers and to files on disk. The key bindings sit in the Input context so
F2 and F12 stay with terminal programs.

Positions are converted at the boundary: servers count UTF-16 units,
gpui-component counts chars, and the rope counts bytes.

The new editor_lsp setting (default on) turns it all off.
2026-09-28 17:17:27 +08:00
l0ng-ai cc36fdb3f6 Merge branch 'feat/editor-ide' into ide/editing 2026-09-28 17:16:58 +08:00
l0ng-ai 58bf076d0f feat(editor): line commands in the editor's right-click menu
Toggle Comment, Move Line Up/Down, Duplicate Line, Delete Line and Go to
Matching Bracket, dispatched to gpui-component's new editing actions so
each row shows its chord. Strings in en, zh and ja.
2026-09-28 17:16:58 +08:00
l0ng-ai 9edc824f80 feat(editor): bind next/previous change to Alt+F5 in the code editor
Bind EditorNextChange / EditorPrevChange to alt-f5 / shift-alt-f5 in the
Input context only, after tty7's own table, so a terminal never loses the
function key. Mark the hunks stale right after a revert, before the
input's Change event lands, and cover the whole loop (markers, stepping,
revert as one undo) with a window test.
2026-09-28 17:16:16 +08:00
l0ng-ai 4f88bcb95f Merge branch 'feat/editor-ide' into ide/nav 2026-09-28 17:15:37 +08:00
l0ng-ai ec5aee0f0c feat(editor): go to symbol, breadcrumbs, and back/forward navigation
Go to Symbol (Cmd-Shift-O in the editor) lists the file's outline on a new
Symbols tab of Search Everywhere: indented by nesting while browsing, ranked
flat with the containing symbols as a subtitle while searching. Arrowing
through the rows previews each symbol; Escape puts the caret and the scroll
back, Return keeps it.

The outline comes from the tree the highlighter already parsed, with a small
query per language (Rust, Go, Python, JavaScript, TypeScript/TSX, C, C++,
Java, Markdown, Ruby, shell). Tty7App::editor_set_document_symbols lets a
language server's documentSymbol answer replace it per buffer.

A breadcrumb row over the text shows the file's path from its project root
and the symbols around the caret; the symbols open Go to Symbol.

Back and forward (Ctrl-- / Ctrl-Shift-- on macOS, Alt-Left/Right elsewhere)
walk a per-tab history. Jumps are noticed by sampling the caret whenever the
editor draws: a change of file, or a move of ten lines or more without an
edit, records where the caret was. Quick open, go to line, file links and
anything that goes through open_file_in_editor_at are therefore captured
without hooks of their own; a place in a closed file reopens it.
2026-09-28 17:15:33 +08:00
l0ng-ai 5c5f2e13d4 Merge branch 'feat/editor-ide' into ide/gutter 2026-09-28 17:13:21 +08:00
l0ng-ai 3f4388d4dc feat(editor): git change markers in the gutter
Diff each buffer against its file's index version (what VS Code's quick
diff and the SCM panel's Changes compare with) and hand the hunks to the
editor as gutter markers: added, modified, and a wedge where lines were
deleted. The base is read with `git show :./name` through the buffer's own
host, so remote workspaces work too; SFTP buffers and untracked files get
no markers. It is re-read when the repository's SCM epoch moves, on save
and when the path changes; the diff itself is a line-level Myers diff run
off the UI thread shortly after each edit.

Next/previous change and Revert Change (one undo step, also in the
right-click menu) are commands; clicking a marker opens a peek of the
staged lines with a Revert button. The editor watch now also follows the
repository the gutter found, so a stage or checkout refreshes the markers.
The `editor_git_gutter` config (default on) is flipped by the
ToggleEditorGitGutter command.
2026-09-28 17:12:45 +08:00
l0ng-ai 08d4ab9afd feat(editor): show the selection count in the status bar
With several cursors the Ln/Col readout (the primary caret's) is followed
by "(N selections)".
2026-09-28 17:09:47 +08:00
l0ng-ai de9d2c8f62 fix(keymap): let the code editor's multi-cursor chords beat the pane keys
gpui-component now binds secondary-d, secondary-shift-l and
secondary-alt-up/down in the Input context for multiple cursors. A
context-free binding ranks as deep as the focused context and ties go to
the one added last, so tty7's SplitRight and FocusPaneUp/Down took those
keys inside the editor. Re-add the editor bindings after tty7's table; other
text fields have no handler for them and fall through to the pane keys.
2026-09-28 17:09:47 +08:00
LiuSirandstevelliu e06ba47017 feat(tabs): name the agents you run in the New Tab menu (#994)
The + menu lists up to three agents that have actually been run, beside
Local and SSH. Other Agents… opens Search Everywhere already filtered to
agent. New Agent Tab still starts the one used last.

Refs #955

Co-authored-by: stevelliu <stevelliu@tencent.com>
2026-09-28 16:31:39 +08:00
l0ng-ai 18109018ce docs: add a landing page with a live v5 demo
The docs root becomes a custom-mode landing page modelled on the Claude
Design "Terminal Redesign v5" window. The hero is an HTML/CSS rebuild of
that window that autoplays five chapters taken from the promo storyboard:
agent status and notifications, one agent driving another through the
tty7 CLI, the editor prompt, Search Everywhere, and sessions outliving
the window. It follows the docs light/dark theme and pauses off screen.

Agent avatars use the app's own marks and brand colours (CLIAgent::
accent_rgb / icon_path), and status dots use AgentStatus::dot_rgb.

The previous introduction moves to /introduction, and the navbar logo
now links to the landing page instead of GitHub. All landing-page CSS
is scoped under .t7h / .t7w, since Mintlify loads it on every page.
2026-09-28 15:14:30 +08:00
l0ng-ai 2a9c662ad5 docs(readme): cover the side panel, tab hibernation and session resume; resync the Chinese README 2026-09-28 14:41:00 +08:00
l0ng-ai 33d7da60f9 fix(sidebar): even group spacing, a pin icon, and a menu under the tabs
The rule between kept and derived groups sat in the list as a child of
its own, between two GROUP_GAPs, so kept groups stood more than twice as
far from the rest as groups stand from each other. It now takes up the
one gap instead of adding another.

The kept-group mark is a drawn pin rather than a diamond glyph, on the
header and on the pin button an auto header shows on hover.

Right-clicking the empty sidebar under the tabs did nothing. The room
below the last row now opens New Tab and New Group.
2026-09-28 14:00:50 +08:00
l0ng-ai 4e8a76261b fix(terminal): call the right-click menu's clear item just Clear 2026-09-28 13:45:04 +08:00
l0ng-ai ee817bae01 feat(ui): v5 modal cards, and an IME crash fix in the code editor (#993)
* fix(deps): gpui-component keeps highlight boundaries on char boundaries

Typing Chinese through the IME in the code editor could panic the app:
after a sync parse ran past its 2ms budget, the stale injection layers
put a style boundary inside the committed glyph and the text system split
the line mid-character. Debug builds miss the budget often enough to hit
it; the fork now snaps every style range to the current text.

* feat(ui): bring the modal cards onto the v5 design

- Confirmations take v5's alert shape: title and detail as one
  paragraph, answers beneath, no header row or footer rule, 360px wide
  and set lower, at eye height.
- Dialog buttons take the field's 7px corner and 14px padding; a
  secondary answer rests on the well's faint fill instead of bare text.
- The scrim dims rather than blacks out: 45% dark, 14% light.
- The New Workspace form joins the other cards: 12px corner, borderless
  wells for its fields, an esc cap and the shared 40px footer.
2026-09-28 13:35:53 +08:00
l0ng-ai f647a19746 feat(editor): draw the editor's right-click menus like the rest of the window (#992)
* feat(editor): draw the editor's right-click menus like the rest of the window

The text's menu was gpui-component's native OS menu: another font and
material, no shortcuts, and Go to Definition / Show Code Actions that no
language server ever enables. It is now a PopupMenu with Attach to Agent
(the selected lines ride along as #L3-9), Undo/Redo, the clipboard,
Find, Go to Line, and the file's own items: Open in Browser for web
files or Open with Default App, Reveal, Copy Path, Copy Relative Path.

The file tabs get a menu too: Close, Close Others, Close to the Right,
and the same file items. Closing several asks once about unsaved edits.

* chore(deps): gpui-component moves the caret on right-click under a host menu
2026-09-28 13:35:15 +08:00
ARNO 643e0f7d95 feat(agents): add Qoder CN CLI integration (#988)
* feat(agents): add Qoder CN CLI integration

* fix(agents): spell Qoder CN's config override QODERCN_CONFIG_DIR

The China build of Qoder resolves its configuration through QODERCN_CONFIG_DIR.
The first pass invented QODER_CN_CONFIG_DIR instead, so an install that set the
real one was treated as unrelocated: hooks went to ~/.qoder-cn and history was
scanned from a directory the CLI never writes to. The test that should have
caught it set the same invented name, so it only proved the name agreed with
itself.

Picks up the rest of the review as well — detect the `qoder-cn` dispatcher
beside the other two binaries, call it the mainland-China build rather than a
different vendor, and drop the QODER_CN_HOOK_EVENTS alias for the table it only
pointed at. The serialized enums keep their variants appended; only the
independent ALL arrays moved QoderCLICn next to QoderCLI.
2026-09-28 13:35:10 +08:00
l0ng-ai 388ddf4303 fix(search): label the search entry point "Search…" (#990)
"Everywhere" added nothing: the modal's tabs already say what it covers.
2026-09-28 13:35:06 +08:00
e94c0d39cb fix(path): read the interactive shell's PATH, not just the login shell's (#989)
* fix(path): read the interactive shell's PATH, not just the login shell's

The GUI starts with launchd's bare PATH and refills it by running the login
shell. A login shell reads .zprofile/.bash_profile and never .zshrc/.bashrc,
so every directory exported there was invisible to the app: agent quick
launch found only what /opt/homebrew/bin and /usr/local/bin happened to hold,
and an agent_launch override could not bring a missing program back, since
the override's program is looked up on the same PATH.

Probe with -i as well (fish unchanged: it reads its config in every mode) and
take the last non-empty line, so an rc that prints a greeting above the
echo $PATH cannot be mistaken for the value.

* fix(path): bound the interactive PATH probe and bracket its output

Running .zshrc/.bashrc on the startup path needs guards the login-only
probe could do without:

- Read the PATH between markers instead of the last line, so an exit
  hook that prints after it cannot be taken for the PATH.
- Return as soon as the closing marker arrives rather than at EOF: an rc
  that backgrounds a daemon hands it the pipe, which then never closes.
- Give up after 5s and kill the shell, so a slow or stuck rc delays
  startup instead of preventing it.
- Probe after forwarding an open path to a running window, which has no
  use for the PATH.

* docs(changelog): describe the bounded PATH probe

---------

Co-authored-by: stevelliu <stevelliu@tencent.com>
Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-09-28 12:12:55 +08:00
l0ng-ai bc08fc49f4 fix(deps): gpui-component paints text selection under the glyphs (#991) 2026-09-28 11:41:11 +08:00
l0ng-ai 39776012e2 feat(github): read a repository with whichever gh account can see it (#987)
The GitHub panel borrowed only gh's active account, so a private repository
owned by an organisation another signed-in account belongs to read as a 404.

When the active account gets a 404, 401 or 403, retry with gh's other
github.com accounts and remember, per owner, the one that got through. The
other accounts are listed lazily (gh auth status checks each online), and a
token from GH_TOKEN/GITHUB_TOKEN keeps its no-fallback meaning.
2026-09-28 10:59:25 +08:00
l0ng-ai ce76de975c fix(search): keep the empty note clear of the scope row
The empty view replaces the rows, so the list's top padding the scope row
is laid over never reached it and the row sat on top of "No results". It
now keeps its own clearance and sits left-aligned on the rows' column.

Claude-Session: https://claude.ai/code/session_01Aeskbok7Ah7dvKWnaaJFEg
2026-09-28 09:11:09 +08:00
l0ng-ai 1ba9159408 feat(panel): drop the GitHub row from the Info tab
The GitHub tab one over already names the repository and opens it; the
row only repeated it. Its upstream lookup goes with it.

Claude-Session: https://claude.ai/code/session_01Aeskbok7Ah7dvKWnaaJFEg
2026-09-28 09:00:55 +08:00
l0ng-ai 23e4ea79f5 chore(deps): gpui-component with v5 menus
Picks up l0ng-ai/gpui-component bce0d8ec: popup and context menus take
the v5 popover look — a neutral hover step, 28px rows, a hairline ring
and v5's long shadow.

Claude-Session: https://claude.ai/code/session_01Aeskbok7Ah7dvKWnaaJFEg
2026-09-28 08:45:02 +08:00
l0ng-ai 689517a632 feat(search): call the Actions scope Commands
Claude-Session: https://claude.ai/code/session_01Aeskbok7Ah7dvKWnaaJFEg
2026-09-28 08:45:02 +08:00