diff --git a/.githooks/reference-transaction b/.githooks/reference-transaction new file mode 100755 index 000000000..edab3614f --- /dev/null +++ b/.githooks/reference-transaction @@ -0,0 +1,17 @@ +#!/bin/sh +# Refuses a move of staging that brings in a screenshot no commit of the +# screenshot review tool recorded: scripts/shot_ledger.mjs --hook, on git's +# lines ( ). It runs for every update of a ref, so it starts +# node only when staging is among them, and only once the update is prepared, +# the one state in which a hook can still refuse it. See WIP.ShotReview.md, +# The ledger. +# +# Enable it in a clone: git config core.hooksPath .githooks +# +# .gitattributes keeps this file LF in every checkout, for a POSIX Git's sake. +[ "$1" = prepared ] || exit 0 +lines=$(grep ' refs/heads/staging$') || exit 0 +# git runs it from the top of the working tree the command runs in: a worktree +# made before the check came has no script to run, and is let through. +[ -f scripts/shot_ledger.mjs ] || exit 0 +printf '%s\n' "$lines" | exec node scripts/shot_ledger.mjs --hook diff --git a/BUGS-TO-REPORT.md b/BUGS-TO-REPORT.md index de1bf7e86..926f5afb7 100644 --- a/BUGS-TO-REPORT.md +++ b/BUGS-TO-REPORT.md @@ -3139,6 +3139,34 @@ Severity: medium. The program's state changes with nothing shown, from moving th --- +## The hover's hexadecimal for a negative Integer or Long is a literal of a different value + +**Describe the bug** +Since BETA 1044 the hover over an integral value while paused adds its hexadecimal in brackets. The digits are right, but the suffix after them is chosen from the digits alone: `&` for `&H8000` to `&HFFFF`, `^` for `&H80000000` to `&HFFFFFFFF`, whatever the type of the value. For a negative Integer or Long the result is the literal of another number. An Integer of `-1` shows `(&HFFFF&)`, and `&HFFFF&` is the Long `65535`; a Long of `-1` shows `(&HFFFFFFFF^)`, the LongLong `4294967295`. It was observed in an IDE started with an `APPDATA` of its own. + +**To Reproduce** +Steps to reproduce the behavior: +1. A procedure that holds `Dim iNeg As Integer = -1`, `Dim lNeg As Long = -1` and a line after them. +2. Stop at a breakpoint on that line. +3. Hold the pointer over `iNeg`. The hover reads `iNeg: -1 (&HFFFF&)`. +4. Hold the pointer over `lNeg`. The hover reads `lNeg: -1 (&HFFFFFFFF^)`. + +**Expected behavior** +A literal of the value shown: `(&HFFFF)` for the Integer and `(&HFFFFFFFF)` for the Long, which are `-1` as literals. The suffix is right only where the digits do not fit the type's own literal, as for a Long of `32768`, `(&H8000&)`. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +In `ide/main.js`, the hover provider takes the value as unsigned in the width of the type (`BigInt.asUintN`) and then picks the suffix by testing the bits of that unsigned value (`(c & 0xffffffffffff8000n) === 0x8000n` for `&`), not by the type. A Byte of `255` shows `(&HFF)`, a Long of `32768` shows `(&H8000&)` and a LongLong of `-1` shows `(&HFFFFFFFFFFFFFFFF)`, all of them right. + +Severity: low. The decimal beside it is right; the hexadecimal misleads only someone who reads it as a literal. + + + +--- + ## An edit at the run-time error panel prints Aborting, and then the rest of the program runs **Describe the bug** @@ -3961,7 +3989,7 @@ Severity: low. Nothing wrong can be added. ## A package's read-only designer file opens an empty tab besides the notice that it cannot be opened **Describe the bug** -A designer file of a referenced package, such as the VB package's `tbObjectDesigner_PROPERTYPAGE.tbppage`, is read-only. Opening it from Project Explorer shows the notification *Can't open designer for a read-only document.*, and also adds a tab of that name and selects it: an empty tab with no close icon. A middle click closes it. It was observed in an IDE started with an `APPDATA` of its own. +A designer file of a referenced package, such as the VB package's `tbObjectDesigner_PROPERTYPAGE.tbppage`, is read-only. Opening it from Project Explorer shows the notification *Can't open designer for a read-only document.*, and also adds a tab of that name and selects it: an empty tab. Up to BETA 1042 the tab had no close icon, and only a middle click closed it; BETA 1045 gives it one. It was observed in an IDE started with an `APPDATA` of its own. **To Reproduce** Steps to reproduce the behavior: @@ -3978,9 +4006,9 @@ The notification only, with no tab; or the file shown read-only, as View As JSON **Additional context** The IDE never reports the file as opened (the open's completion callback is not called), and the page throws a `TypeError` in a websocket request handler. -Severity: low. Cosmetic; the tab closes with a middle click. +Severity: low. Cosmetic; the tab closes as any other does. - + --- @@ -5458,36 +5486,10 @@ Severity: low. The files are written, beside the folder intended. --- -## Project Explorer's object view opens no menu on a right click - -**Describe the bug** -Project Explorer's object view (Ctrl+R) has a context menu with View Object, View Code, Add, Rename and Delete, but a right click on a row opens nothing, whether the row is an object, a form or a group. The menu's commands cannot be reached. It was observed in an IDE started with an `APPDATA` of its own, looking for an open menu after each click. - -**To Reproduce** -Steps to reproduce the behavior: -1. In Project Explorer, press Ctrl+R for the object view. -2. Right-click `Startup` (a module), `frmMain` (a form) or `Modules` (a group). No menu opens. - -**Expected behavior** -The menu opened, as a right click on a row of the file view opens the file view's menu. - -**Desktop:** - - OS: Windows 10 Pro 22H2 (build 19045) - - twinBASIC compiler version: BETA 1010 - -**Additional context** -The list item's `onmousedown` (`ide/main.js`) passes on the left button only. With the menu unreachable, a form's code cannot be opened from the object view, since Shift+double-click opens the designer too (see "Shift+double-click on a form in the object view opens the designer, not the code"). The menu's Rename and Delete do nothing yet either (see "The object view's Rename and Delete commands only show an alert naming the command"). - -Severity: low. The same commands are in the file view's menu. - - - ---- - ## The object view's Rename and Delete commands only show an alert naming the command **Describe the bug** -The commands behind the object view menu's Rename and Delete, `tbProjectExplorer_ObjectList_RenameSelected` and `tbProjectExplorer_ObjectList_DeleteSelected`, show only a browser alert that holds the command's name. Nothing is renamed or deleted. The menu draws the two items disabled, and the menu does not open at all (see "Project Explorer's object view opens no menu on a right click"), so a key bound to the command is the way to run one. It was observed in an IDE started with an `APPDATA` of its own, running the commands and reading the alerts. +The commands behind the object view menu's Rename and Delete, `tbProjectExplorer_ObjectList_RenameSelected` and `tbProjectExplorer_ObjectList_DeleteSelected`, show only a browser alert that holds the command's name. Nothing is renamed or deleted. The object view's right-click menu, which opens since BETA 1045, draws the two items greyed out, so a key bound to the command is the way to run one. It was observed in an IDE started with an `APPDATA` of its own, running the commands and reading the alerts. **To Reproduce** Steps to reproduce the behavior: @@ -5507,7 +5509,7 @@ The two commands are `alert(...)` calls in `ide/main.js`. Severity: low. Rename and Delete in the file view work. - + --- @@ -5541,7 +5543,7 @@ Severity: low. Cosmetic. ## Shift+double-click on a form in the object view opens the designer, not the code **Describe the bug** -In Project Explorer's object view, the code that opens a form tells the designer from the code by the Shift key, but the double-click passes no Shift state to it. Shift+double-click on a form opens its designer, as a plain double-click does. With the object view's menu unreachable, a form's code cannot be opened from the object view at all. It was observed in an IDE started with an `APPDATA` of its own, reading the tabs. +In Project Explorer's object view, the code that opens a form tells the designer from the code by the Shift key, but the double-click passes no Shift state to it. Shift+double-click on a form opens its designer, as a plain double-click does. It was observed in an IDE started with an `APPDATA` of its own, reading the tabs. **To Reproduce** Steps to reproduce the behavior: @@ -5556,9 +5558,9 @@ The form's code, `frmMain.twin`, opened. - twinBASIC compiler version: BETA 1010 **Additional context** -A double-click on a module (`Legacy`) opens its code, as it should. The list item's `ondblclick` (`ide/main.js`) passes no `shiftKey`. The menu's View Code is out of reach too (see "Project Explorer's object view opens no menu on a right click"). +A double-click on a module (`Legacy`) opens its code, as it should. The list item's `ondblclick` (`ide/main.js`) passes no `shiftKey`. -Severity: low. The form's `.twin` file opens from the file view. +Severity: low. Since BETA 1045 the object view's right-click menu opens, and its View Code opens the form's code; so does the form's `.twin` file in the file view. @@ -14096,6 +14098,306 @@ Severity: low. Nothing is lost, but an add-in cannot tell its warnings from its --- +## The ICO Designer that ships with the IDE opens every .cur file as an unsupported or corrupt icon + +**Describe the bug** +The ICO Designer add-in that ships with BETA 1045 (`addins\win32\tbIcoDesignerAddIn.dll`, the project of Sample 25) registers itself as the default designer for `.ico` and for `.cur`. Its reader takes only a file whose header gives the type 1, an icon, and a cursor file gives 2. So every `.cur` file opens with the status *Unsupported/corrupt ICO: click New icon to replace it.*, and nothing in it is shown. **New** then writes an icon, type 1, over the cursor file, and its hotspot is lost. It was observed in an IDE started with an `APPDATA` of its own, with only that add-in loaded. + +**To Reproduce** +Steps to reproduce the behavior: +1. A project with `Pic.ico`, a 16x16 32-bit icon, and `Pic.cur`, the same picture as a cursor with its hotspot at 0,0. +2. Double-click `Pic.ico` in the Project Explorer. The ICO Designer shows it, with the status *Imported ICO.* +3. Double-click `Pic.cur`. The ICO Designer opens, with the status *Unsupported/corrupt ICO: click New icon to replace it.* + +**Expected behavior** +The cursor's pictures are shown and can be edited, and saving keeps the file a cursor, with its hotspot. Or, if the designer is not meant for cursors, it does not register itself for `.cur`. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +`DecodeIco` in Sample 25's `IcoEditorCodec.twin` returns at `If U16(input, 0) <> 0 Or U16(input, 2) <> 1 Then Exit Function`. In a cursor's directory entry the two words an icon uses for planes and bit count hold the hotspot, and `EncodeIco` writes 1 and 32 there. + +Severity: low. The cursor is not damaged unless **New** is chosen, but the designer offers nothing for it. + + + +--- + +## A menu that Menus.AddCustom makes as an add-in's first menu call does not open, and a compiler restart leaves it on the menu bar + +**Describe the bug** +`Host.Menus.AddCustom("Probe", True)` adds a menu to the IDE's menu bar, after **Help**. When it is the add-in's first call that adds anything to a menu, the item appears on the bar but does not open when clicked, and setting the menu's `Caption` or `Visible` does not change it, though reading them back gives the new values. At a compiler restart the item stays, and the add-in, loaded again, adds a second one, as dead as the first. When the add-in has added an entry to another menu first, `AddCustom` gives a menu that works. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. An add-in whose `OnProjectLoaded` calls `Set m = Host.Menus.AddCustom("ProbeFirst", True)` and `m.AddEntry "One"` before any other menu call. +2. Load it and open a project. **ProbeFirst** is on the menu bar after **Help**. +3. Click **ProbeFirst**. Nothing opens. +4. `m.Caption = "ProbeFirst2"` leaves the bar item's text as it was; `m.Caption` reads `ProbeFirst2`. +5. Restart the compiler. The bar now shows **ProbeFirst** twice. + +**Expected behavior** +The menu opens on a click and lists its entries, as it does when the add-in has added an entry somewhere else first; its `Caption` and `Visible` change the bar item; a compiler restart removes it. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +In `ide/main.js`, the `addMenu` handler, for a menu with no parent, inserts the bar item and then reads `Object.keys(o.children).length`, where `o` is the add-in's entry in `g_ExtensibilityMenus`. That entry has no `children` until the add-in has added an entry to a menu, so the read throws, the handler's `catch` swallows it, and the click handler and the record the later calls look for are never made. `removeExtensibilityMenus` then cannot find the item at a restart. + +Severity: medium. An add-in whose only menu is its own gets a menu that does nothing, and a growing row of them. + + + +--- + +## Menus.RemoveAllAddedEntries removes nothing + +**Describe the bug** +`Host.Menus.RemoveAllAddedEntries` is declared to remove the entries the calling add-in has added. It removes none: the page's store of the add-in's entries (`g_ExtensibilityMenus`) is the same before and after the call, the entries still show in their menus, and the add-in's own menus stay on the menu bar. `Menu.RemoveAllAddedEntries` on one menu, such as **FileMenu**, does remove that menu's entries. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. An add-in that adds an entry to `Host.Menus.FileMenu`, one to `Host.Menus.ProjectExplorerFileViewContextMenu`, and a menu with `Host.Menus.AddCustom`. +2. Call `Host.Menus.RemoveAllAddedEntries`. +3. Open the **File** menu, and right-click a file in the Project Explorer. Both entries are still there, and so is the custom menu. + +**Expected behavior** +Every entry and menu the add-in added is gone, as after `Menu.RemoveAllAddedEntries` on each of its menus. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +The page has a handler for one menu's removal (`removeAllMenuChildren`) and none for all of an add-in's; whatever the compiler sends for `Menus.RemoveAllAddedEntries` changes nothing in the page. + +Severity: low. An add-in can remove its entries one menu at a time. + + + +--- + +## Menu.ShowPopup on one of the IDE's own menus shows nothing + +**Describe the bug** +`Menu.ShowPopup(ClientX, ClientY)` shows a menu at a point of the IDE's window. On a menu made with `Menus.AddCustom(..., False)` it does, with its top-left exactly at the point. On one of the IDE's own menus, such as `Host.Menus.ProjectExplorerFileViewContextMenu` or `Host.Menus.FileMenu`, nothing opens, whether it is called from a tool window's click handler or a toolbar button's, and no entry's `BeforeShow` fires. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. An add-in that adds an entry to `Host.Menus.FileMenu`, and a tool window with a `click` listener that calls `Host.Menus.FileMenu.ShowPopup e.clientX, e.clientY`. +2. Click in the tool window. Nothing opens. +3. Control: a `Host.Menus.AddCustom("Popup", False)` menu with an entry, shown the same way, opens at the pointer. + +**Expected behavior** +The menu opens at the point, with the add-in's entries at least, or the declaration says that `ShowPopup` is for a custom menu only. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +The declaration's comment on `AddCustom` suggests an invisible custom menu for `ShowPopup`; nothing says a named menu is refused. + +Severity: low. + + + +--- + +## ProjectExplorer.AddFileUI returns an empty string when the user cancels, instead of raising the error it is declared to raise + +**Describe the bug** +`Host.ProjectExplorer.AddFileUI(FileExt, SuggestedName, ContentString)` is declared with the description *Returns the created URI, or throws an error if canceled by the user*. When the user presses Escape in the name box, or leaves the name empty, or types an invalid name such as `bad\name`, it returns `""` and raises no error. Sample 27 (Data Explorer) relies on the error: its handler has `On Error GoTo Canceled` and then opens the returned path, so on Escape it goes on to call `Host.ActiveEditors.Open("twinbasic:")` (read in its source, not run). It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. An add-in that calls `s = Host.ProjectExplorer.AddFileUI("prb", "MyFile", "hello")` and prints `s`, `Err.Number` and `Err.Description`. +2. Press Escape in the name box. It prints an empty `s` and `Err.Number` 0. +3. Control: press Enter. It prints `//Sources/MyFile.prb`. + +**Expected behavior** +A run-time error on Escape, an empty name and an invalid name, as the description says; or a description that says an empty string is returned. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +On a cancel the page answers with `sendModalResultFailed` (`projectExplorerAddFileUI` in `ide/main.js`); the call returns an empty string in the add-in. + +Severity: low. An add-in that follows the description takes a cancel for a file made. + + + +--- + +## ProjectExplorer.AddFileUI puts the file in a folder beside Sources whose name starts with "Sources" + +**Describe the bug** +`Host.ProjectExplorer.AddFileUI` makes the new file in the folder selected in the Project Explorer, and when that folder is outside `Sources`, in `Sources` itself: with a folder `Notes` beside `Sources` selected, the file goes into `Sources`. A folder beside `Sources` whose name starts with `Sources`, such as `SourcesExtra`, is taken as inside it, and the file goes into `SourcesExtra`. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. A project with the folders `Notes` and `SourcesExtra` beside `Sources`. +2. Select `Notes` and call `Host.ProjectExplorer.AddFileUI("prb", "MyFile", "")`; press Enter. It returns `//Sources/MyFile.prb`. +3. Select `SourcesExtra` and do the same. It returns `//SourcesExtra/MyFile.prb`. + +**Expected behavior** +Step 3 makes the file in `Sources`, as step 2 does. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +`getUICurrentFolder` in `ide/main.js` tests whether the folder is inside `Sources` by whether its path starts with the path of `Sources`, without the `/` after it. + +Severity: low. + + + +--- + +## An add-in's tool window keeps the --themeAddin colours of the theme it was made in + +**Describe the bug** +BETA 1045 gives add-ins eight theme colours as CSS variables, `--themeAddinBackColor` and the rest. A tool window that an add-in made under one theme keeps that theme's values after the user chooses another: its CSS goes on drawing the old colours until the add-in makes the window again. A designer's tab follows the change, and so does a tool window made after it. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/menus`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. Under the Dark theme, an add-in makes a tool window whose CSS is `body { background: var(--themeAddinBackColor) }`. The background is `#2b2b2b`. +2. Choose **Window → Theme → Light**. The tool window's background stays `#2b2b2b`; the IDE's own panels turn light. +3. Control: a tool window made now has Light's `#FFFFFF`. + +**Expected behavior** +The variables in an open tool window change with the theme, as they do in a designer. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +`createToolWindowById` in `ide/main.js` copies the eight values onto the tool window's body as inline styles when it makes the window, and nothing copies them again; `resyncTheme`, which `notifyChangedTheme` calls, does it for designers only. The inline values hide the page's own, which do change. + +Severity: low. An add-in can make its windows again in `OnChangedTheme`. + + + +--- + +## A datasheet draws a 0 as an empty cell + +**Describe the bug** +The `datasheet` element of BETA 1045 draws each value its add-in gives in `onGetRows`. A JSON `0` is drawn as nothing, in a column of type `integer` and in one of type `string` alike, while `1`, `1.5`, `42` and text are drawn. So a grid cannot show a zero, and a zero looks like a null. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/datasheet`) that shows a datasheet in a tool window. + +**To Reproduce** +Steps to reproduce the behavior: +1. A datasheet whose `onGetInfo` answers `{"recordCount": 2, "columns": [{"name": "n", "type": "integer"}, {"name": "s", "type": "string"}]}`. +2. Its `onGetRows` answers `[[0, 0], [1, 1]]`. +3. The first row's two cells are empty; the second row shows `1` and `1`. + +**Expected behavior** +The first row shows `0` and `0`. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +A cell is drawn by fin-hypergrid's default renderer (`ide/fin-hypergrid.min.js`), which the datasheet gives the value as it is; the renderer takes a falsy value as no value. A null is drawn as nothing too, so the reader cannot tell the two apart. + +Severity: medium. A table of numbers shows blanks where its zeros are, with nothing to say so. + + + +--- + +## Right, Left, Tab, Home and End in a datasheet throw in the IDE's page and move nothing + +**Describe the bug** +In a `datasheet` with a data cell current, Up and Down move the current record. Right, Left and Tab each throw `TypeError: Cannot read properties of null (reading 'x')` from `ide/fin-hypergrid.min.js`, and Home, End, Ctrl+Home and Ctrl+End throw `page left not yet implemented` or `page right not yet implemented`. None of them moves the cell, the record or the scroll. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/datasheet`) that shows a datasheet in a tool window. + +**To Reproduce** +Steps to reproduce the behavior: +1. A datasheet with a few columns and rows. Click a data cell. +2. Press Right. Nothing moves; the page reports an uncaught TypeError. +3. Press Home. Nothing moves; the page reports `page left not yet implemented`. +Control: Down moves the current record by one. + +**Expected behavior** +Right, Left and Tab move to the next or previous cell, scrolling the columns into view, and Home and End to the first or last column; or the keys do nothing without an error. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +The two strings are fin-hypergrid's own unfinished handlers. The TypeError is in its cell navigation, which finds no cell selection of its own: the datasheet keeps its current record itself and handles Up and Down. + +Severity: low. A grid wider than its window can be scrolled sideways only with the scroll bar. + + + +--- + +## Designers.Unregister crashes the compiler + +**Describe the bug** +`Host.Designers.Unregister(Extension)` ends the compiler with an access violation. The DEBUG CONSOLE prints `NATIVE EXCEPTION: ACCESS_VIOLATION {no-basic-code} [$80004001?.dll+...]`, and the statement after the call never runs. It does so for an extension the add-in registered with `Designers.Register` and for one it never registered, and under `On Error Resume Next` too. The add-in, loaded again by the restarted compiler, crashes it again at the same call. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/designers`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. An add-in whose `OnProjectLoaded` calls `Host.Designers.Register "Probe", ".prb", New ProbeFactory` and then `Host.Designers.Unregister ".prb"`, with a `PrintText` after each. +2. Load it and open a project. The console shows the line after `Register`, then the access violation; the line after `Unregister` never shows. +3. The IDE restarts the compiler, which loads the add-in and crashes again. + +**Expected behavior** +`Unregister` withdraws the designer, or raises a run-time error the add-in can handle. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +`$80004001` in the exception's text is `E_NOTIMPL`. The IDE's page has no handler for unregistering a designer: nothing in `ide/main.js` removes an entry from `g_registeredCustomDesigners`, which only a compiler restart empties. + +Severity: high. One call ends the compiler, and every restart ends it again while the add-in is loaded. + + + +--- + +## A designer's tab keeps its changed mark after SetFileData gives back the saved bytes + +**Describe the bug** +`DesignerHost.SetFileData` gives the IDE a designer's new bytes, and the tab shows the changed mark, a dot. When a later `SetFileData` gives back the bytes the file was saved with, as an Undo to the saved state does, the IDE takes the tab as unchanged (closing it asks nothing) but the dot stays. A save takes it away. It was observed in an IDE started with an `APPDATA` of its own, with a probe add-in (`test/addin/probes/designers`) loaded into a copy of the install. + +**To Reproduce** +Steps to reproduce the behavior: +1. A designer that calls `SetFileData` with changed bytes: the tab shows the dot. +2. The designer calls `SetFileData` with the bytes the file was opened with. The dot stays. +3. Close the tab. The IDE asks nothing, as for a tab with no changes. + +**Expected behavior** +The dot goes at step 2, as it does after a save. + +**Desktop:** + - OS: Windows 10 Pro 22H2 (build 19045) + - twinBASIC compiler version: BETA 1045 + +**Additional context** +In `ide/main.js`, `fileHandler_CustomDesigner.isDirty` sets `cachedIsDirtyState` to `undefined`, and `updateDirtyState` removes the dot only when that cache is truthy. A save clears the dot because it rewrites the close button's class. + +Severity: low. The tab says it has changes it does not have. + + + +--- + ## A CefBrowser moved before Ready crashes CEF's browser process, and raises neither Ready nor Error **Describe the bug** diff --git a/WIP.BugHunt.md b/WIP.BugHunt.md index 953fdb116..d075359e9 100644 --- a/WIP.BugHunt.md +++ b/WIP.BugHunt.md @@ -160,6 +160,46 @@ Seen on BETA 1042 by the `commonctls` setup (fixture `test/shots/commonctls`). - **`Class_Initialize` and `Sub New` together in a WaynesForm class** give TB5135. BETA 1042, the `waynes` setup. +### tbIDE and the add-ins that ship with the IDE + +BETA 1045: met in its update, reading the tbIDE sources, Samples 24 to 27 and `ide/main.js`. +None of them run yet. + +- **`DesignerHost` and `DesignerFactory` have one CoClassId**, `30262402-4D7A-4170-9E63-FE158040EC0F` + (`Designers.twin`, lines 30 and 101); every other CoClass has its own. Whatever looks a + CoClass up by its id may find the wrong one. +- **`"monacoDiff"` creates its editor with `theme: "vs-dark"`** (`main.js`, the + `toolWindowElementAddChild` branch). Monaco's theme is global, so opening Diff Compare in a + light IDE theme may turn the IDE's code editor dark too. **Page affected**: none states a + colour yet. Seen since (BETA 1045, the `addins` setup of `shoot_docs.mjs`): in the Light + theme the comparison draws its code very light grey on a white ground, hardly readable + (`DiffCompare.light.png`). Not yet seen whether the code editor turns dark. +- **Select for compare on a `.txt` file shows "Unable to publish comparison: Automation + error"** (Diff Compare, BETA 1045, the `addins` setup in a lane IDE): the same command on a + `.twin` file works. Not narrowed: `MenuSelectForCompare_Click` (`DiffCompareAddin.twin` 110) + reads `file.Text`, `Host.CurrentProject.Name` and publishes a pipe, and the error is a bare + COM one. **Page affected**: DiffCompare.md says the add-in compares "the text of two files". +- **Sample 24's `HexEditorFactory.New` writes `Set Addin = Addin`** where Sample 25's writes + `Set Me.Addin = Addin`. The parameter hides the field (a `tbrun` probe on BETA 1045: the + field stays **Nothing**, `Set Me.` sets it), so the Hex Editor's designers get **Nothing** for + their `Addin`, and its message boxes (an invalid Find text) should fail. Not run in the add-in: + a Find of `zz` in the Hex Editor shows what the user sees. +- **Sample 25's Undo back to an empty new icon passes an erased array to `SetFileData`** + (`IcoEditorDesigner.twin` 2423), where Sample 24's comment says the bridge needs a real + zero-element array. New, draw, Undo. +- **A package's JSON view is gone from the Project Explorer's menu.** BETA 1042's **View As + JSON** worked on the rows under `Packages`; 1045 moves it into **Open with → JSON Preview**, + which lists it only for the four form extensions, and hides **Open with** on a read-only row, + which a package's is (`showContextMenuOpenWithComponent`). The command + `tbProjectExplorer_SelectedItemsViewAsJSON` still exists: a key bound to it may still work. + **Page affected**: Features/Compiler-IDE/IDE-Features.md and Projects/Files-and-Folders.md + now describe forms only; their package pictures are removed. +- **Open with is hidden when no add-in offers an editor for the file**, and with it **JSON + Preview** and **Markdown Preview**: in an IDE whose add-ins did not load (Shift held), a form's + JSON view and a `.md` file's preview cannot be reached from the menu. +- **The Hex Editor's grid tooltip** says Ctrl+C "uses that column", but Ctrl+C always copies hex. + **Page affected**: HexEditor.md says what the code does. + ### VBFLXGRD18 - **Without an explicit `Load Form1`**, `Form1.VBFlexGrid1` through the implicit instance diff --git a/WIP.Build.md b/WIP.Build.md index fbb1e2c6f..6c8a57bef 100644 --- a/WIP.Build.md +++ b/WIP.Build.md @@ -909,7 +909,7 @@ and no description; the fix is the sentence the authoring rules ask for under th here. `llms.txt` also names `tB/symbols.json`, the lookup an agent needs (the site's search runs in the browser, on a 55 MB index), and `nav.html`. -The copies and `llms.txt` are made by `builder/markdown-copy.mjs` and `builder/llms-txt.mjs`. A copy is the page's source with what reads differently on the page changed, outside code: the front matter, the HTML comments, the `{{tbdocs:...}}` placeholders and the links. **A new syntax that the render turns into something else** (a placeholder, a link scheme like `tb:`) **is handled in the copy too, through the same function** (`resolveTarget`, `expandDownloadPlaceholders`, `substituteCounts`), or the copy publishes it as written. `check_code_regions.mjs` holds the copy to the source's code. `llms_txt.optional` in `docs/_config.yml` names top-level pages by title, so renaming one fails the build until it is edited. +The copies and `llms.txt` are made by `builder/markdown-copy.mjs` and `builder/llms-txt.mjs`. A copy is the page's source with what reads differently on the page changed, outside code: the front matter, the HTML comments, the fences marked `hidden` or `probe` (one rule for the render and the copy, `isHiddenFence`; `check_code_regions.mjs` expects them gone from the copy), the `{{tbdocs:...}}` placeholders and the links. **A new syntax that the render turns into something else** (a placeholder, a link scheme like `tb:`) **is handled in the copy too, through the same function** (`resolveTarget`, `expandDownloadPlaceholders`, `substituteCounts`), or the copy publishes it as written. `check_code_regions.mjs` holds the copy to the source's code. `llms_txt.optional` in `docs/_config.yml` names top-level pages by title, so renaming one fails the build until it is edited. ### The nav: a part on each page, the whole in one file diff --git a/WIP.ExamplesBuild.md b/WIP.ExamplesBuild.md index 9c82c1ece..949978b7c 100644 --- a/WIP.ExamplesBuild.md +++ b/WIP.ExamplesBuild.md @@ -243,7 +243,9 @@ has another sample, and `splitBatch` cannot isolate a failure to it. A fence marked `hidden` is compiled with the page's other samples and **rendered to nothing**: `builder/render.mjs`'s fence rule returns `""` for it, so it is absent from the HTML and from everything downstream that reads the rendered string: the search index, the -offline mirror, the PDF book. Verified across all three trees. +offline mirror, the PDF book. Verified across all three trees. The page's markdown copy is +made from the source, not the HTML, and leaves it out by the same rule (`isHiddenFence`, +`builder/markdown-copy.mjs`). It exists for fiction invented for one page (`MyServiceA` / `MyServiceB`, `ClientSession`). Putting it in a shared stage set would make a template that hundreds of pages build into diff --git a/WIP.Screenshots.md b/WIP.Screenshots.md index 813d6fe98..2cbef9af2 100644 --- a/WIP.Screenshots.md +++ b/WIP.Screenshots.md @@ -302,7 +302,7 @@ Exit codes: 0 every picture written or unchanged, 1 a picture failed, 2 the tool alone), `programs`, `vbflexgrid`, `xcalendar`, `dialogs`, `webview2`, `cef`, `codelens`, `memory`, `package` and `fusion` (pictures of a running program), `package-server`, `settings-linked` and `package-check`, `import`, `webpage` and `web` (a Chrome, not an IDE), `featuremap`, `tour`, `code-chapter`, `debugging`, `assert`, `forms-chapter`, `toolbox-icons`, `projects`, `projects-refs`, - `projects-start`, the `building`, `starting` and `troubleshooting` setups, `customcontrols`, `code` and `sample9` (all described + `projects-start`, the `building`, `starting` and `troubleshooting` setups, `addins`, `customcontrols`, `code` and `sample9` (all described below). A setup is `{name, start, prepare}`, with `closing` to read what only its page can say before the IDE ends, `end` to check or give back what it holds after, and `noPage` for a setup with no IDE page, whose `start` returns a stand-in for the connection and whose shots are `once`. @@ -1071,6 +1071,36 @@ line the page quotes. Its pictures are under `docs/IDE/Troubleshooting/Images/`. - The console picture shows the sample's "orange" line in yellow: PrintText ignores its colour (BUGS-TO-REPORT, `printtext-colorrgb-ignored`, a NOTE on DebugConsole.md). +## The shipped add-ins' pictures + +- **Setup `addins`**: the five DLLs of the install's `addins\win32` (Samples 15 and 24 to 27, + never built here) put into the lane's copy, as an install has them; a lane's copy otherwise + has no add-ins, which is why `Menu_Add-Ins` shows *no addins loaded*. The project is + `test/shots/sample` with `test/shots/addins` staged onto it (two modules of prices, for Diff + Compare), and the setup writes the binary files: `Header.bin`, a made-up header of 176 bytes, + and `Badge.ico`, a disc drawn at 16, 32 and 48 pixels (the template's icon is 64 by 63, which + the ICO Designer reports as non-square). Its pictures are on the Add Ins page (`AddIns_Menu`, + the five add-ins) and the four add-in pages (`HexEditor`, `IcoEditor`, `DiffCompare_Menu`, + `DiffCompare`, `DataExplorer`, `DataExplorer_Settings`). +- **The Data Explorer reads a CSV file through the Jet text driver** + (`Provider=Microsoft.Jet.OLEDB.4.0`, `Extended Properties="text;HDR=Yes;FMT=Delimited"`), which + every Windows has for the 32-bit compiler the lane runs; a `schema.ini` beside it types the + columns, so `InStock` is a Yes/No column with tick boxes. The CSV is in `AddinData` under + `PACKAGE_ROOT`, so that the connection string shows `C:\tbshots\AddinData`. The grid draws its + rows on a canvas: a shot waits for the bar's *of 12 records*, not for a cell's text. +- **Diff Compare compares two `.twin` files, not text files**: on BETA 1045 Select for compare + on a `.txt` file shows *Unable to publish comparison: Automation error* (a lead in + [WIP.BugHunt.md](WIP.BugHunt.md)). The side-by-side editor is in the designer container's own + children, not its shadow root, and draws a space as a no-break space. Select for compare + offers the file to every IDE of the same Windows user, the user's own included if it is open + with the add-in, until the lane's IDE closes; the pictures never open **Compare With**, which + lists the other IDEs' offers. +- **`DiffCompare.light.png` shows the code very light grey on white.** The add-in's diff editor + has the theme `vs-dark` whatever the IDE's theme (a lead in WIP.BugHunt.md); the picture + shows what the IDE draws. +- **The Hex Editor's Shift+click selects up to the byte before the one clicked**, so the shot + clicks byte 42 to select the 26 bytes from 10h. + ## Package server Taken on BETA 1010, in both themes where the theme shows. @@ -1512,6 +1542,67 @@ image to the element's box, as for an `` (checked in headless Chromium: a 1 an `.ico` so (Resource_Preview: the tB icon, an `` of a `data:image/x-icon` URL). Only a `data:` image is taken; the snapshot's `currentSourceURL` is an ``'s alone, so the URL is the `src` attribute. +**A CSS mask is an SVG ``** (`maskDef` in `snapshot-svg.mjs`, 2026-11-22). The shipped +add-ins (BETA 1045) draw their toolbar icons, Hex Editor's Undo and Redo and ICO Editor's four, as +a 20 px `::before` whose background is the text colour, shown through a `mask-image` of an SVG. +Before `mask-image` was read, each came out a square of that colour, and the picture still passed +the bar (HexEditor.light 0.14% strongly off: two small squares are few pixels). The mask's layers +are laid out by `paintBackgroundImages` from the `mask-*` properties, origin and clip the border +box unless they say otherwise, and kept to the clip box they name even where opaque borders +cover a background (`exactClip`); the mask is the border box's size, and masks by alpha unless +`mask-mode` is luminance. Its group encloses the element's filter group, as CSS applies the +filter first. The `mask-*` styles are in `MISSABLE_STYLES`: a bundle without them draws as +before, and has the miss `mask-image of a ::before or ::after in its own text colour` where such +a box shows (`maskUnknown`); on the 601 bundles of 2026-11-22 that was HexEditor and IcoEditor +alone, in both themes. `bench/mask.html` holds the idiom and the properties, 0.004% off in Edge +158. Not drawn: `mask-composite` other than add, `mask-border`, and a mask under a transform +other than a translation (reported). + +**An image keeps its element's `image-rendering`** (`rendering` in `snapshot-svg.mjs`, +2026-11-22): the `` that draws a canvas's picture, an `` or a background tile gets +`style="image-rendering:..."` unless the value is auto or smooth, and the `` inherits it. +ICO Editor shows its 48 px icon as a background of 100% of a 384 px box, pixelated; drawn smooth +it came out a blur, 3% of the picture mildly off and none strongly, so the bar passed it. +`image-rendering` is in `MISSABLE_STYLES`, with the miss `image-rendering of an image scaled up 2 +times or more` (`renderingUnknown`): a canvas's picture, an `` or a background of a given +size drawn at least twice its pixels in CSS px. A smaller scale is left out: every icon drawn at +its size is twice its pixels at device scale 2, and the code editor's canvases are at the +device's scale, so counting them would ask for a retake of nearly every picture with a code +editor. On the 601 bundles of 2026-11-22 the miss was IcoEditor's alone, in both themes. +`bench/image-rendering.html` holds a canvas pixelated, smooth and crisp, an `` and a +background, the same as Edge 158 to the pixel. + +**A textarea's text is set in the lines Chromium wraps it in** (`textareaBreaks` in +`capture.mjs`, `controlPieces` in `snapshot-svg.mjs`, 2026-11-22). A textarea wraps a line wider +than its content box (`white-space: pre-wrap` and `overflow-wrap: break-word` are Chromium's +defaults for one), and the snapshot says nothing about where. The converter drew each line as +one `` held to its measured width by `textLength`, so Data Explorer's Connection Settings +showed the ADO connection string squeezed into one line where the PNG has three +(DataExplorer_Settings, 0.32% strongly off, not written). Capture now asks the page, before +`textNeeds`, for each textarea that shows text: a copy of its value in a block as wide as its +content box less its scrollbar, with every style that decides a break, and a range over each +character, a line starting where a box is lower than the last. The bundle keeps the offsets as +`breaks`, only for a textarea with a soft break; a wrapped line is drawn without the spaces +it ends in, which hang past the edge. A bundle without `breaks` draws as before, and has the +miss `the line breaks of a textarea with a line wider than it` when such a line is at or above +the last line drawn and the textarea does not scroll across (a scroll width wider than the +client width means it is not wrapping: the keyboard-shortcuts JSON of Help_Find and +ManageKeyboardShortcuts, whose one long line is line 699). On the 601 bundles of 2026-11-22 +the miss was DataExplorer_Settings' alone, in both themes. `bench/textarea-wrap.html` holds a +monospace and a proportional textarea wrapped at spaces, one with a newline between wrapped +lines, a word longer than the box, a box with a scrollbar, one with `wrap="off"`, and Data +Explorer's own style (below): 0.025% off in Edge 158, none strongly. A value over 20,000 +characters is not read, and is drawn as its newlines break it. + +**A text control's half-leading above its text is floored to a whole px** (`paintTextControl`, +2026-11-22), as Chromium's `NGLineHeightMetrics::AddLeading` does, the rest going below. Data +Explorer's textareas set 13 px Consolas (15 px content area) in lines `18.85px` tall: 1 px +above the text, not 1.925, and every line of the SVG was 1 CSS px low (0.15% strongly off after +the wrapping fix, 0.008% with this). DOM text is not affected: its boxes come from the snapshot. +On the 601 bundles of 2026-11-22 it changed DataExplorer_Settings and confirm-merge (its commit +message textarea, 0.085% to 0.079% off dark, 0.042% to 0.041% light) and no other picture. +`bench/textarea-wrap.html` fails without it (0.128% strongly). + **Frames** (owner: cross-origin frames in general). A frame of the same site (the docked help pane: the documentation on another `localhost` port) is in the IDE's process, and `DOMSnapshot.captureSnapshot` returns its document beside the page's: the `