Skip to content

Fix Widget Docs#100

Open
Lightning11wins wants to merge 13 commits into
masterfrom
fix-widget-docs
Open

Fix Widget Docs#100
Lightning11wins wants to merge 13 commits into
masterfrom
fix-widget-docs

Conversation

@Lightning11wins
Copy link
Copy Markdown
Contributor

@Lightning11wins Lightning11wins commented May 7, 2026

Changes:

  • Fixed some htdrv_*.c files that registered their widget's events/actions incorrectly.
  • Improved the DTD spec for widgets.xml and updated the entire file to follow the new spec.
  • Added many missing widgets, properties, events, and actions.
  • Added detailed information about event and action parameters where relevant.
  • Reformatted widgets.xml to a consistent format.

Results:
When running the unfinished doc-report script on master, we get a lot of doc issues:

before doc errors

========

After this PR, we have significantly fewer issues:

after doc errors

========

Note: The issue count will fall even further after clean up from other PRs like #90 is merged:

final doc errors

========

Note 2: All of these changes were made on the fix-widget-docs-dev branch, which is based off of several other branches that aren't merged yet. In order to make this branch, I had to cherry-pick all the commits from that branch onto this branch, which is based off of master. This was a very difficult and technical process, so if you notice any bizarre changes on this branch, please let me know because that might be the cause of the issue.

Note 3: When merging, ensure that 6fab4ecaa4fe827adfb9b828bf86e88d4b3c8b2a is added to the ignore diffs list because it contains the general reformat of widgets.xml.

Note 4: These issues were detected using the script in PR #101.

Reformat schema.
Fix syntax errors in types.
Add HTML types to DTD.
Update types to match what the file is generally doing.
Update the file to match updated types.
Uncomment tags that are commented out for some reason.
fix mistakes in widgets.xml.
*This commit should be added to the git ignore refs list.

Apply automatic XML formatting with manual cleanup.
chart widget:
Add docs for Click and DblClick events.

component-decl widget:
Add docs for child widget component-decl-cprop.
Add docs for child widget component-decl-event.
Add docs for child widget component-decl-action.

checkbox widget:
Improve SetValue action docs.

datetime widget:
Improve SetValue action docs.

dropdown widget:
Improve SetGroup, SetItems, and SetValue action docs.

editbox widget:
Add Disable action docs.
Improve DataModify event docs.
Improve SetFocus and SetValue action docs.

window widget:
Improve Open, Popup, and SetVisibility action docs.
Improve Open and Close action implementation docs.
Remove NoInit param from SetVisibility action on window widget.

form widget:
Improve Clear, Discard, Disable, Enable, New, QueryExec, Save, and Submit action docs.
Fix typos.

formstatus widget:
Add Click event docs.
Fix typos.

table widget:
Add table-row-detail child widget docs.

clean up:
Remove C registration of osrc-rule widget which no longer exists.
Update C registration of scrollpane, form, and editbox widgets' events/actions.
Improve comments.
Improve widget doc writing.
Fix typos in widget docs.
Add full documentation for the file upload to widgets.xml.
Fix htdrv_fileupload.c registering events and actions that don't exist.
Replace docs of Click and DblClick events with new docs that use consistent wording.
Add more HTML widget event docs.
Add more menu widget event/action docs.
Add more table widget action docs.
Add more textbutton widget action docs.
Fix typo in timer widget Expire event docs.
Fix textarea widget registering DataModify event using the wrong name.
@Lightning11wins Lightning11wins self-assigned this May 7, 2026
@Lightning11wins Lightning11wins added ai-review Request AI review for PRs. documentation Changes, improvements, or fixes to documentation files. size: medium Might be hard to review, usually less than ~5000 lines. labels May 7, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR corrects event/action registrations in several htdrv_*.c files to match what their JS counterparts actually fire, removes dead osrc-rule code, and substantially expands widgets.xml with missing widgets, properties, events, and actions.

  • C driver fixes: htdrv_editbox.c correctly updates DataModify params; htdrv_fileupload.c aligns action/event names with the JS; htdrv_form.c adds Disable/Enable actions and drops the spurious QueryExec event; htdrv_window.c removes the unused NoInit param.
  • Dead code removal: The #if 00 osrc-rule block in htdrv_osrc.c and its corresponding wgtrAddType call in wgtdrv_osrc.c are cleaned up.
  • widgets.xml: Reformatted to a consistent structure and expanded with many previously missing entries.

Confidence Score: 5/5

Safe to merge — all changes are documentation metadata corrections and dead code removal with no impact on runtime logic.

Every changed C file only calls htrAddEvent, htrAddAction, and htrAddParam — registration calls that feed the doc-report tool. The two remaining mismatches are doc-accuracy issues, not runtime regressions. The JS changes are minor and semantically safe.

