Repository navigation
[Work Order] OptiSensor Info, editable groups, and overlay preview - #106
Merged
Merged
Conversation
onehoon
commented
Nov 22, 2026
onehoon
left a comment
Owner
Author
There was a problem hiding this comment.
Please address the two concrete default-selection defects in the inline comments before merging. The responsibility split is appropriate; no extra abstraction is requested.
onehoon
commented
Nov 22, 2026
onehoon
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed the updated implementation and confirmed that the prior Intel classification and hybrid-default-selection comments are addressed. Three remaining user-visible functional issues are noted inline, each with a concrete code example. Please address them before merge.
onehoon
marked this pull request as ready for review
November 22, 2026 13:03
This was referenced Nov 22, 2026
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.
Work Order — OptiSensor Info, editable sensor groups, and plugin-local overlay preview
Context
Base:
main. The current Windows-only OptiScaler plugin is the single-ASI LibreHardwareMonitor HTTP bridge. Insrc/OptiSensor.Plugin/OptiSensor.cpp,DrawTab(void*)currently renders aPlugin updatesection (status, separate build line) and may display a separateLibreHardwareMonitor web server unavailablemessage before the hardware sensor groups. The Libre bridge snapshot inLibreBridge.hexposeshasValidSnapshotandunavailable; after three failed poll attempts the bridge marks the latest snapshot unavailable.Implementation structure — separate responsibilities from the outset
Include the responsibility split in this implementation PR, not in a later cleanup/refactor PR. The current
src/OptiSensor.Plugin/OptiSensor.cpp(~670 lines onmain) mixes update-check HTTP and release parsing, registration/startup, the existing sensor polling worker, and UI rendering. The requested group editing, per-sensor order settings, default picks and text composition should not be added to this large file.A lightweight, concrete source split is recommended; adjust filenames if the resulting responsibility boundaries remain clear:
OptiSensor.cppOptiPluginInit, runtime lifetime, SDK compatibility gate, one sensor polling worker, and ownership of the current immutable sensor snapshot / update state. Keep it an entrypoint/coordinator rather than a UI or settings implementation.LibreBridge.cpp/.hN/Apolicy. Preserve existing behavior and tests; do not move UI/group-selection code into the bridge.UpdateChecker.cpp/.hOptiSensor.cpp; preserve the current one-time, non-blocking check and no-error-on-network-failure behavior. No new update worker.PluginTab.cpp/.hOptiSensor Info,Overlay Preview,Selected Sensors,Hardware Sensors),InputText,Combo,Button,SameLine, status colors, and the existing Save button. SDK/UI calls only on the draw callback.OverlayLayout.cpp/.hSingle authority and minimal plumbing: Continue using one Libre snapshot and one
[Plugin.OptiSensor]settings namespace through the existing OptiScaler SDK. The tab owns any transient text-entry buffer; persist only the group names/IDs, assignment, order and selection values required by the work order. Reuse the existingRegisterTabdraw callback'suserData(or one similarly simple stable context) to pass the existing runtime/API data across compilation units; avoid duplicated mutable global snapshots, a separate selection owner, another worker, wrapper/interface hierarchies, generic managers, background services, custom serialization files or extra synchronization purely for theoretical races. A small number of direct functions/structs is sufficient; do not introduce indirection solely to achieve the suggested filenames.Build/tests in this PR: Update
OptiSensor.Plugin.vcxprojto compile the new translation units (and the current native test project for pure composition tests). Keep the singleOptiSensor-loadlate.asioutput and current CI/release packaging unchanged. Add focused native tests for curated default selection, stable group names/order, membership changes, the exactCPU | GPU | VRAM | RAMpreview (including automatic|separators), the VRAM and physical-RAM pair calculations, missing inputs, and persistence-related order normalization. Continue running current Libre parser and full plugin build tests. Avoid unnecessary tests for unsupported multi-session or pathological scheduling interleavings.Review success is not just "the UI works": the implementation PR should demonstrate these responsibility boundaries without behavior drift in current sensor collection, update checking, saved checkbox keys or release output.
Requested change — OptiSensor Info
Replace the top section title
Plugin updatewithOptiSensor Info. Keep the card compact:Connected / current build
Update available
Libre web server unavailable
The build numbers above are illustrative only; display the actual existing
kBuildRunIdand 8-characterkBuildShaas today.Display and status rules
Up to dateonly after a successful check,Update Availablein amber for a newer rolling release,Checking for updates...while pending, andLocal buildwhenkBuildRunId == 0. If the GitHub request fails, silently omit the update status (leave the build identity visible); never claimUp to datefor an unsuccessful check. Keep current release-check logic and build identity intact.Libre HW Monitor: OK(green if the SDK supports colored text) when the most recent published bridge snapshot is valid and!unavailable. ShowLibre HW Monitor: Not connectedwith redNot connectedtext using the SDK'sTextColoredwhen available (fall back to plain text only if the running OptiScaler SDK does not expose it), when the bridge has no usable snapshot or marks it unavailable. Prefer a readable, clearly red color rather than amber. Existing retention policy (up to two failed polls keep the previous valid values, third failed poll ->N/A) must remain authoritative: do not introduce a second polling, connection probe, or independent status counter. Optionally useConnecting...before the first response if this avoids a transient false alarm.Not connected, show one short, muted line:Install/run LibreHardwareMonitor + PawnIO. Enable Web Server (8085).This is user guidance, not an ASI action: PawnIO is needed for certain low-level sensor readings but is not itself required to connect to the HTTP API. Do not install, launch, elevate, or manage Libre/PawnIO in the ASI.LibreHardwareMonitor web server unavailablemessage from the lower portion of the tab; the top info section is the sole connection-status explanation. Keep the existingHardware sensorssection, groups, sensor selection checkboxes, values, group state,Savebutton, and saved OptiScaler.ini keys/behavior unchanged.Section,Text,SameLine, optionalTextColored/TextDisabled) in the draw callback. Keep it quick; no new dependencies, direct ImGui calls, network I/O, extra threads, extra state machines, or changes to the backend, endpoint, sample intervals, CI, packaging, or release flows. Preserve Windows-only/Wine guard.Additional requirement — Selected overlay sensors (plugin-only preparation)
The former Windows OptiSensor desktop app is the behavioral reference. Its source is still in this repository:
src/OptiSensor/UI/Views/Pages/SensorsPage.xaml: detected sensors are explicitly selected for overlay use.src/OptiSensor/UI/Views/Pages/OverlayPage.xamlandsrc/OptiSensor/UI/MainWindowViewModel.cs: a separate Overlay Preview plus selected sensors, with group membership, enabled status, user-facing display name, format and ordering.src/OptiSensor/Overlay/OverlayLineBuilder.cs,OverlayOutputComposer.cs,Models/OverlayGroup.csandModels/SelectedOverlaySensor.cs: selected/enabled sensors are composed into one plain-text line, values separated by spaces within named groups and groups separated by|. E.g.GPU 44°C 115W 62% | CPU 71°C 38%. The same composition is used for the desktop app's UI preview and publisher.Scope boundary: no overlay integration at this stage. Build/preview the text inside the ASI plugin only. Do not write shared memory, call into a new OptiScaler API, modify OptiScaler itself, invent a communication protocol, or deliver any text to the overlay. Do not copy or link the Windows app/.NET classes into the ASI.
Plugin tab section order
The tab has four OptiScaler SDK sections: the info card, the final text preview, the reorderable/group-editable selection, and the full sensor catalog. Group creation and editing happen entirely in the in-game OptiScaler plugin tab; the user should never need to edit INI manually.
Sample readings above are illustrative. Use the actual values reported by Libre. The compact GPU/VRAM preview is inspired by the original Windows OptiSensor overlay editor and line builder; only the plugin-local preview is being prepared here.
Default groups and first-use selections
CPU,GPU,VRAM, andRAMin that order. Their stable internal IDs must not change when the user edits their visible names.SensorVisible_<SHA256>setting, preselect only these detected sensors and assign them to the stated groups:Temperature(preferCore (Tctl/Tdie)where present), oneCPU Total/ overall CPULoad, and one CPU packagePower, default order temperature → load → power.Temperature, one GPU coreLoad, one GPU package/totalPower, and one GPUFan(preferGPU Fan 1), default order temperature → load → power → fan. GPU fan belongs to GPU, never a separate FAN group.GPU Memory UsedandGPU Memory Total(Libre sensor typeSmallData), default order Used → Total. These are two underlying selected sensors, not a fictitious third-party sensor or a constant. LibreHardwareMonitor 0.9.6 has these named GPU readings for supported adapters. Do not confuseGPU Memorypercentage load,GPU Memory Free,D3D Shared Memory, andD3D Dedicated Memory Usedwith the intended GPU Memory Used/Total pair.Total Memorywith hardware root/ram, selectMemory UsedandMemory Available(both typeData) in that order. Compute the total as Used + Available. Libre does not expose aMemory Totalsensor for theTotal Memoryroot. Do not chooseVirtual Memory(root/vram, Windows pagefile/virtual memory), any DIMM root, or an individual DIMM temperature. The two physical RAM source readings stay individually selectable.Total Memory(/ram) root. Omit absent metrics rather than selecting unrelated data. When memory inputs are unavailable, do not invent a total. No CPU/GPU/VRAM/RAM sensor is selected merely because it belongs to a group.SensorVisible_<SHA256>keys for all explicit saved true/false values. UseGetBool(plugin, key, isFirstUseRecommended)rather than the existing default-true select-all. A saved false must never be re-enabled automatically; a user may uncheck all selections and get an empty preview. This is only an initial default, not a fallback output line./vram), individual DIMMs, other GPUs, etc. default unchecked but remain available in Hardware Sensors for manual selection and grouping.Overlay Preview — final composed string
|(space, pipe, space) between each nonempty group in its configured order; do not require users to type separators into group names and never append a leading/trailing pipe or a double separator when a group has no selected/available readings. The live preview should look likeCPU 55°C 8% 34W | GPU 38°C 23% 15W 0RPM | VRAM 4444MB/23333MB | RAM 12.4GB/32GB(illustrative readings, not constants). Omit empty groups from the preview; with no selected readings displayNo sensors selected.GPU Memory UsedandGPU Memory Totalfor the chosen GPU are selected in the default VRAM group, render their live values as a compactusedMB/totalMBpair (e.g.6666MB/12000MB). Source values normally arrive as Libre-formatted strings (e.g.6666.0 MBand12000.0 MB). Apply only minimal, explicitMBformatting/space removal/rounding needed for this composed pair; never append duplicate units or blindly parse arbitraryRawValueas a float. If either is missing/unavailable, represent the missing half asN/Aor fall back to displaying only the valid source reading; do not fake a total or use a memory-load percentage. For any other sensors in the VRAM group, retain ordinary space-separated formatting. The virtual pair formatting must not remove the underlying individual readings/checkboxes, which stay separately selectable and reorderable.RAMgroup, whenMemory UsedandMemory Available(both from/ram) are selected, renderusedGB/(usedGB + availableGB), e.g.RAM 12.4GB/32GBfrom12.4 GBused and19.6 GBavailable. Parse only those specific Libre-formatted GB values with minimal unit-aware logic; never confuse WindowsVirtual Memory/vramwith either physical RAM or GPU VRAM. If either input is missing orN/A, do not manufacture the total; show valid values orN/A. Group renames must not affect this behavior.VRAM, the pairing behavior should use its stable internal group ID and specific sensor identities, not compare the mutable displayed name. If the user changes membership/order, reflect that choice rather than silently forcing an obsolete order.Selected Sensors — editable groups and order
New grouptext input with an adjacentAdd Groupbutton at the top of Selected Sensors, using the existing plugin SDKInputTextandButton. A nonempty trimmed name creates a group at the end of the existing group order. Ignore empty names; avoid duplicate stable IDs. Display a text input for each existing group name so the user can rename CPU, GPU, VRAM or a custom group directly in-game, without manually opening the INI. A rename must immediately update the preview and must not reset a group's membership, sensor order or saved selection.##button IDs keyed by stable sensor identity.Comboon its row (CPU/GPU/VRAM/RAM/custom group options). This moves the selected sensor to the end of the target group. Group membership updates the preview immediately. No drag-and-drop, separate group editing screen, arbitrary user-entered sensor type or new state authority.SensorVisible_<SHA256>via OptiScaler settings). Checking an additional sensor inserts it in the corresponding built-in default group when clearly classifiable (CPU→CPU; GPU non-VRAM incl. GPU fan→GPU; GPU Memory Used/Total→VRAM; physical/ramMemory Used/Available→RAM); otherwise place it in a simple Ungrouped staging area only when needed and let the user assign it to any group via the dropdown. Unchecking removes it from the list/preview. The full Hardware Sensors list remains intact, including SSD and network.[Plugin.OptiSensor]settings via SDKGetString/SetStringandGetInt/SetInt(e.g. group count/index→stable group ID/name, andSensorGroup_<same hash>+SensorOrder_<same hash>). Internal IDs stay stable across group name changes, polls and restarts. Existing checkbox/group expansion keys must not be renamed. Save via the existingSavebutton and standard OptiScaler INI save; do not add a second config file or settings manager. A newly selected sensor appends to its group if it has no stored order; avoid repeatedly reordering on value refresh.N/Apolicy; retain the persisted selection, group assignments/names and ordering. Top Info is the only place to show the Libre connection error/hint. Reuse the existing worker, snapshot and SDK draw callback. No new JSON polling, network listener, manager, additional threads or direct ImGui code.Verification of groups and preview
GPU Memory Used=6666.0 MBandGPU Memory Total=12000.0 MB, the default VRAM preview isVRAM 6666MB/12000MB. Given/ramMemory Used=12.4 GBandMemory Available=19.6 GB, the RAM preview isRAM 12.4GB/32GB; noVirtual Memoryis selected. If needed values are missing, no fictitious numeric total is produced.HOTSPOTandAdd Group: a fifth (initially empty) user group appears, can be renamed, and a selected existing sensor can be reassigned to it with Combo. The preview respects the group name and membership. Save/restart restores added group, edited names, assignments and row order.SensorIdmust remain independent using their stable unique setting keys. Group rename does not change IDs or selection keys.|separators between CPU/GPU/VRAM/RAM and custom groups, with no leading/trailing/doubled separator after an empty group or group reassignment. Group/UI edits never cause polling or affect the standalone Windows OptiSensor app. Reconnection restores current values without losing selections/group order.Acceptance checks
OptiSensor Infocard containing the build/status row andLibre HW Monitor: OK; existing sensors remain functional.Not connectedplus the single short setup hint; no duplicate warning below; no crash or blocking. On reconnection, recover toOKusing the existing worker.Up to date, amberUpdate Available, local build, checking and silent network-error presentations without changing the update detection semantics.Savebehavior intact (except curated defaults and persisted per-sensor ordering); release x64 ASI still compiles and current plugin CI passes.PR format: The original empty commit carries the English work order in this PR body; no separate work-order document should be added. The implementation may now be committed to this branch. Keep the PR Draft until the code and checks are ready for review.