Skip to content

Improve runtime diagnostics and validation - #23

Merged
blackopsrepl merged 2 commits into
mainfrom
issue-5-runtime-checks
Mar 21, 2026
Merged

Improve runtime diagnostics and validation#23
blackopsrepl merged 2 commits into
mainfrom
issue-5-runtime-checks

Conversation

@blackopsrepl

Copy link
Copy Markdown
Contributor

Summary

  • Add SF.assert helper for consistent error messages.
  • Add explicit configuration and callback validation to solver, backend, and component factories.
  • Add mount/root guards for Gantt and validate table/tab/modal/header/singleton inputs.
  • Fail clearly when required adapter methods are missing instead of throwing generic runtime errors.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faf6a1d410

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread js-src/10-backend.js Outdated
sf.createBackend = function (config) {
config = config || {};
var type = config.type || 'axum';
sf.assert(type === 'axum' || type === 'fetch' || type === 'tauri', 'createBackend(type) must be axum, fetch, or tauri');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep non-tauri backend type labels working

This assertion is a backwards-incompatible regression for any existing HTTP integration that used a descriptive type like rails, http, or django. Before this change every non-tauri type flowed into createHttpBackend(), and that adapter is still generic (it only keys off baseUrl, schedulesPath, demoDataPath, and headers). After this commit those callers now throw during initialization even though the backend implementation would otherwise work unchanged.

Useful? React with 👍 / 👎.

Comment thread js-src/14-gantt.js Outdated
Comment on lines +11 to +12
sf.gantt.create = function (config) {
sf.assert(config, 'gantt.create(config) requires a configuration object');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow gantt.create() to fall back to its built-in defaults

Requiring config here breaks a previously valid default-construction path: every field read below already has a fallback (chartPane, gridPane, titles, view mode, split sizes, etc.), and tasks are populated later via setTasks(). Apps that currently do SF.gantt.create() or pass through an optional config now get a hard error before any of those defaults can apply.

Useful? React with 👍 / 👎.

Keep non-tauri backend labels working and preserve gantt default construction while retaining the runtime validation improvements.
@blackopsrepl
blackopsrepl merged commit 6d8f65e into main Mar 21, 2026
1 check passed
@blackopsrepl
blackopsrepl deleted the issue-5-runtime-checks branch March 21, 2026 10:41
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