htdrv_textarea.c has a leftover param name mismatch (NewValue vs Value) that the editbox fix was meant to address in both files. htdrv_scrollpane.c registers Scroll and Wheel events that have no JS implementation yet.

Important Files Changed

Filename Overview
centrallix/htmlgen/htdrv_textarea.c Renames event from Modified to DataModify but still uses NewValue instead of Value and omits FromKeyboard/FromOSRC params — mismatches what the JS actually fires.
centrallix/htmlgen/htdrv_editbox.c Renames event from Modified to DataModify and corrects params (Value, OldValue, FromKeyboard, FromOSRC) to match what htdrv_editbox.js fires.
centrallix/htmlgen/htdrv_fileupload.c Renames Reset action to Clear and replaces Success event with UploadComplete, UploadError, and Change — all matching the JS registrations in htdrv_fileupload.js.
centrallix/htmlgen/htdrv_form.c Adds Disable and Enable actions (matching ia.Add in JS) and removes QueryExec as an event (it is an action in JS, not an event).
centrallix/htmlgen/htdrv_scrollpane.c Adds Scroll, Wheel events and ScrollTo action; ScrollTo is implemented in JS but Scroll and Wheel have no JS counterpart, making them phantom registrations.
centrallix/htmlgen/htdrv_window.c Removes NoInit param from SetVisibility; NoInit is absent from htdrv_window.js, so the removal is correct.
centrallix/htmlgen/htdrv_osrc.c Removes a large #if 00 dead-code block for osrc-rule and a commented-out pObjQuery variable, leaving cleaner render logic.
centrallix/wgtr/wgtdrv_osrc.c Removes wgtrAddType(name, "osrc-rule") registration; consistent with the removal of the dead osrc-rule handler in htdrv_osrc.c.
centrallix-os/sys/js/htdrv_window.js Refactors wn_closewin and wn_openwin to use spread syntax instead of mutating aparam in place when invoking SetVisibility.
centrallix-os/sys/js/htdrv_editbox.js Minor comment cleanup — clarifies that aparam.Description drives the description update via SetValueDescription.
centrallix-doc/Widgets/widgets.xml Large reformatting and expansion: adds many missing widgets, properties, events, and actions, and improves the DTD spec for consistent structure.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["htdrv_*.c Initialize"] --> B["htrAddEvent / htrAddAction / htrAddParam"]
    B --> C["Event/Action Registry"]
    C --> D["doc-report script"]
    C --> E["Runtime JS: cn_activate / ia.Add / ie.Add"]

    subgraph editbox ["editbox - FIXED"]
        EB_C["htdrv_editbox.c: DataModify with Value, OldValue, FromKeyboard, FromOSRC"]
        EB_JS["htdrv_editbox.js fires DataModify with Value, FromKeyboard, FromOSRC, OldValue"]
        EB_C <-->|match| EB_JS
    end

    subgraph textarea ["textarea - INCOMPLETE"]
        TX_C["htdrv_textarea.c: DataModify with NewValue, OldValue ONLY"]
        TX_JS["htdrv_textarea.js fires DataModify with Value, FromKeyboard, FromOSRC, OldValue"]
        TX_C <-->|mismatch| TX_JS
    end

    subgraph scrollpane ["scrollpane - PARTIAL"]
        SP_C["htdrv_scrollpane.c: Registers Scroll + Wheel events, ScrollTo action"]
        SP_JS["htdrv_scrollpane.js: ia.Add ScrollTo only, no Scroll or Wheel registered"]
        SP_C <-->|Scroll and Wheel unimplemented in JS| SP_JS
    end

    A --> editbox
    A --> textarea
    A --> scrollpane
Loading

Reviews (2): Last reviewed commit: "Resolve Greptile's comments." | Re-trigger Greptile

Comment thread centrallix/wgtr/wgtdrv_osrc.c
Comment thread centrallix/htmlgen/htdrv_editbox.c
Fix DataModify event for the editbox widget which registered a NewValue param when it is actually called Value.
Remove osrc-rule code clutter that confused Greptile.
Clean up code clutter.
@Lightning11wins
Copy link
Copy Markdown
Contributor Author

@greptileai I think I've finished resolving the issues you mentioned. Please rereview.

@Lightning11wins Lightning11wins changed the title Fix widget docs Fix Widget Docs May 11, 2026
@Lightning11wins
Copy link
Copy Markdown
Contributor Author

This PR is cleared for human review.

@Lightning11wins Lightning11wins requested review from gbeeley and nboard May 12, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request AI review for PRs. documentation Changes, improvements, or fixes to documentation files. size: medium Might be hard to review, usually less than ~5000 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant