Repository navigation
Task Issue 1376 ReqEdit ExpectedCoverage Config Gate
opencode-agent edited this page Sep 16, 2026
·
1 revision
Issue: #1376
Status: IMPLEMENTED (2026-09-16) — branch task/issue-1376
The modern Requirement Editor (gui/templates/requirements/reqEdit.html, BFF
api/reqedit) dropped three legacy expected-coverage behaviours:
- The legacy screen is gated by the global config
req_cfg->expected_coverage_management(config.inc.php:1666, defaultENABLED). When disabled, the whole Expected Coverage field is not rendered (reqEdit.tpl:345). - The field is additionally gated per requirement type by
req_cfg->type_expected_coverage(reqCommands.class.php:33-41; default incfg/const.inc.php:759:type_expected_coverage = [TL_REQ_TYPE_INFO => false], i.e. type Informational/"1" disabled out of the box). Disabled type → stored value 0 (reqEdit.tpl:69-91). - The legacy field is a free numeric input accepting any positive integer
(7, 12, …) persisted as-is (
reqEdit.tpl:353-355). The modern screen had a fixed dropdown[1,2,3,5,10]andsave()forcedmax(1, intval(...)).
The type-change toggle (configure_attr, reqEdit.tpl:188-213) was also missing.
BFF api/reqedit/index.php
-
reqOptions()exposesexpectedCoverageManagement(tolerantboolishConfig(), defaultfalsewhen absent, matchingapi/requirements+ legacy-if-absent) andexpectedCoverageByType(type → 1|0, absent type = enabled). -
effectiveExpectedCoverage($type, $posted): management disabled → 0; type disabled → 0; else posted positive int as-is. -
create/updatecall-sites unchanged (still receive an int).
Frontend reqEdit.html
- Fixed
<select>replaced by free numeric text<input id="reqExpectedCoverage" maxlength="6">. -
#expectedCoverageColhide/show viacoverageManagementEnabled()/coverageEnabledForType()/currentCoverageEnabled()/refreshCoverageField(), run on load and on#reqTypechange (legacyconfigure_attrparity). -
save()validates number > 0 when visible (reqe.warningExpectedCoverage(_range)), sends 0 when hidden (legacy force-0, notmax(1,...)). - read-only mode still disables the input via
setEditable().
i18n — reqe.warningExpectedCoverage + reqe.warningExpectedCoverageRange in all
10 bundles (en/ro/de/es/fr/it/ja/pt/ru/zh).



| Case | Result |
|---|---|
Options: expectedCoverageManagement:true, map {1:0,2:1,...,7:1}
|
PASS |
| Edit: free input carries value 7 | PASS |
Arbitrary edit value 12 → DB 12
|
PASS |
Create ?spec_id=2: coverage 15 → new req stored 15
|
PASS |
| Type-Info requirement loads with field hidden | PASS |
| Type switch toggles visibility (configure_attr) | PASS |
| Hidden-type save persists 0 | PASS |
Validation abc/0 → localized warnings, no save |
PASS |
| Management DISABLED (temp) → hidden + save=0; default restored & re-verified | PASS |
Regression: general save, version-copy (v2 12), Event Viewer clean |
PASS |
reqSpecMgmt modal still uses a fixed min=1 coverage input ignoring both gates —
filed as #1516 (task).