From 70bf9111c8145f405a86061b4d26dbb2cfbb0843 Mon Sep 17 00:00:00 2001 From: yinyin333333 Date: Fri, 17 Jul 2026 14:26:55 +0900 Subject: [PATCH 01/12] Update README for current features --- README.md | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 55c1fd9..aeddae9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TXTeditor -TXTeditor 0.4.7 is a Windows-focused desktop editor for Diablo II / Diablo II: Resurrected style tab-separated `.txt` data files. It is built as a Tauri v2 desktop app with a canvas-rendered virtual grid for editing large tables. +TXTeditor is a Windows-focused desktop editor for Diablo II / Diablo II: Resurrected style tab-separated `.txt` data files. It is built as a Tauri v2 desktop app with a canvas-rendered virtual grid for editing large tables. TXTeditor is a personal project. I am not an experienced programmer, and most of the implementation was built with the help of OpenAI Codex. The app may contain bugs, incomplete behavior, or rough edges, but I am sharing it in case it is useful to others. @@ -8,36 +8,46 @@ TXTeditor is not affiliated with, endorsed by, or connected to Blizzard Entertai ## Features -- Open single `.txt` files. -- Open a D2R `data/global/excel` style folder or workspace. +- Open individual `.txt` files and supported D2R localization `.json` files. +- Open a D2R `data/global/excel` style folder or workspace, including subfolders when desired. +- Open file paths passed to TXTeditor when the desktop app starts. - Edit tab-separated data in a grid interface. +- Edit `data/local/lng/strings/*.json` localization files in a dedicated JSON code editor. - Canvas virtualization for large files. -- Frozen first row and first column. -- Zoom, search, undo, and redo. -- Copy, cut, paste, fill, and simple arithmetic operations on selections. +- Independently freeze the first row and first column; the selected state is remembered between runs. +- Grid zoom, forward and backward search, undo, and redo. +- Copy, cut, paste, fill, and simple arithmetic operations on selections, including filling a multi-cell selection by pasting one value. - Hide and unhide rows or columns. +- Optionally lock mouse-based row-height and column-width resizing. - D2R-aware linting in the live Problems panel. - Select either Vector-LSP or Legacy Lint as the active lint engine. -- Click a diagnostic to jump to the matching file, row, column, and cell. -- RotW and 2.4 lint profile toggle. +- Run cross-file lint rules against the active workspace or the sibling files of an individually opened table. +- Click a diagnostic to jump to the matching table cell or JSON range. +- Configure versioned schema and bundled reference data, or use RotW and 2.4 profiles with Legacy Lint. -## Lint Profiles +## Localization JSON -TXTeditor includes RotW and 2.4 lint profiles. These rules are based on the behavior of [d2rlint](https://github.com/eezstreet/d2rlint), the original D2R linting tool made by eezstreet, and are integrated into TXTeditor's live Problems panel. +TXTeditor recognizes D2R localization files under `data/local/lng/strings/*.json`. These files open in a CodeMirror-based editor with JSON syntax highlighting, bracket matching, folding, search, and syntax markers. Saving uses the same document tab workflow as table files. If an open JSON file changes on disk, TXTeditor asks whether to reload the disk version or keep the editor version. -The RotW-oriented lint behavior has been checked against the project's current d2rlint-compatible fixture/oracle workflow. Other data sets, mod variants, or future rule changes may still expose bugs or differences. +Localization JSON diagnostics are available through **Lint Options** when Vector-LSP is selected. They are disabled by default and can be enabled or disabled individually for duplicate IDs or keys, required string fields, and unused localization keys. The unused-key rule also has a configurable lower ID threshold. Only JSON files present in the mod are checked; layout JSON contributes key-usage evidence without being treated as an editable localization document. -## Lint Engines +Malformed JSON is reported as a syntax problem. When semantic results from the last parse are still relevant, a syntax error does not make those existing findings appear resolved merely because the current document cannot be parsed. -Version 0.4.1 adds a lint engine selector in Settings. +## Lint Engines -Vector-LSP is the default engine for first-time runs and keeps the 0.4 behavior: bundled Vector-LSP diagnostics, Vector-LSP hover, Lint Options, and Problems panel integration. +Vector-LSP is the default engine for first-time runs. It provides bundled Vector-LSP diagnostics, Vector-LSP hover, Lint Options, localization JSON diagnostics, and Problems panel integration. -Legacy Lint restores the earlier built-in lint path from TXTeditor 0.33. In Legacy Lint mode, the Problems panel shows the RotW / 2.4 profile selector and Rules panel, and diagnostics are produced by TXTeditor's built-in legacy lint engine instead of Vector-LSP. +Legacy Lint uses TXTeditor's built-in lint path. In Legacy Lint mode, the Problems panel shows the RotW / 2.4 profile selector and Rules panel, and diagnostics are produced by TXTeditor instead of Vector-LSP. These rules are based on the behavior of [d2rlint](https://github.com/eezstreet/d2rlint), the original D2R linting tool made by eezstreet. You can switch between Vector-LSP and Legacy Lint while TXTeditor is running. Only the selected engine updates the active diagnostics, cell markers, overview-ruler marks, and Problems panel. Switching back to Vector-LSP resyncs open files with Vector-LSP and restores the stored Vector-LSP Hover preference. -Version 0.4.1 integrates [vector-lsp](https://github.com/eezstreet/vector-lsp) created by eezstreet while allowing users to choose Vector-LSP or Legacy Lint as the active lint engine. +Cross-file rules use the files in the active workspace. For a separately opened `.txt` file, sibling tables in the same folder provide its lint context. Folder workspaces include subfolders by default; **Exclude subfolders when opening a folder** in Settings limits the session to the selected folder itself. + +Versioned bundled reference data can supply tables that are absent from the current mod. A local workspace, sibling, or explicitly opened table takes precedence over the bundled fallback, so diagnostics follow the files being edited. One selected reference version is used for the whole lint session. + +The RotW-oriented lint behavior has been checked against the project's current d2rlint-compatible fixture/oracle workflow. Other data sets, mod variants, or future rule changes may still expose bugs or differences. + +TXTeditor uses a [modified fork of vector-lsp](https://github.com/yinyin333333/vector-lsp) that includes application-specific integration changes. This fork is derived from the [original vector-lsp](https://github.com/eezstreet/vector-lsp) created by eezstreet and remains subject to the original project's attribution and license. ## Build @@ -74,7 +84,7 @@ The toolbar **Shortcuts** button lets you replace command and grid-scrolling sho - `Ctrl+O`: open file - `Ctrl+S`: save - `Ctrl+Shift+S`: save as -- `Ctrl+F`: search +- `Ctrl+F`: search from the active cell - `Ctrl+B`: toggle Explorer panel - `Ctrl+L`: toggle Problems panel - `Ctrl+H`: reset all row heights to default @@ -86,15 +96,16 @@ The toolbar **Shortcuts** button lets you replace command and grid-scrolling sho - `Ctrl+A`: select all - `Ctrl+P` / `Ctrl+Shift+P`: command palette - `Ctrl+W`: close current tab -- `Ctrl+Plus`: zoom in -- `Ctrl+Minus`: zoom out -- `Ctrl+0`: reset zoom +- `Ctrl+Plus`: zoom in on the table grid +- `Ctrl+Minus`: zoom out on the table grid +- `Ctrl+0`: reset table-grid zoom - `PageUp` / `PageDown`: scroll one grid page vertically - `Home` / `End`: scroll to the top or bottom of the grid - `Shift+Home` / `Shift+End`: scroll to the left or right edge of the grid - `Enter` / `F2`: edit cell - `Escape`: cancel edit - `Tab` / `Shift+Tab`: move horizontally after edit +- `Enter` / `Shift+Enter` in the Find window: find next / previous ## Acknowledgements From 64061577b3d3e70f90a0371b67bee8aa094a8cc7 Mon Sep 17 00:00:00 2001 From: yinyin333333 Date: Fri, 17 Jul 2026 14:33:23 +0900 Subject: [PATCH 02/12] Update README.md --- README.md | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index aeddae9..7e02498 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TXTeditor -TXTeditor is a Windows-focused desktop editor for Diablo II / Diablo II: Resurrected style tab-separated `.txt` data files. It is built as a Tauri v2 desktop app with a canvas-rendered virtual grid for editing large tables. +TXTeditor is a Windows-focused desktop editor for Diablo II / Diablo II: Resurrected style tab-separated `.txt` data files and supported D2R JSON string files. It is built as a Tauri v2 desktop app with a canvas-rendered virtual grid for editing large tables. TXTeditor is a personal project. I am not an experienced programmer, and most of the implementation was built with the help of OpenAI Codex. The app may contain bugs, incomplete behavior, or rough edges, but I am sharing it in case it is useful to others. @@ -8,7 +8,7 @@ TXTeditor is not affiliated with, endorsed by, or connected to Blizzard Entertai ## Features -- Open individual `.txt` files and supported D2R localization `.json` files. +- Open individual `.txt` files and supported D2R JSON string files. - Open a D2R `data/global/excel` style folder or workspace, including subfolders when desired. - Open file paths passed to TXTeditor when the desktop app starts. - Edit tab-separated data in a grid interface. @@ -22,32 +22,49 @@ TXTeditor is not affiliated with, endorsed by, or connected to Blizzard Entertai - D2R-aware linting in the live Problems panel. - Select either Vector-LSP or Legacy Lint as the active lint engine. - Run cross-file lint rules against the active workspace or the sibling files of an individually opened table. +- Optionally lint supported D2R JSON string files with Vector-LSP. - Click a diagnostic to jump to the matching table cell or JSON range. - Configure versioned schema and bundled reference data, or use RotW and 2.4 profiles with Legacy Lint. -## Localization JSON +## JSON Editing -TXTeditor recognizes D2R localization files under `data/local/lng/strings/*.json`. These files open in a CodeMirror-based editor with JSON syntax highlighting, bracket matching, folding, search, and syntax markers. Saving uses the same document tab workflow as table files. If an open JSON file changes on disk, TXTeditor asks whether to reload the disk version or keep the editor version. +TXTeditor includes a dedicated JSON code editor based on [CodeMirror](https://codemirror.net/). It currently supports D2R string files under `data/local/lng/strings/*.json`, with JSON syntax highlighting, bracket matching, folding, search, and syntax markers. -Localization JSON diagnostics are available through **Lint Options** when Vector-LSP is selected. They are disabled by default and can be enabled or disabled individually for duplicate IDs or keys, required string fields, and unused localization keys. The unused-key rule also has a configurable lower ID threshold. Only JSON files present in the mod are checked; layout JSON contributes key-usage evidence without being treated as an editable localization document. +JSON files use the same document tab and save workflow as table files. If an open JSON file changes on disk, TXTeditor asks whether to reload the disk version or keep the editor version. -Malformed JSON is reported as a syntax problem. When semantic results from the last parse are still relevant, a syntax error does not make those existing findings appear resolved merely because the current document cannot be parsed. +## Linting -## Lint Engines +Lint results appear in the live Problems panel. Selecting a diagnostic opens the matching table cell or JSON range. -Vector-LSP is the default engine for first-time runs. It provides bundled Vector-LSP diagnostics, Vector-LSP hover, Lint Options, localization JSON diagnostics, and Problems panel integration. +### Lint Engines -Legacy Lint uses TXTeditor's built-in lint path. In Legacy Lint mode, the Problems panel shows the RotW / 2.4 profile selector and Rules panel, and diagnostics are produced by TXTeditor instead of Vector-LSP. These rules are based on the behavior of [d2rlint](https://github.com/eezstreet/d2rlint), the original D2R linting tool made by eezstreet. +Vector-LSP is the default engine for first-time runs. It provides bundled Vector-LSP diagnostics, Vector-LSP hover, Lint Options, JSON lint support, and Problems panel integration. + +Legacy Lint uses TXTeditor's built-in lint path. In Legacy Lint mode, diagnostics are produced by TXTeditor instead of Vector-LSP, and the Problems panel provides the profile selector and Rules panel. You can switch between Vector-LSP and Legacy Lint while TXTeditor is running. Only the selected engine updates the active diagnostics, cell markers, overview-ruler marks, and Problems panel. Switching back to Vector-LSP resyncs open files with Vector-LSP and restores the stored Vector-LSP Hover preference. +TXTeditor uses a [modified fork of vector-lsp](https://github.com/yinyin333333/vector-lsp) that includes application-specific integration changes. This fork is derived from the [original vector-lsp](https://github.com/eezstreet/vector-lsp) created by eezstreet and remains subject to the original project's attribution and license. + +### Lint Profiles + +Legacy Lint includes RotW and 2.4 profiles. These rules are based on the behavior of [d2rlint](https://github.com/eezstreet/d2rlint), the original D2R linting tool made by eezstreet. + +The RotW-oriented lint behavior has been checked against the project's current d2rlint-compatible fixture/oracle workflow. Other data sets, mod variants, or future rule changes may still expose bugs or differences. + +### Reference Data and Cross-File Lint + Cross-file rules use the files in the active workspace. For a separately opened `.txt` file, sibling tables in the same folder provide its lint context. Folder workspaces include subfolders by default; **Exclude subfolders when opening a folder** in Settings limits the session to the selected folder itself. Versioned bundled reference data can supply tables that are absent from the current mod. A local workspace, sibling, or explicitly opened table takes precedence over the bundled fallback, so diagnostics follow the files being edited. One selected reference version is used for the whole lint session. -The RotW-oriented lint behavior has been checked against the project's current d2rlint-compatible fixture/oracle workflow. Other data sets, mod variants, or future rule changes may still expose bugs or differences. +### JSON Lint -TXTeditor uses a [modified fork of vector-lsp](https://github.com/yinyin333333/vector-lsp) that includes application-specific integration changes. This fork is derived from the [original vector-lsp](https://github.com/eezstreet/vector-lsp) created by eezstreet and remains subject to the original project's attribution and license. +Vector-LSP can lint the supported D2R JSON string files. JSON lint is disabled by default and can be enabled through **Lint Options**. Individual rules can check duplicate IDs or keys, required string fields, and unused string keys. The unused-key rule also has a configurable lower ID threshold. + +Only JSON files present in the mod are checked. D2R layout JSON is used as evidence when checking whether string keys are used, but layout files are not opened as editable string documents. + +Malformed JSON is reported as a syntax problem. When semantic results from the last successful parse are still relevant, a syntax error does not make those existing findings appear resolved merely because the current document cannot be parsed. ## Build From b4b28675ffe8f2a849da4be8e470c48be881f6e9 Mon Sep 17 00:00:00 2001 From: yinyin333333 Date: Fri, 17 Jul 2026 18:28:52 +0900 Subject: [PATCH 03/12] Add navigation, replace, and clone workflows --- README.md | 4 + index.html | 8 + src/app.js | 22 +-- src/core/operations.js | 23 ++- src/core/search.js | 49 ++++++ src/styles.css | 13 ++ src/ui/app-elements.js | 4 + src/ui/canvas-grid.js | 11 +- src/ui/codemirror-json-editor-entry.js | 9 + src/ui/command-registry.js | 20 ++- src/ui/controllers/app-event-controller.js | 19 +- .../controllers/command-surface-controller.js | 17 +- src/ui/controllers/grid-command-controller.js | 40 ++++- src/ui/controllers/json-editor-controller.js | 1 + src/ui/controllers/search-controller.js | 95 +++++++++- src/ui/controllers/shell-controller.js | 18 +- src/ui/document-lifecycle-policy.js | 6 + src/ui/edit-policy.js | 3 +- src/ui/grid-selection-policy.js | 3 +- src/ui/prompt-dialog.js | 3 +- src/ui/shortcut-policy.js | 16 +- tests/app-controller.test.js | 13 +- tests/core.test.js | 5 +- tests/grid-policy.test.js | 2 + tests/json-document-tabs.test.js | 4 + tests/replace-navigation-shortcuts.test.js | 164 ++++++++++++++++++ tests/search-controller-regression.test.js | 57 +++++- tests/table-document-state.test.js | 39 ++++- 28 files changed, 618 insertions(+), 50 deletions(-) create mode 100644 tests/replace-navigation-shortcuts.test.js diff --git a/README.md b/README.md index 7e02498..29a9ef6 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,9 @@ The toolbar **Shortcuts** button lets you replace command and grid-scrolling sho - `Ctrl+S`: save - `Ctrl+Shift+S`: save as - `Ctrl+F`: search from the active cell +- `F3` / `Shift+F3`: find next / previous +- `Ctrl+Shift+H`: find and replace +- `Ctrl+G`: go to a displayed row number - `Ctrl+B`: toggle Explorer panel - `Ctrl+L`: toggle Problems panel - `Ctrl+H`: reset all row heights to default @@ -113,6 +116,7 @@ The toolbar **Shortcuts** button lets you replace command and grid-scrolling sho - `Ctrl+A`: select all - `Ctrl+P` / `Ctrl+Shift+P`: command palette - `Ctrl+W`: close current tab +- `Ctrl+Tab` / `Ctrl+Shift+Tab`: move to the next / previous open tab - `Ctrl+Plus`: zoom in on the table grid - `Ctrl+Minus`: zoom out on the table grid - `Ctrl+0`: reset table-grid zoom diff --git a/index.html b/index.html index 56e4841..0e1b3b6 100644 --- a/index.html +++ b/index.html @@ -82,12 +82,20 @@