CoreBox Window Behavior & UI View Cache
CoreBox Window Behavior & UI View Cache
CoreBox height & resize
CoreBox height is driven by the renderer result list and applied in the main process.
- Window position stays fixed (only height changes).
- When window resize animation is enabled, bounds changes are animated in the main process.
Related settings
appSetting.animation.coreBoxResizetrue: animate CoreBox bounds changesfalse: apply bounds immediately
Recommendations on empty input
When input is empty and no providers are active, CoreBox requests recommendations from the main process.
To avoid “flash collapse” while recommendations are still in-flight, the renderer keeps a pending flag until a response arrives (or a short timeout).
AutoPaste / AutoClear (CoreBox show phase)
AutoPaste
- Only fires automatically when CoreBox is opened by its shortcut. Explicit pastes and plugin actions the user triggers keep manual semantics.
- Freshness is decided by
autoPaste.time(seconds):0means no limit,-1disables it. Implicit input fill, clipboard tags and query input all pass through the same gate. - The main process supplies
autoPasteEligible,observedAtandfreshnessBaseAt; the renderer's visibility, clipboard and search hooks reuse the same predicate. - While CoreBox is hidden the main process only records the latest clipboard entry — it does not activate renderer state. Freshness is re-evaluated when the window is shown again.
- Text up to 80 characters is filled straight into the input; longer text is only attached as a tag. Files and images use their own modes.
autoPastedClipboardIdentitiesdeduplicates entries (TTL 1h), andclearClipboard(remember)prevents the same content from firing twice.
AutoClear
- Only compares
lastHiddenagainstautoClearwhen CoreBox is shown again. - Past the timeout it clears the input, mode, files/layout and clipboard cache, and deactivates providers.
- It is not a background timer: a window that stays visible never triggers it.
Plugin attachUIView cache
For webcontent features, CoreBox can attach a plugin UI via Electron WebContentsView.
Goal
Reuse recently-used views so reopening a feature does not reload its page every time.
Cache config
appSetting.viewCache.maxCachedViews0: disabled (always create/destroy views)> 0: enable LRU cache
appSetting.viewCache.hotCacheDurationMs- Used for stale cleanup.
Notes
- Cache key:
pluginName:featureId. - Cache is best-effort: destroyed views are dropped automatically.
Resume event
Whenever CoreBox attaches a plugin UI view, it emits core-box:ui-resume to the plugin process.
Payload:
source:attach|cachefeatureId: optional feature idurl: the attached URL
Troubleshooting (recent reports)
1) Empty input with no recommendations does not collapse
- Check whether
recommendationPendingis stuck attrue—applyLayoutUpdateskips the collapse while it is. - The
search.noResultsevent does not change window height on its own; alayout.updateis still required. - Check whether you are in UI Mode: the main process skips layout updates outright there.
- Check whether
activeActivationsis non-empty — an active activation forces the window to stay expanded.
2) AutoPaste still fires past the configured time
autoPaste.time = 0means no limit. For an actual time window pick an explicit value: 1, 3, 5 seconds or longer.ClipboardEvents.getLatestrefreshes the clipboard snapshot when the shortcut opens CoreBox. AutoPaste judges freshness byfreshnessBaseAt/observedAt, not byitem.timestamp.- If stale content still comes through, confirm the stored value:
appSetting.tools.autoPaste.timeis in seconds, and-1disables it.
3) AutoClear does nothing long after a plugin is activated
autoClearis only checked when CoreBox is shown again; a UI that stays visible never triggers it.lastHiddenis written inonHide, so it does not advance while UI Mode keeps the window visible.