Skip to content

fix(editor): leave a schema read-only field unchanged (#5345) - #5355

Merged
natechadwick-intsof merged 3 commits into
mainfrom
fix/issue-5345-editor-readonly-field
Oct 7, 2026
Merged

natechadwick-intsof merged 3 commits into
mainfrom
fix/issue-5345-editor-readonly-field

Conversation

@natechadwick-intsof

@natechadwick-intsof natechadwick-intsof commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Parent: #4532 (slice 82). Fixes #5345.

In EditorHost Edit, a content-type field with readOnly: true stays on the stored value. Saving a different field succeeds. The fields PUT omits the read-only field, so a client edit is never sent. Close then Cancel does not write. HTTP 400, 403, and 409 are not success and do not change the read-only value. View mode, required-field refusals, and file/image widgets are unchanged.

Operator: Grok: night-issue-prs (model grok-4.7)

Test plan

  1. Open an item in Edit whose content type marks one field read-only. The control is read-only and Clear is hidden.
  2. Change a different field and save. The save succeeds. The PUT body does not include the read-only field. Reopen the item: the read-only value is the previous stored value.
  3. Close, then Cancel the leave dialog. No fields PUT is sent.
  4. Force HTTP 400, 403, and 409 on the fields PUT. The host does not show success and the read-only value stays the previous stored value.

Checklist

  • Product documentation — updated product-docs/8.2/admin/content-explorer.md (Content Editor controls: schema read-only field)
  • Unit / module tests — editorReadOnlySave.test.ts, EditorHost.readOnlyField.test.tsx, editorPreview.test.ts; WebUI and perc-qa-automation standalone clean install green
  • WebUI + Playwright — modules/perc-qa-automation/frontend/tests/editor-host-readonly-field.spec.js on QA H2
  • Build gates — standalone clean install for each changed module; no final/signature change, so no reverse-dep install
  • Cross-platform — no new filesystem path joins

Build evidence

modules_built: WebUI, modules/perc-qa-automation

downstream_checked: none (TypeScript and docs only; no Java type made final or sealed, no public/protected signature change)

cd WebUI
JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install
BUILD SUCCESS 2026-10-07T16:49:50-04:00
Total time: 01:40 min
Java Tests run: 69, Failures: 0, Errors: 0, Skipped: 0
Vitest: Test Files 723 passed, Tests 6804 passed

cd modules/perc-qa-automation
JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install
BUILD SUCCESS 2026-10-07T16:50:07-04:00
Total time: 2.310 s
No tests to run (Playwright is not in the default lifecycle)

No new compiler or Surefire warnings from this change. Pre-existing javadoc "no comment" warnings on PSDefaultLandingView remain.

UI proof (QA H2)

python3 docker/scripts/perc-devctl.py qa-up --skip-image-build
TEST_CMS_URL=http://127.0.0.1:9993
python3 docker/scripts/perc-devctl.py qa-health
RESULT:OK HEALTH:healthy
python3 docker/scripts/perc-devctl.py qa-deploy-webui
python3 docker/scripts/perc-devctl.py qa-health
RESULT:OK HEALTH:healthy

cd modules/perc-qa-automation/frontend
TEST_CMS_URL=http://127.0.0.1:9993 ADMIN_USERNAME=Admin TEST_DB_TYPE=h2 TEST_PRODUCT=cms \
  rtk npm run test:surface -- --path tests/editor-host-readonly-field.spec.js
1 passed (4.5s) tests/editor-host-readonly-field.spec.js:51

console-clean=yes (spec records pageerror and console error; ignores "Failed to load resource")
server.log-clean=yes (0 ERROR/FATAL in the CMS server.log for the cell; AUTH-1001 login success during the run)
python3 docker/scripts/perc-devctl.py qa-down
RESULT:OK container perc-matrix-cms-h2 removed

Golden smoke was not run. This change is the editor field form only, not shell chrome.

Pre-push local code review

Summary

Machine analysis found 2 finding(s), 0 bug(s).

Scope

  • Base: origin/main
  • Head: HEAD
  • Files: 9 analyzed
  • In-diff: 0 finding(s); preexisting: 1
  • Persona: erlang 0.1.1
  • Persona source: /home/nate/.local/share/mkd/agents/erlang

Recommendation

approve

Gate

  • Blocking bugs: 0
  • May commit/push: yes

Issues

Issue 1 -- Severity: bug

  • File: WebUI/src/main/ts/editor/EditorHost.tsx:1370 (preexisting)
  • Rule: complexity.cognitive
  • Tool: arborist-metrics
  • Description: Function handleSave cognitive=138 (max 15), cyclomatic=172 (max 15)
  • Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
  • Status: open

Issue 2 -- Severity: suggestion

  • File: review
  • Rule: llm.error
  • Tool: llm
  • Description: model ollama-dev-coder failed: http: status 500 Internal Server Error body {"error":{"message":"llama-server process has terminated: exit status 1: cudaMalloc failed: out of memory\nalloc_tensor_range: failed to allocate CUDA0 buffer of size 5064192000\nerror loading model: unable to allocate CUDA0 buffer","type":"api_error","param":null,"code":null}}
  • Status: open

Erlang intent

Intent: edit mode builds the fields PUT with fieldsForEditorSave, which omits schema readOnly rows and still omits file and image widgets. setField, setFile, and markBinaryClear ignore schema read-only names. The control shows the stored value, Clear stays hidden, and a client edit is not an unsaved change. Cancel does not call save. HTTP 400, 403, and 409 stay on the error path and do not mark the item saved. Server applyUpdates writes only fields present on the PUT, so an omitted read-only field keeps the stored value. The handleSave cognitive-complexity row is preexisting, not in-diff, and does not block. Companions present: editorReadOnlySave Vitest, EditorHost.readOnlyField test, preview dirty-check test, Playwright editor-host-readonly-field.spec.js, and product-docs/8.2/admin/content-explorer.md. No new filesystem path joins. No agent rule files. Ollama dev-coder CUDA OOM is non-blocking; machine findings kept.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.

Edit mode omits a content-type read-only field from the fields PUT and
keeps the stored value on screen. Saving another field succeeds. Close
then Cancel does not write. HTTP 400, 403, and 409 are not success.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
…-field

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.
@natechadwick-intsof

Copy link
Copy Markdown
Collaborator Author

Erlang LGTM. In-diff bugs: 0. Recommendation: approve. Report: docs/ai-generated/code-reviews/pr-5355-erlang.md (7159f03d20). The fields PUT omits schema read-only rows; cancel and HTTP 400, 403, and 409 do not claim success. Preexisting handleSave cognitive complexity is not in-diff and does not block. Ollama CUDA OOM is non-blocking.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

@natechadwick-intsof
natechadwick-intsof merged commit 246ff53 into main Oct 7, 2026
6 checks passed
@natechadwick-intsof
natechadwick-intsof deleted the fix/issue-5345-editor-readonly-field branch October 7, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model:grok-4.7 Session model grok-4.7 operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue 4532 slice 82: EditorHost leave a schema read-only field unchanged

1 participant