[ZEPPELIN-6441] Replace outdated type assertions with satisfies#5323
Open
kimyenac wants to merge 1 commit into
Open
[ZEPPELIN-6441] Replace outdated type assertions with satisfies#5323kimyenac wants to merge 1 commit into
kimyenac wants to merge 1 commit into
Conversation
TypeScript is now ~5.9.3, so the pre-4.9 workaround TODOs are obsolete. - app.module.ts: `as JoinedEditorOptions` -> `satisfies JoinedEditorOptions` so unsupported editor options are caught at compile time. - create-repository-modal.component.ts: `as Record<...>` -> `satisfies Record<...>` so every form control key is validated against CreateInterpreterRepositoryForm. - notebook-paragraph-keyboard-event-handler.ts: `as const` -> `as const satisfies ...` for both the action->handler map and the Monaco-handled action list. `as const` is kept so downstream `typeof`-based literal indexing still narrows correctly, while `satisfies` now validates keys/values (invalid handler names are rejected). Runtime behavior is unchanged; these are compile-time-only annotations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tbonelee
approved these changes
Jul 19, 2026
tbonelee
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Nice cleanup of the obsolete pre-4.9 TODOs.
Ran tsc --noEmit -p src/tsconfig.json with the changes applied: 0 errors. Also confirmed the satisfies checks are actually enforced (injecting an invalid handler name fails with TS2418), and the Record<ParagraphActions, ...> passing means the full enum is covered. as const satisfies keeps the downstream typeof narrowing intact. Compile-time only, no runtime change.
jongyoul
approved these changes
Jul 19, 2026
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.
What is this PR for?
The Angular UI now uses TypeScript ~5.9.3, so the pre-4.9 workaround TODOs that asked to replace broad type assertions with
satisfiesare obsolete. This replaces those outdated assertions withsatisfies, which improves compile-time checking without changing runtime behavior.app.module.ts:as JoinedEditorOptions→satisfies JoinedEditorOptions, so unsupported editor options are caught at compile time.create-repository-modal.component.ts:as Record<...>→satisfies Record<...>, so every form control key is validated againstCreateInterpreterRepositoryForm.notebook-paragraph-keyboard-event-handler.ts:as const→as const satisfies ...for both the action→handler map and the Monaco-handled action list.as constis intentionally kept so the downstreamtypeof-based literal indexing still narrows correctly, whilesatisfiesnow validates keys/values (e.g. invalid handler names are rejected).All three changes are compile-time-only annotations; runtime behavior is unchanged.
What type of PR is it?
Improvement
What is the Jira issue?
ZEPPELIN-6441
How should this be tested?
cd zeppelin-web-angular && npm run lintpasses (0 errors).satisfieschecks are active: injecting an unsupported editor option is caught as TS2353, and an invalid handler name is caught as TS2418.Questions:
🤖 Generated with Claude Code