Introduce elevation, shape tokens, and notebook panel enhancements - #96
Merged
Conversation
Add a ThemeElevation type and wire an elevation scale through ITheme, ThemeProvider, and the theme DTOs (Elevation is optional for backward compatibility). Introduce shape (ShapeSmall/Medium/Large/Full) and shape/elevation tokens, plus new color tokens AccentForeground, BgSunken and FgSubtle; update ThemeSpacing (toolbar height, shape sizes, cell/button radii). Emit the new --verso-elevation-* and --verso-shape-* CSS variables and update LayoutThemeBundle to include shape/elevation tokens. Revamp app.css to consume the new variables (use accent foreground, shape radii, elevation shadows, overlay/dropdown variables) and add styles for panel toggles. Add panel toggle UI and parameters to the notebook toolbar component. Update docs and tests to reflect the new tokens and behavior. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
Introduce first-class support for notebook-side panels. Adds new abstraction interfaces (INotebookPanel, IPanelInteractionHandler, IPanelContext) and the PanelInteractionContext model so extensions can declare panel content (ordered RenderResult representations) and receive panel actions. Wire host-side rendering and interaction: new Blazor component ExtensionPanelHost, toolbar integration to show panel toggles, panel icon mapping (PanelIcons), host panel list (HostPanels), and panel display-name handling. Add JS interop (panel-interact-interop.js), host DTO/handler (PanelDto, PanelHandler) and protocol updates, plus tests and docs (docs/extensions/panels.md and updates to extension-interfaces.md and index.md). These changes enable extensions to contribute panels alongside the notebook body and handle user interactions, including a RequestRefresh mechanism to re-render panels when state changes. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
Introduce notebook comparison UI and plumbing: add a ComparePanel component and NotebookComparison model to drive baseline selection and a change list, plus a ViewPanel/Compare workflow to keep the notebook visible while walking changes. Propagate diff state into the cell rendering (NotebookCellContext, DefaultCellList, CustomLayoutHtml, Cell.razor) so cells show colored stripes and badges for Added/Removed/Modified/Moved, and wire navigation from the panel to reveal cells. Enhance the full diff overlay (NotebookDiffView) with an empty state, stepper nav between changes, anchors for entries, and improved disclosure chevrons. Add accessibility/tooltips (aria-label, data-verso-tip, data-verso-tip-desc) across many buttons and dialogs and include a tooltip.js asset and CSS tweaks. Update extension and panel abstractions/docs to clarify Description usage for icon-only controls and add new icon names (layout, compare); update user guides to reference the View panel and Compare panel. Add/adjust unit tests for the new panels and diff behavior. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
Add editorsSized helper to check that all Monaco editor host elements in a cell have their inline height set, and update scrollToSelected to wait until a cell is both placed (not in the hidden pool) and sized before calling scrollIntoView. Preserve a retry cap (~3s) and fall back to scrolling if the cell is placed but never measured. This prevents scrolling to an element while its editor later grows and ends up positioned out of view. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
Redesign the Extensions panel into a single package list with install state on each row and context chips (install scope and package sources). Improve row UI (tile, publisher, description, download counts, capability chips, state badges) and behaviour for unavailable/removed packages. Add MarketplaceRow helpers, sorting/filtering, tint/initial utilities, and pluralization for capability names. Surface package capabilities in InstalledExtensionDto and add MarketplaceSources to INotebookService. Update version selection API and install/uninstall flows to record removals for the session and refresh results. Large CSS refactor to support the new layout and styles. Tests adjusted to cover the updated UI and service changes. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
Add support for showing package icons in the extensions marketplace UI and ship a small package icon with the product. Changes include: - UI: render an <img> overlay inside the lettered tile when an icon is available and prefer a local data: URI for installed packages over the feed's icon URL. - Styling: position and style the tile and absolute icon (.verso-marketplace-tile-icon) so the icon covers the tile but the letter remains underneath as a fallback. - Models/DTOs: propagate an IconDataUri property through service DTOs and host DTOs so the server can supply an inlined icon for installed packages. - Server/Services: NuGetMarketplaceService now extracts and caches package icons from packages, copies icons to the managed install dir, and exposes TryReadPackageIconDataUri to return a data: URI (with media-type sniffing and size limits). Package resolver extracts icon from package archives into the cache and exposes a cached-path lookup. - Safety/resilience: icon handling is best-effort and never fails installs; content-type is detected from bytes (png/jpg/gif), and size limits prevent inlining huge images. - Packaging: include a small verso-mark.png as the package icon and add it to Directory.Build.props so it is packed with the nuget. - Tests: add unit tests validating icon extraction, media-type sniffing, size limits, version selection, and UI behavior for installed/search results. These changes enable offline/sideloaded icon display, avoid network fetches for installed packages, and provide graceful fallback when icons are missing or invalid. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
SummarySummary
CoverageVerso - 79.1%
Verso.Abstractions - 81.9%
Verso.Ado - 84.1%
Verso.Blazor - 26.4%
Verso.Blazor.Shared - 62%
Verso.Cli - 39.1%
Verso.FSharp - 82.8%
Verso.Host - 55.2%
Verso.Http - 80.2%
Verso.JavaScript - 52.4%
Verso.PowerShell - 63.8%
Verso.Python - 76.6%
Verso.Sample.Diagram - 80.1%
Verso.Sample.Dice - 82.1%
Verso.Sample.Slides - 58.8%
Verso.Sample.Sparkline - 67.3%
Verso.Testing - 80.5%
|
Add an in-memory cache for package icon data URIs to avoid repeated disk reads on render paths. Introduces IconDataUriCache (ConcurrentDictionary), IconCacheKey, ReadPackageIconDataUri and InvalidateIconCache; uses GetOrAdd in TryReadPackageIconDataUri and invalidates entries after installs. Also adds System.Collections.Concurrent using and tests verifying cached hits, cached misses, and separate entries for pinned vs unpinned lookups. Signed-off-by: Torrey Betts <torrey.betts@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces major improvements to the Verso extension authoring documentation and package metadata, focusing on the addition of a comprehensive guide and reference for panels (
INotebookPanel), updates to the theme token documentation, and minor corrections to package properties. The most important changes are grouped below:Panel Feature Documentation and Reference:
panels.md, detailing how to contribute panels to the notebook UI, including the representation contract, icon usage, interaction handling, and CSS class vocabulary.extension-interfaces.mdto document the newINotebookPanelandIPanelInteractionHandlerinterfaces, including their members, lifecycle, and usage patterns.Theme and Layout Documentation:
layouts.mdto include new background, foreground, accent, shape, and elevation variables, and explained their usage for consistent theming across hosts. [1] [2]Package Metadata Improvements:
verso-mark.png) toDirectory.Build.props, including documentation on icon requirements and packaging. [1] [2]Other Documentation Enhancements:
Descriptionproperty for extensions and toolbar actions, emphasizing its role in tooltips and accessibility. [1] [2]These changes provide a clearer, more complete reference for extension authors, especially regarding the new panel capability and theming support.