chore: improve example app for more easy testing#321
Open
duyhungtnn wants to merge 2 commits intomainfrom
Open
chore: improve example app for more easy testing#321duyhungtnn wants to merge 2 commits intomainfrom
duyhungtnn wants to merge 2 commits intomainfrom
Conversation
Revamp the example app to provide explicit Initialize/Destroy controls and improve logging and lifecycle handling. HTML: add Initialize and Destroy buttons, reorganize layout, and enhance the logs pane styling. TS: add AUTO_INIT_FLAG, stronger typings for button elements, timestamped logs, updateButtons helper, and new handleInit/handleDestroy flows that initialize/destroy the BKT client, register/remove evaluation update listeners, and update UI state. Also improve flush/user-attribute messages, move initialization behind the init handler (with optional auto-init), and ensure cleanup runs on beforeunload.
There was a problem hiding this comment.
Pull request overview
This PR updates the example app to make manual testing of the BKTClient lifecycle clearer by adding explicit Initialize/Destroy controls, improving log output, and refining button enable/disable behavior.
Changes:
- Added Initialize/Destroy buttons and reorganized the example UI layout.
- Refactored the example’s BKTClient lifecycle into
handleInit/handleDestroy, including evaluation update listener wiring. - Enhanced logging with timestamps and auto-scroll.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| example/index.ts | Adds init/destroy handlers, button state updates, timestamped logs, and listener lifecycle management. |
| example/index.html | Adds init/destroy buttons, groups controls, and improves logs container styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
@cre8ivejp please help me to take a look |
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.
I used this updated example app for manual test this changes #320
This PR enhances the example app's UI and improves the initialization and teardown flow for the BKTClient integration. It adds explicit "Initialize" and "Destroy" controls, improves button state management, and enhances log output for better clarity during testing.
UI Improvements
Initialization & Teardown Flow
handleInitandhandleDestroy) tied to the new buttons. Button states are updated to prevent invalid actions. [1] [2]AUTO_INIT_FLAG, with log feedback if auto-init is disabled. [1] [2]Logging Enhancements
Type Safety and Code Cleanup
Event Handling Improvements