Repository navigation
feat(examples): browser page for native editing of one ConfigMap - #64
Merged
Merged
Conversation
Add examples/native-editor/index.html: a framework-free page that watches one named ConfigMap through a host proxy and edits its data and ordinary annotations with the existing nativeEditor, LiveResourceStore and connectNativeWatch. The last-applied annotation and managedFields stay read-only. Save is enabled only while live, with one request at a time, and inputs keep focus and caret through watch events, writes and recovery reads. The page presents each outcome: an accepted write awaiting its echo, the echo or an explicit confirm() with any remaining dirty fields, a stale version, field conflicts resolved with store.revert or the keep-local recipe, an unknown outcome, refusals and a deleted or replaced object with a recovery copy. Disconnect closes the watch, unsubscribes, clears the echo timer and ignores late answers. editor.ts and the recipes stay TypeScript. build.mjs (task build-native-editor) compiles them with the client's esbuild, renaming the library import to @configbutler/krm-stream, which the page's import map points at the selected entry point. dist/ is gitignored. native-editor.spec.ts runs the page in Chromium on both entry points against a test server that plays the host proxy and API server with a watch that stays open. Document the run steps, the kubectl proxy setup and what it does and does not protect, and record browser acceptance in the delivery plan and field report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…s at once Review fixes for the native editor page. - Edit values in text areas. An <input> strips line breaks from its value, so editing a multiline data value or annotation and saving it wrote the value back without them. - Make the recovery-copy recipe's reads independent of listener order. copy() and removed now capture first, so a host listener subscribed before the recipe, such as the page's render, sees a deletion immediately instead of "No unsaved edits." until a later render. A disposed recipe stays empty. - Browser tests for multiline values and a standalone deletion, and a recipe test for the listener order; each fails without its fix. - Docs: proposal 0009 and the migration guide name connectResourceStream the gateway connector, 0009 records that native editing has landed, and the glossary includes native recovery reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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 changes
examples/native-editor/index.html, a framework-free page. It watches one named ConfigMap through a host proxy (proxy,namespace,nameare query parameters) and edits itsdataand ordinary annotations, using the existingnativeEditor,LiveResourceStoreandconnectNativeWatch.managedFieldsappear only in the read-only server-state summary.editor.confirm()), each stating how many fields still differ;store.revertor the keep-local recipe;Status;How it's built
editor.tsand the recipes stay TypeScript, run by the client suite.build.mjs(task build-native-editor) compiles them with the client's esbuild into a gitignoreddist/, renaming their library import to@configbutler/krm-stream.index.jsor the single-file bundle (?entry=bundle).e2e-browsernow depends on the new build task, and Playwright's web server rebuildsdist/too.Review fixes
<input>silently dropped line breaks from multiline data and annotations.copy()andremovednow capture first, so a host listener subscribed before the recipe (the page's render) shows a deleted object's edits at once. A disposed recipe stays empty.Validation
task fixtures-check,task lint-client,task test-client(218/218),task e2e-browser(48/48, 24 new) andtask pack-clientall pass. The new browser tests were also repeated 5×: 120/120.native-editor.spec.tsruns the real page, connector, store and controller in Chromium on both entry points, against a test server that plays the host proxy and API server with a watch that stays open. It covers:kubectl proxyagainst a v1.36.4+k3s1 cluster: save and echo on both entry points, and a real 422 displayed.task test-real-apiwas not rerun: the editor and the Go code are unchanged, andTestRealAPINativeEditThroughHostProxyis kept.Limitations
dataand annotations only. This is not a general resource editor.\r\nto\n: editing a value that contains carriage returns writes it back without them.echoWaitMs, default 5 s).kubectl proxyis for development only. It keeps the credential server-side and limits host names, but runs every request as your own identity and does no write validation, CSRF checks or audit. The README spells this out.🤖 Generated with Claude Code