Skip to content

Disable actions for auto-generated nodes/docs#2766

Open
thseiler wants to merge 1 commit into
strictdoc-project:mainfrom
thseiler:feature/no-edit-for-autogen-nodes-and-fields
Open

Disable actions for auto-generated nodes/docs#2766
thseiler wants to merge 1 commit into
strictdoc-project:mainfrom
thseiler:feature/no-edit-for-autogen-nodes-and-fields

Conversation

@thseiler
Copy link
Copy Markdown
Contributor

@thseiler thseiler commented Apr 8, 2026

WHAT:
While working on the image PR, I noticed that it was possible to edit certain node types that StrictDoc cannot currently save:

  • autogenerated documents and nodes like test reports
  • nodes that were merged from source_code
    These changes appear to take effect initially (as the in-memory model is updated), but they are lost when the server is stopped.

WHY:
Ensures that the user notices that he can currently not edit these node types.

HOW:
The PR introduces an ActionPolicy object and hooks it:

  • to the document action button (edit metadata)
  • to the node action buttons (edit, clone, delete, add)
  • to the toc (move nodes)
  • to the individual fields in the edit form

Points for Discussion:

  • The ActionPolicy is currently a proposal. I am not really sure whether the policy correctly handles all the edge cases, especially for merged nodes. But as the logic is centralised, it should be easy to adapt as needed.
  • I noticed some issues when editing a merge node (where some fields are parsed from the source code and others come from the .sdoc). The origin metadata for fields would be lost on edit, and the UID / MID would not be written back to the sdoc, so that the link would be lost on subsequent server starts. I've tried to address these as well.
  • I had some trouble with the SDocTestServer hitting the ReadTimeout, and noticed that the exit handler is not called when an exception happens in the enter block. I added an exception handler to clean up the server so that the end-to-end tests could continue.

stanislaw added a commit that referenced this pull request Apr 27, 2026
…en diffing in/out folders

WHY: Ensures that the test diffing works correctly and the __pycache__ folder
does not get in the way.

HOW: Extracted from #2766.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant