8 Commits
Author SHA1 Message Date
Martín Lucas Golini 00999e26c3 Queue HTTP connection waits, add a socket budget and cancel on shutdown
Requests that hit a connection limit used to wait inside their worker,
polling every 10 ms, and an async request's timeout included that wait.
On a page with many resources from one origin, later requests timed out
while queued, and waiting requests tied up shared thread-pool workers
that other origins needed.

Connection queue:
- Serve blocking and async requests from one first-come, first-served
  queue per pool. Requests waiting on one origin's limit never block
  requests to other origins.
- In shared thread-pool mode, an async request runs on a worker only
  after it has been granted a connection. Grants are handed to the
  executor from a service thread, never from the thread releasing a
  connection, which could be inside the executor's own lock.
- Requests hold their executor only weakly, so a request can never be
  the last owner of the thread pool running it.
- Start an async request's timeout once it holds a connection. A
  blocking call's timeout still covers the wait plus the transfer, and
  a resumed download keeps its deadline across the HEAD probe.
- Wait on a condition variable instead of polling. Cancelling by ID,
  shutdown() and Pool::close() release queued requests immediately.
- Let running requests and blocking callers take over a slot reserved
  for queued work that has not started; that work queues again, first
  in line. Without this, a redirect, retry or resumed download on a
  busy executor could wait forever on slots reserved behind it.
- When queued work starts, switch to a connection that went idle while
  it waited, instead of opening a new one.
- Replace an idle connection the server has closed in place, keeping
  its slot.

Process-wide limit and idle expiry:
- Limit open sockets across all pools with
  Http::setMaxOpenConnections() (default 256). At the limit, close the
  least recently used idle socket in any pool, then a socket held for
  queued work, and only wait while every socket is in active use.
- Wake waiters on the limit when a socket goes idle, and recheck a
  change counter so a wake-up just before waiting is never missed.
- Only inspect a socket for reclaim once its connection is known to be
  idle or reserved, never while a request is using it.
- Close idle connections from a background timer when idleTimeout
  elapses, instead of only when a connection is next requested in the
  same pool.
- The budget and its service thread are intentionally never destroyed,
  so the thread is never joined during static destruction, which would
  deadlock under the Windows loader lock.

Shutdown:
- Add Http::cancelAllRequests(), which cancels every queued and running
  request in every pool and closes idle connections. A per-pool
  generation counter makes running requests stop at their next check,
  and the pools stay usable afterwards.
- Add Http::waitForConnectionsToClose().
- Engine cancels all requests as it starts shutting down. Once its
  windows are closed, it waits up to 100 ms for sockets to close before
  ending TLS.
- Check for cancellation every 25 ms instead of 100 ms while reading, so
  requests stop within that wait.

TLS:
- SSLSocket::end() now waits while TLS sockets exist: the last socket
  destroyed releases the backend, and a socket created in the meantime
  keeps it.
- Set up the backend and register a new socket a
  lock, so a concurrent end() cannot release the backend in between.
- Add SSLSocket::isInitialized() and a testing h
  socket construction.
2026-10-15 00:36:56 -03:00
Martín Lucas Golini a7ca505229 Add bounded HTTP/1.1 connection pooling for browser sessions
Replace thread-local connections with owned pools shared across workers.
Bound total and per-origin connections, expire idle sockets, and check
idle connections before reuse. Retry safe requests after stale-connection
races without replaying POST requests.

Fix response framing, chunk trailers, decompression completion, empty
compressed bodies, and handling of bytes beyond completed responses.

Give each WebResourceCache partition its own transport, preserving
connections across navigation and shared tabs. Close session transports
without blocking the UI thread. This substantially improves browsing
performance in the ui_html example.

Preserve every Set-Cookie field and attribute redirect cookies to the
client that received the response. Prevent rejected redirects from
assigning cookies to their destination.

Add regression coverage for pooling, framing, cancellation, TLS policy
isolation, browser sessions, and redirect cookie attribution
2026-10-14 21:05:40 -03:00
Martín Lucas Golini ccb03a3b8e Add inherited RTL direction and logical UI layout support
- Cache effective direction and skip unchanged subtree propagation.
- Add logical alignment, box edges, and relative positioning.
- Mirror layouts and controls while preserving logical node order.
- Apply inherited base direction to UI text and editing.
- Keep logical-edge storage lazy and compact.
- Add regression tests, an isolated WebView demo, and RTL documentation.
- Document RichText bidi limitations and plan paragraph-level support.
2026-10-11 12:29:16 -03:00
Martín Lucas Golini 9d8ec467cf Modernize UI Editor with isolated previews and UIApplication
- Reimplement previews using nested UISceneNodes with isolated styles
  and resources.
- Preserve live XML/CSS editing, unsaved buffer previews, external file
  watching, and project resource loading.
- Use UIApplication for initialization, font resolution, and offscreen
  rendering support.
- Enable Breeze by default, add a menu toggle, and replace
  --use-app-theme with --disable-app-theme.
- Automatically preserve declared project viewport dimensions, with
  an optional override to use the preview split size.
- Support embedded HTML documents inside WebView XML elements.
- Fix fading window shadows and shutdown with visible modal dialogs.
- Update documentation and add regression coverage.
2026-10-07 14:02:56 -03:00
Martín Lucas Golini d49fe3fdc8 Add date and time pickers with calendar popups and HTML mappings
- Add CalendarDate, TimeOfDay, LocalDateTime and DateRange with Gregorian
  arithmetic, locale-aware formatting/parsing, ISO serialization and Unix
  timestamp conversions with explicit UTC offsets.
- Add UIDateTimeEdit, UIDatePicker, UITimePicker, UIDateTimePicker and
  standalone UICalendar, with XML/CSS registration and data binding.
