Commit Graph

1572 Commits

Author SHA1 Message Date
Martín Lucas Golini
b4e8f0312c Fixed the ProjectDirectoryTree ignore regression... 2026-08-21 19:22:39 -03:00
Martín Lucas Golini
e5057afe28 Fix indexing files added in new directories
Scan newly added directory subtrees even after the initial project scan has finished, ensuring their files are added to ProjectDirectoryTree and become available to the universal locator.
Preserve initial-scan cancellation, respect hidden-file settings and accepted patterns, and avoid inserting duplicate files.
2026-08-21 17:03:47 -03:00
Martín Lucas Golini
8eed5fcd58 Add configurable Tab Out support
Add an optional Tab Out behavior that moves a single cursor past configured trailing characters when pressing Tab. Expose the feature in Global Document Settings, keep it disabled by default, persist its configuration, and preserve existing selection and multi-cursor indentation behavior (SpartanJ/ecode#951).
2026-08-21 11:35:35 -03:00
Martín Lucas Golini
2895d771ab Fix builds and warnings in builds. 2026-08-21 10:51:20 -03:00
Martín Lucas Golini
864b2a9b3f Improve asynchronous filesystem event processing
- queue and batch filesystem model updates on the main thread
  - process directory-tree updates and worker-affine listeners asynchronously
  - coalesce adjacent modified events for the same path
  - preserve captured file metadata across delayed event delivery
  - add event, path, and thread-affinity filters for listener subscriptions
  - configure optimized per-plugin filesystem subscriptions
  - make listener removal wait for active callbacks safely
  - handle self-removal without deadlocking
  - support allocation-free matching of moved source paths
  - synchronize project directory-tree mutations with active searches
  - centralize diff-view button visibility around find/replace state
  - improve code editor wrap-content and scrollbar sizing
  - add queue, listener, and filesystem-model regression tests
2026-08-21 01:32:36 -03:00
Martín Lucas Golini
c13710dddc Fix status debugger panel serialization.
Fix UIWindow invalid min-size auto sizing.
Fix UIListView displaying horizontal scrollbar when wasn't necessary.
2026-08-20 17:12:25 -03:00
Martín Lucas Golini
9c794fc12f Fix FileSystemModel crash on stale filesystem-model indexes
- dispatch filesystem events on the main thread in FileSystemListener, preserving model, tree, document, and callback ordering
- add address + generation node identity to close the allocator-reuse hole
- return null/empty results for stale indexes instead of root data
- assert the main-thread contract and token-guard queued listener actions
- add attached-view and stale-selection crash regression tests

Fixes crash reported in discussion SpartanJ/ecode#952
2026-08-20 00:24:16 -03:00
Martín Lucas Golini
8448d579ab A few optimizations to not affect first-frame time by the models catalog load, now everything runs async. 2026-08-19 10:58:43 -03:00
Martín Lucas Golini
0287e83642 Damn, missed the latests changes:
Fix ACP Agent mode message chunks enqueue ordering issue (ACP thought chunks were enqueued twice while answer chunks were enqueued once).
2026-08-19 01:31:51 -03:00
Martín Lucas Golini
b02fc1f3a6 Add dynamic AI model catalog and reasoning controls
Fetch and cache the models.dev catalog asynchronously, replacing bundled model lists when catalog data is available while preserving local and user-configured providers.

Update live AI Assistant instances after refresh, defer startup requests until the UI is ready, and cancel in-flight catalog requests during shutdown. Prioritize providers with configured credentials and infer each provider's cheapest title-generation model from catalog pricing.

Add model reasoning metadata, effort controls, request serialization, chat persistence, and localized UI labels. Refresh the bundled fallback models and support API keys for arbitrary catalog providers.

Fix ACP Agent mode message chunks enqueue ordering issue (ACP thought chunks were enqueued twice while answer chunks were enqueued once).

Fix UIDropDownList WrapContent sizing so dropdown width follows its text, skin, and padding, and tighten UIDropDown automatic height sizing.
2026-08-19 01:30:56 -03:00
Martín Lucas Golini
01ebd7a82d Fix recursive directory removal across platforms
Add FileSystem::dirRemoveAll() to normalize trailing separators and use the non-throwing std::filesystem::remove_all overload.

Migrate ecode and unit-test cleanup call sites to the centralized helper, preventing Haiku from crashing when removing directories with trailing slashes during shutdown.
2026-08-18 13:37:56 -03:00
Martín Lucas Golini
1534253e54 Add cross-directory filesystem move support
- enable efsw cross-directory move reporting in ecode
  - transfer FileSystemModel nodes between materialized parents
  - preserve selections, descendant paths, and lazy destination branches
  - update open document paths when parent directories move
  - fix persistent indexes across insert, delete, and move operations
  - clear stale tree-view metadata before model nodes are deleted
  - safely handle getRealPath() failures for stale paths
  - add model operation and filesystem move regression tests
  - update efsw and SOIL2 submodules
2026-08-17 22:42:52 -03:00
Martín Lucas Golini
ffabb19d60 Add configurable OpenType font features to text rendering:
Support explicit liga, calt, clig, and dlig shaping features and include
  text hints in layout caching, measurement, drawing, and character
  position calculations.

  Propagate scene-wide font feature defaults through UI text producers,
  with granular widget overrides and recursive cache invalidation. Update
  UICodeEditor and UIConsole to use shaped positioning when font features
  are enabled, including with monospaced fonts.

  Add separate UI and editor font feature settings to ecode, persist them
  as comma-separated OpenType tags, and apply changes immediately. Add
  localized menu labels, reusable Text feature conversion helpers, and
  regression coverage for shaping, positioning, propagation, and parsing.
2026-08-15 02:21:11 -03:00
Martín Lucas Golini
c1034fa87e Change command name from "monospace-font" to "editor-font". 2026-08-14 16:26:52 -03:00
Martín Lucas Golini
1b901eaa02 Fix external font handling in UIFontPickerDialog
Preserve explicitly selected font styles and correctly reconcile external fonts with the asynchronously loaded system font list.

Group same-family external fonts under the Style column when styles are visible, and expose them as distinct family entries when styles are hidden. Include filenames in localized external-font labels to distinguish alternate
font versions.

Ensure system-listed regular faces remain available after asynchronous loading and add regression coverage for collisions, selection, and hidden style behavior.
2026-08-14 13:52:55 -03:00
Martín Lucas Golini
bf750761ae ecode: add customizable debugger panel layouts
- add a reusable right-side panel managed at the application level
  - migrate debugger tabs to UITabWidgetSplitter instances
  - support moving and splitting debugger tabs across bottom and right panels
  - restrict debugger tab drops to debugger-owned panel targets
  - serialize debugger tab layouts, panel state, and table column widths
  - add pixel and percentage column-width modes to UIAbstractTableView
  - support XML/CSS configuration and an optional width-mode context menu
  - preserve percentage totals across resizing, fit-to-content, minimum widths,
    scrollbar changes, and pixel-density rounding
  - add splitter edge hiding while preserving splitter-always-show precedence
  - use EventConnection ownership for safe widget and controller lifetimes
  - validate serialized splitter layouts with structural limits
  - display project-relative source paths in debugger stack frames
  - add ecode localization strings, CSS documentation, tests, and agent rules
2026-08-14 00:17:29 -03:00
Martín Lucas Golini
a2c9adca9a Optimize allocations in project saving and editor rendering
Refactor IniFile storage to keep keys and values in unified SmallVector-backed
records, avoiding parallel vector growth and allocations for common small
configurations.

Use std::string_view by value throughout the IniFile input API to prevent
temporary std::string allocations for keys, value names, paths, and comments.
Write serialized components directly to streams instead of constructing a
temporary string for every line.

Return ProjectBuildConfiguration by const reference to avoid copying it during
project saves, and use inline storage for DocumentView visual lines to avoid
heap allocations while rendering the code editor minimap.

Add IniFile tests covering parsing, mutation, ordered serialization, and a
byte-for-byte ecode project-state round trip.
2026-08-13 16:03:04 -03:00
Martín Lucas Golini
74d9fa660c ecode: add multi-file Git status operations
Enable multiple selection in the Git status tree and apply stage, unstage, discard, open, and diff actions to all applicable files.
Open selected diffs in a single multi-file diff view, including portable handling for untracked files, and group mutating operations by repository.
Make the commit dialog resizable, allow its text editor to grow with the window, and wrap commit messages by word.
2026-08-12 00:03:25 -03:00
Martín Lucas Golini
953b0ecb03 Remember Project Tree View "Show Hidden Files" state between sessions. 2026-08-11 20:01:36 -03:00
Martín Lucas Golini
6ba7de31d5 Added "Open Folder" button to the take screenshot notification. 2026-08-11 17:51:31 -03:00
Martín Lucas Golini
4789bfb5f9 ecode: add configurable screenshot support
Add an unlocked take-screenshot command and expose it under Settings -> Window with a default Print Screen binding.

Allow configuring the screenshot destination, filename pattern, and output format. Save screenshots under the ecode configuration directory by default, notify users after capture, and provide an action to open the result in the integrated image viewer.

Addresses a request in SpartanJ/ecode#950.
2026-08-11 15:43:22 -03:00
Martín Lucas Golini
6df0c0738f Add font size selection to ecode font picker:
Allow UIFontPickerDialog sections to be hidden and make ecode's UI, editor, and terminal font dialogs select both the font and its size.
Keep external fonts selectable across asynchronous font enumeration, including when they share a family name with a system font, and label them as external. Also normalize UILinearLayout weights across visible children so hidden picker columns release their space correctly.
Update font picker previews, size units, menu labels, translations, and lifetime handling.

Addresses SpartanJ/ecode#944.
2026-08-11 12:38:34 -03:00
Martín Lucas Golini
10a5d7effc ecode: Enable line-wrap by default on new installations.
Added Code of Conduct and Contributing documents.
Added templates for bug reports and feature requests.
2026-08-10 21:13:16 -03:00
Martín Lucas Golini
23cf9084ce perf: reduce allocations across UI and editor hot paths
- reuse formatting, document text, property resolution, and layout storage
  - use inline containers for interpolations, callbacks, wrapping, and matcher state
  - optimize single-line insertion by mutating document lines without splitting
  - iterate PATH entries directly in Sys::which and reuse candidate buffers
  - avoid temporary clocks and string copies in frequent ecode plugin updates
  - retain documents during autocomplete cache jobs and prevent duplicate scheduling
  - fix PatternMatcher copy assignment and MSVC move-only container compilation
  - expand coverage for matching, text insertion, reusable strings, and Sys::which
2026-08-09 21:38:17 -03:00
Martín Lucas Golini
5f419ca58d Reduce allocations in CSS parsing and style updates
- reuse reentrant property-resolution storage during variable substitution
  - skip redundant resolution-slot copies using structural source comparison
  - retain variable cache capacity and resolve variables in place
  - avoid copying canonical names for definition-backed properties
  - propagate resolved inherited properties by reference through widget trees
  - parse animation and transition declarations with allocation-light string views
  - share declaration tokenization between animation and transition parsers
  - avoid empty animation-map and action-query allocations
  - parse border radii without temporary split vectors
  - accept string views when converting UI lengths
  - format color hex values directly without string streams
  - use inline storage for small polygon point collections
  - preserve animation parsing semantics and fix longhand direction handling
  - save eeiv configuration when closing through keyboard shortcuts
  - extend animation, variable-resolution, property-name, and color tests
2026-08-09 19:22:00 -03:00
Martín Lucas Golini
482833d95f * Fixed the crash in src/tools/ecode/globalsearchcontroller.cpp:603.
Probable reproduction:
  1. Open global search.
  2. Enter a search term.
  3. Start “replace in files” with Mod+R.
  4. Before the asynchronous search finishes, switch to document search.
  5. Immediately reopen normal global search.

The replace tree becomes active as soon as the search starts, but its model is only assigned when the asynchronous result arrives. Reopening normal global search tried to reuse that still-null model and called rowCount() on it. The loader is also closed during this transition, explaining the SceneNode::checkClose() trace from another timing of the same sequence.

The fix:
- Only transfers replace results when the replace model exists.
- Adds a defensive null check to updateGlobalSearchBarResults().
2026-08-09 01:02:46 -03:00
Martín Lucas Golini
b6cdc83818 ui: add typed value conversion errors
Replace boolean output-parameter converters with UIValueResult so conversion failures can provide numeric codes and optional diagnostics without exposing partially converted values.
Expose observable converter error state from UIDataBind, UIProperty, and UIValueBinding.
Reject invalid widget input without changing the model or propagating it to sibling widgets, while keeping programmatic model updates authoritative.
Migrate ecode's custom output parser converter, expand binding tests, and document the data-handling architecture and next form-validation
phase.
2026-08-09 00:52:00 -03:00
Martín Lucas Golini
01d5614a71 ui: add scoped event and observable value bindings
Introduce EventConnection and EventConnectionList for scoped Node event listeners that safely handle either emitter or observer destruction order.

Add ObservableValue and UIValueBinding for UI-independent observable state, along with a shared UIValueConverter policy used by both observable and raw data bindings.

Harden UIDataBind and UIProperty lifetime behavior, documentation, conversion, operators, and multi-widget handling. Preserve UIProperty as the lightweight option for UI-local owned values and UIDataBind for explicitly managed external values.

Use inline ordered callback storage to preserve registration-order dispatch without per-listener tree allocations.

Migrate submenu observation to scoped connections, safely clear ecode run configuration bindings before model erasure, and simplify the 7GUIs Counter example with UIProperty.

Add lifecycle, ordering, conversion, binding, and mutation regression tests.
2026-08-08 20:28:45 -03:00
Martín Lucas Golini
ea44f9f0f7 ecode: defer top-level settings menus to first show - Settings sub-menus were built eagerly on the startup critical path. Defer each top-level menu (Edit, Terminal, Tools, Window, Help, Document, View, Project) to its first OnMenuShow, following the existing lazy-submenu pattern: an empty placeholder is populated on first show and reloadStyle'd so it sizes correctly before positioning. Measured with Superluminal: settings-menu construction dropped from ~22.7ms to ~3.6ms, cutting launch time from 125ms to 107ms minimum (on my old AMD 3900X). 2026-08-07 00:05:06 -03:00
Martín Lucas Golini
0c6e14b9a4 Should fix MSVC build. 2026-08-06 10:24:23 -03:00
Martín Lucas Golini
afb2d44bda core: extend debug allocation tracing and reduce render-time allocations
- intercept global new/delete operations in debug memory-manager builds
  - distinguish anonymous global allocations from source-tracked leaks
  - modernize eeNew to support constructor-expression syntax
  - improve memory reports with tabulated leaks and separate largest allocations
  - cache autocomplete shortcuts instead of hashing string keys on key events
  - reuse UIStyle property sets across state changes
  - reuse Text shadow colors and avoid temporary outline-color copies
  - use inline storage for temporary linear-gradient rendering data
  - make unit tests resolve assets from the executable directory
  - add memory-manager and PropertyIdSet regression coverage
2026-08-05 11:02:35 -03:00
Martín Lucas Golini
445aac792d Fix CSS auto margins for replaced HTML elements
Model HTML images as replaced UIHTMLWidget elements with independent loading, sizing, and rendering behavior.

Resolve auto margins according to each element's formatting context, including normal-flow blocks, positioned elements, flex items, and grid items. Preserve intrinsic sizing for block-level images with width:auto and constrain them through CSS min/max dimensions.

Correct absolute-positioned containing-block coordinates and rich-text handling of atomic inline elements. Add regression coverage for centered images, deferred image loading, grid margins, positioned elements, and document flow after image loading.

Document the remaining work required for dynamically changing non-atomic inline elements.

Avoid saving eeiv configuration during destruction (fixes window state saving).
2026-08-04 13:32:22 -03:00
Martín Lucas Golini
bfe72a439b Optimize compile times by isolating chrono usage
- move chrono implementation details out of the public Clock header
  - define Sys system time as Unix epoch milliseconds
  - add getUnixTimestamp() for epoch timestamps in seconds
  - replace chrono wall-clock usage in ecode plugins with Sys APIs
  - update existing Sys time callers for the new millisecond contract
  - remove redundant chrono inclusion from HTTP tests
  - remove the completed user-defined snippets plan

This prevents chrono and std::format internals from being instantiated across large portions of the project while preserving timestamp precision.
2026-08-03 00:10:00 -03:00
Martín Lucas Golini
48b7e7c21f ui: improve HTML inline layout and old Reddit rendering
- implement per-side CSS border styles and patterned rendering
  - preserve rectangular rasterization for thin dotted borders
  - separate CSS and native-widget border defaults
  - correct inline atomic-box and vertical-align baseline layout
  - collapse adjacent block margins in rich-text flow
  - preserve forced line breaks and formatting margins
  - size HTML text inputs from font ascent and descent
  - expose replaced-control text baselines to inline layout
  - enforce single-owner painting for inline backgrounds and borders
  - enable and update the old Reddit visual regression golden
  - add generic layout, border, and form-control regression tests
  - document spec-first HTML work and project build conventions
2026-08-02 17:48:53 -03:00
Martín Lucas Golini
fe8417bdc7 Fix debugger crash when attaching to a PID: Guard against dereferencing an empty debugger command and use stdio for local PID attachments unless socket transport is explicitly requested. 2026-08-01 23:32:48 -03:00
Martín Lucas Golini
da4d201eeb Implemented both opt-out settings for vscode config load, although enabled by default:
```json
  // autocomplete.json
  {
    "config": {
      "load_vscode_snippets": false
    }
  }

  // debugger.json
  {
    "config": {
      "load_vscode_launch_config": false
    }
  }
```

Disabling them affects only .vscode imports. Personal/.ecode snippets and .ecode/launch.json continue loading normally.

Refs SpartanJ/ecod€#111
2026-08-01 01:38:14 -03:00
Martín Lucas Golini
24302ec9f1 eterm: Use usable bounds instead of display bounds for window sizing. 2026-08-01 00:41:19 -03:00
Martín Lucas Golini
14207f228b eepp: Fixed a crash on single click navigation when selecting folder or file in UIFileDialog.
eeiv: Add drag & drop of images and folders. Added small welcome screen.
eterm: Detect windows below the default width and height and resize the window to fix the screen.
2026-08-01 00:31:55 -03:00
Martín Lucas Golini
13508c20d1 UIImageViewer expanded capabilities.
ecode image viewing will not auto-scale images to the pixel density.
eeiv: Modernizing eeiv to use eepp GUI, already working just like before, there are probably a few things to fix.
2026-07-31 01:25:41 -03:00
Martín Lucas Golini
51ceff9b08 Move eeiv to the main repo, I'll start modernizing the tool. 2026-07-31 00:04:21 -03:00
Martín Lucas Golini
1dc8195187 - add a searchable Insert Snippet Universal Locator provider
- support runtime locator provider registration and removal
- filter snippets with workspace-relative include/exclude globs
- add the remaining VS Code-compatible snippet variables
- support camelcase, pascalcase, snakecase, and kebabcase modifiers
- reuse the existing insertion flow for locator-selected snippets
- expand snippet parser and store test coverage
- update the implementation plan and C/C++ example snippets

Refs: SpartanJ/ecode#111
2026-07-29 18:49:01 -03:00
Martín Lucas Golini
683b35b249 feat(ecode): add VS Code-compatible user snippets
Add user-defined snippet support to the autocomplete plugin, including
language-specific, global, .vscode, and .ecode project snippets.

Support JSONC parsing, scopes, hot reload, source-aware ranking, exact
prefix replacement, multi-cursor insertion, contextual indentation,
variables, transforms, choices, linked placeholders, and tab navigation.

Recognize .code-snippets files as JSON and preserve existing LSP snippet
completion behavior.

Refs SpartanJ/ecode#111
2026-07-29 01:11:01 -03:00
Martín Lucas Golini
acd19069c3 Add table/tree view CSS properties, UIModelCreator, and optimize string allocations
- Add CSS properties: editable, selection-type, selection-kind, icon-size,
  sort-icon-size, main-column, row-header-width, table-flags (pipe-separated),
  indent-width, expander-icon-size, table-model
- Create UIModelCreator static factory with 4 built-in models:
  widgettree, filesystem, diskdrives, cssproperties
- Eliminate 17 heap-allocating std::string copies in applyProperty()
  handlers across 12 files using String::iequals with const refs
- Replace table-flags token parsing with allocation-free String::splitCb
- Update cssspecification.md with all new property documentation

Fixed fall-through bugs in applyProperty.
Fixed status terminal button "Terminal" not setting the tooltip text correctly.
2026-07-28 00:15:04 -03:00
Martín Lucas Golini
a113c0f6c9 Rename FrameBufferRegistry, ShaderProgramRegistry and VertexBufferRegistry file names.
Rename class and file of PackManager to PackRegistry to follow the new naming convention.
2026-07-26 23:16:24 -03:00
Martín Lucas Golini
9f4ae9e83c Font SubPixel antialiasing support for eterm and ui_html. 2026-07-25 21:24:45 -03:00
Martín Lucas Golini
27a57960f4 SubPixel hinting support. 2026-07-25 18:59:20 -03:00
Martín Lucas Golini
b940407102 ecode: The custom fallback font reused the "fallback-font" resource key, replacing the built-in CJK fallback in FontService.
Fix:

  - User fallback now uses "user-fallback-font".
  - Built-in CJK and custom fallback fonts remain registered together.
  - Added and passed a regression test verifying both fallback resources remain in the chain.

Fixes in premake5.lua:

  - Removed obsolete PRECISE_F32=1; Wasm already provides precise float behavior.
  - Moved ENVIRONMENT=worker,web to final application link options.

Fixed MarkdownView not getting the correct CSS style from the base theme.
2026-07-25 01:36:00 -03:00
Martín Lucas Golini
caa461a735 complete scoped ownership migration
- migrate themes, skins, icons, shaders, and shader programs to resource handles
  - make UIThemeManager scene-owned and publish resources through scopes and catalogs
  - retain shaders through their programs and expose non-owning GPU registries
  - replace FrameBuffer and VertexBuffer factory ownership with unique pointers
  - migrate engine, UI, tools, examples, tests, and eterm to the new ownership APIs
  - remove the obsolete raw-owning ResourceManager templates
  - document the completed Stage 7 architecture and remaining validation work
  - add ownership, registry, and scoped shader-program coverage
2026-07-24 22:45:31 -03:00
Martín Lucas Golini
6b277e508b migrate fonts to scoped resource ownership
- replace FontManager with per-ResourceScope FontService instances
  - publish font factories into explicit or default resource scopes
  - import default resources into UI scene scopes unless explicitly disabled
  - keep related font faces strongly owned without hot-path weak_ptr locking
  - add cached glyph advance queries without creating texture pages
  - fix font picker preview ownership, cleanup, and rapid switching
  - selectively evict TextLayout cache entries when referenced fonts unload
  - document FontService, ResourceCatalog, and cache invalidation semantics
  - migrate examples, tools, benchmarks, and tests to the scoped font API
  - expand coverage for font ownership, texture release, and layout caching
2026-07-24 01:54:51 -03:00
Martín Lucas Golini
373bd40e59 migrate texture atlases to scoped ownership
- replace TextureAtlasManager and GlobalTextureAtlas with catalog-backed atlas ownership
  - make TextureAtlas and TextureRegion creation return explicit resource handles
  - let atlases retain their textures and regions through shared ownership
  - add atlas publication, lookup, removal, and enumeration to ResourceCatalog and ResourceScope
  - make TextureAtlasLoader publish atlases and regions into an explicit resource scope
  - move theme atlas ownership into each theme resource catalog
  - migrate maps, editors, examples, and tests away from the global atlas manager
  - add scope-aware Sprite pattern-loading overloads while preserving default-scope compatibility
  - fix re-entrant style-state invalidation when applying styles creates new widgets
  - add atlas ownership, scoped Sprite lookup, and style-state regression coverage
  - update the resource ownership plan and texture atlas editor launch configuration
2026-07-23 01:41:11 -03:00