Conversation
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
| @@ -0,0 +1,26 @@ | |||
| (() => { | |||
Collaborator
There was a problem hiding this comment.
Let's add a small top-level comment to explain what this file is about.
stanislaw
reviewed
Sep 2, 2026
| @@ -0,0 +1,219 @@ | |||
| (() => { | |||
Collaborator
There was a problem hiding this comment.
Let's move this to the feature's folder.
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
| {% macro value_or_none(value_) %}{{ value_ if value_ is not none and value_ != "" else "None" }}{% endmacro %} | ||
| {% macro enabled(value_) %}{{ "On" if value_ else "Off" }}{% endmacro %} | ||
| {% macro list_value(values_) %}{{ values_ | join(", ") if values_ else "None" }}{% endmacro %} | ||
| {% macro features_value(values_) %}{% if "ALL_FEATURES" in values_ %}<b>ALL_FEATURES:</b><br/> {{ list_value(values_ | reject("equalto", "ALL_FEATURES") | list) }}{% else %}{{ list_value(values_) }}{% endif %}{% endmacro %} |
Collaborator
There was a problem hiding this comment.
Let's not use any macro. Use methods on the view object. Encapsulate everything there.
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
stanislaw
reviewed
Sep 2, 2026
mettta
force-pushed
the
mettta/feat_configuration_page
branch
from
September 15, 2026 17:55
fe986fe to
d359e7e
Compare
stanislaw
marked this pull request as draft
September 15, 2026 18:13
…s reassigned after construction
ProjectConfig.__init__ expands the ALL_FEATURES sentinel into the full
ProjectFeature list, but it only did this when project_features was passed
as a constructor argument. It is equally common, and fully supported by
the documented create_config() mechanism, to write:
def create_config() -> ProjectConfig:
config = ProjectConfig()
config.project_features = ["ALL_FEATURES", "SEARCH"]
return config
This is a plain attribute assignment on an already-constructed object, so
the expansion logic inside __init__ never runs for it. project_features
was then left holding the literal list from the source file (the
ALL_FEATURES sentinel plus whatever else was assigned), instead of the
full, expanded feature list.
self.project_features is read throughout StrictDoc, not just in one place:
is_activated_diff(), is_activated_search(), is_activated_html2pdf(),
is_feature_activated(), the nav template, the MATHJAX/MERMAID deprecation
warnings in validate_and_finalize(), and the CLI export path. Any of these
could silently see the wrong feature set for a project using this
attribute-assignment style, with no error raised anywhere.
Factor the validation-and-expansion logic out of __init__ into a
ProjectConfig._normalize_project_features() static method, and call it
from both __init__ (unchanged behavior for the constructor-argument case)
and from validate_and_finalize() (new: covers the attribute-assignment
case). validate_and_finalize() runs at the end of every
ProjectConfigLoader.load*() path, so this fires regardless of how
project_features ended up set. The call is idempotent: an already-expanded
list still contains ALL_FEATURES (it is one of the ProjectFeature enum
members), so re-normalizing it a second time is a no-op.
Add two tests covering both paths end to end: constructing with
project_features=["ALL_FEATURES", ...] directly, and loading a config file
whose create_config() assigns project_features to an already-constructed
ProjectConfig. Both assert the final project_features equals
ProjectFeature.all(), not just that the source text was written a
particular way.
Add a dedicated Project configuration page, linked from the shared navigation. StrictDoc generates it identically in server and static HTML output: the same read-only configuration information either way, no editing controls in either mode. The page shows: - the active configuration file path, project title, server host and port; - lazy document loading threshold (with the installed version's default shown alongside it), output directory, grammar aliases, custom CSS path, and favicon path; - the active project features, as a single row. When ALL_FEATURES is among them, the row shows "ALL_FEATURES:" followed by the other active features on the same line. The row hides NESTOR (still immature) and the deprecated MATHJAX, MERMAID, and SOURCE_FILE_LANGUAGE_PARSERS features, since these are enabled by default and no longer need to be listed. The "Project tree configuration" block (input paths, included/excluded document and source paths, source root path) moves here from the project index page, since it is project configuration, not part of the document tree view. Each input path and the source root path show a truncated external prefix that a user can click to reveal in full (path_reveal.js) - useful when the project lives several directories deep and the full path would otherwise crowd out the parts that matter. Implementation: - ProjectConfigurationHTMLGenerator / ProjectConfigurationViewObject (strictdoc/features/project_configuration/) render the page; both the server router and the static HTML export call the same generator, so there is exactly one template to keep in sync. - ProjectConfig gains a config_path attribute, set by ProjectConfigLoader.load_using_server_config() via a new _resolve_config_path() helper, so the page can show the exact file that was loaded (this required load_from_path_or_get_default() to start returning the resolved path alongside the ProjectConfig; every other caller of that method just ignores the second value). - table_key_value/index.jinja gains an "Append" row kind, used to render the lazy-loading-threshold default hint on its own line under the value. Tests: unit coverage for the config_path resolution helpers, and an end-to-end test covering the page itself plus the external-prefix reveal/hide toggle for input paths and the source root path.
…d making minor UI improvements
mettta
force-pushed
the
mettta/feat_configuration_page
branch
2 times, most recently
from
September 17, 2026 10:34
5f76ef9 to
bd5c571
Compare
mettta
force-pushed
the
mettta/feat_configuration_page
branch
from
September 17, 2026 11:10
bd5c571 to
733ff03
Compare
mettta
marked this pull request as ready for review
September 17, 2026 11:14
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.
Add a read-only Project configuration page (server and static output),
linked from the shared navigation. Shows the active config file path,
project title, server host/port, project features, and additional settings
(lazy-loading threshold, output dir, grammar aliases, custom CSS/favicon paths).
The "Project tree configuration" block (input paths, included/excluded
document and source paths, source root path) moves here from the project
index page. Config-declared excludes and .gitignore-derived excludes now
render separately, the latter collapsed by default under
"Excluded via .gitignore (N)".
Also included, as self-contained commits:
ALL_FEATURESnow expands correctly whenproject_features is assigned after construction (extending configs),
not only via the constructor argument. Affects feature gating
project-wide, not just this page.
<kbd>hint style (also picked upby tree_map).
affecting every modal built on this component.
See
developer/tasks/20260821_feat_UI_settings/task.mdfor the full spec.