- Support segmented keyboard editing, numeric entry, ISO paste, configurable
  steps, bounds, empty values and independent seconds/milliseconds display.
  Default time display to hours and minutes while preserving stored precision.
- Add day/month/year calendar navigation and a combined date-time popup with
  time steppers, live configuration updates and scoped event connections.
- Add Breeze and fallback theme styles with CSS-defined SVG icons, dp sizing,
  font-aware calendar dimensions and muted read-only/disabled controls.
- Map HTML date, time and datetime-local inputs to native controls with strict
  value sanitization, min/max/step/required/readonly/disabled handling,
  constraint validation and normalized form serialization.
- Provide private light HTML control defaults and intrinsic temporal sizing;
  prevent author CSS from styling anonymous implementation parts.
- Share popup placement and visibility helpers across pickers, dropdowns and
  trigger/cursor menus while retaining cascading-menu placement rules.
- Fix fractional grid wrapping and input cursor bubbling over child buttons;
  notify and refresh styles when editing permission changes.
- Reduce CSS registration allocations with string_view parameters and
  heterogeneous name lookup; inline frequently used node and CSS getters.
- Align CodeEditor default font sizing with text widgets without overriding
  application preferences.
- Add HTML form margin defaults and update the affected rendering baseline.
- Upgrade Windows ecode nightly builds to Ubuntu 24.04 and newer MinGW.
- Add picker documentation, an example and regression coverage for date math,
  locales, editing, popup placement/lifetime, HTML controls and pixel density
2026-10-06 01:13:44 -03:00
Martín Lucas Golini 98e9213f4d Add local Markdown navigation and persistent ecode previews and fix terminal selection bounds and vertical auto-scroll
- Follow local Markdown links relative to each document, including
  relative file:// paths, with configurable handling and async loading.
- Add validated subtree navigation interceptors and custom link flows.
- Introduce UIScrollableMarkdownView with XML support and scroll reset
  after successful navigation.
- Add opt-in Back/Forward history, localized context menu actions, and
  mod+[ / mod+] shortcuts; enable history in ecode previews.
- Restore preview tabs between sessions and preserve live editor binding
  and unsaved source content when navigating back.
- Refresh the README around eepp's GUI framework and document the new APIs.
- Remove the fixed Markdown code font size and add regression coverage
- Clamp selection coordinates independently so horizontal dragging preserves
  the selected row. Use the mouse event's Y coordinate against the terminal's
  vertical bounds, including padding, and retain unclamped coordinates during
  periodic updates outside the window.
2026-10-05 00:12:07 -03:00
Martín Lucas Golini a8eb1834eb Add tabbed HTML browsing and extend eepp navigation and input support
eepp framework:
- Add shared cookie jars to UISceneNode and UIWebView, plus versioned
  CookieManager persistence, domain clearing, and locking in hasCookie().
- Follow HTTP 303 redirects and merge same-host redirect cookies as
  name/value pairs without forwarding Set-Cookie attributes.
- Include Cookie headers in document cache keys while preserving static
  resource reuse as cookies change.
- Submit HTML forms with an empty action to the current document URL.
- Extend NavigationRequest with source, mouse buttons, modifiers, and
  navigation target; anchors forward this context to the scene.
- Emit OnLinkOpenRequested for middle-click, platform-modifier click,
  and explicit new-tab requests, with current-view fallback if unhandled.
- Install the WebView navigation interceptor during construction.
- Dispatch middle clicks to the hovered node without moving keyboard focus.
- Add the clicked target to ContextMenuEvent so applications can extend
  context menus through existing events.
- Parse HTML titles, emit TitleEvent, and fix onTitleChanged's payload cast.
- Load declared favicons through the shared image cache, emit
  OnFaviconChanged, and ignore responses from superseded navigation.
- Add optional UITabWidgetSplitter tab-bar visibility while split;
  keep it disabled by default and respect explicitly hidden tab bars.
- Add Space/Shift+Space scrolling and viewport-sized Page Up/Down steps
  to UIScrollView, shared by WebView and Markdown content.
- Implement setEnableDefaultKeybindings() and preserve text-input
  priority through normal bubbling without control-type checks.
- Report inserted UICodeEditor text as handled.
- Add UITextView::onFontColorChanged() and synchronize password-mask color.
- Support validated left, middle, and right clicks in the inspector
  server and Python client.

ui_html example:
- Use UITabWidgetSplitter for tabs and user-controlled splits.
- Share cookies and the resource cache across tabs; persist cookies
  between sessions and open new tabs blank.
- Add Inspect, Clear Domain Cookies, Clear All Cookies, and contextual
  Open Link in New Tab actions through menu event subscriptions.
- Open requested links in background tabs and synchronize navigation UI.
- Use document titles and 16dp favicons for tabs, cap width at 200dp,
  and truncate long titles with ellipsis.
- Enable tab-bar visibility across split panes.
- Fixed: the selection rectangle now uses the visible password symbols instead of the original text.

Update HTML compatibility and inspector documentation and add regression
coverage for persistence, redirects, cache isolation, navigation, menus,
titles, favicons, password colors, split visibility, and scrolling.
2026-09-29 18:58:51 -03:00
Martín Lucas Golini ee0d9378ad Expand UI documentation and refine link context menus
Add guides for native UI authoring, layouts, application CSS, and HTML
compatibility. Update the CSS reference, rename article files consistently,
and point README links to the local guides.

Add Copy Link for HTML and Markdown anchors when no text is selected.
Resolve relative links against the document URI before copying, and cover
Markdown and WebView behavior with tests.

Fix layout width policy serialization to use the widget's width.
2026-09-28 19:20:34 -03:00