-
Notifications
You must be signed in to change notification settings - Fork 10
Define a few new context properties #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new JSON-schema definitions and TypeScript types to support additional program context properties (frame, pick, and gather) and updates the front-end to render the new contexts.
- Added new schema files (pick, gather, frame) and updated the composite context schema.
- Updated TypeScript context type definitions and tests, as well as front-end example components to incorporate the new contexts.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/program/context/pick.schema.yaml | Added JSON schema for pick context. |
| schemas/program/context/gather.schema.yaml | Added JSON schema for gather context with example objects. |
| schemas/program/context/frame.schema.yaml | Added JSON schema for frame context (potential error on array props). |
| schemas/program/context.schema.yaml | Updated composite schema to include new contexts. |
| packages/web/src/theme/ProgramExample/Viewer.tsx | Updated viewer to use the new Details component. |
| packages/web/src/theme/ProgramExample/SourceContents.tsx | Integrated decorations for pick context, and parameterized code context. |
| packages/web/src/theme/ProgramExample/Details.tsx | Added new details view for instruction contexts. |
| packages/web/src/schemas.ts | Updated schema index to reference new context types. |
| packages/format/src/types/program/context.ts | Extended context types to include new contexts (frame, pick, gather). |
| packages/format/src/types/program/context.test.ts | Added tests for the new context types. |
Files not reviewed (5)
- packages/web/spec/program/context/frame.mdx: Language not supported
- packages/web/spec/program/context/gather.mdx: Language not supported
- packages/web/spec/program/context/pick.mdx: Language not supported
- packages/web/spec/program/example.mdx: Language not supported
- packages/web/src/theme/ProgramExample/SourceContents.css: Language not supported
|
- Add code to check for `"pick"` contexts - Highlight multiple source ranges with different color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new context properties ("pick", "gather", and "frame") to extend the compile‐time context model and updates both schema definitions and UI components to handle these additions. Key changes include:
- Adding new JSON schema files for the "pick", "gather", and "frame" contexts.
- Updating the main context schema and type definitions to integrate the new properties.
- Refactoring the Program Example viewer components to support the new context types.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/program/context/pick.schema.yaml | New schema to define a "pick" context with an array of contexts. |
| schemas/program/context/gather.schema.yaml | New schema to define a "gather" context with an array of contexts. |
| schemas/program/context/frame.schema.yaml | New schema for "frame" context; potential issue in the property type. |
| schemas/program/context.schema.yaml | Integration of new contexts via if-then conditions. |
| packages/web/src/theme/ProgramExample/Viewer.tsx | Removed legacy context usage and replaced with the Details component. |
| packages/web/src/theme/ProgramExample/SourceContents.tsx | Added support for "pick" context and parameterized code decorations. |
| packages/web/src/theme/ProgramExample/Details.tsx | New component to present detailed context information. |
| packages/web/src/schemas.ts | Updated schema index to include the new context types. |
| packages/format/src/types/program/context.ts | Extended context type definitions with new interfaces and guards. |
| packages/format/src/types/program/context.test.ts | Added test cases for validating the new context types. |
Files not reviewed (5)
- packages/web/spec/program/context/frame.mdx: Language not supported
- packages/web/spec/program/context/gather.mdx: Language not supported
- packages/web/spec/program/context/pick.mdx: Language not supported
- packages/web/spec/program/example.mdx: Language not supported
- packages/web/src/theme/ProgramExample/SourceContents.css: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new context properties ("pick", "gather", and "frame") to provide flexible composition of context information for compile-time debugging. Key changes include:
- Addition of new JSON schemas for "pick", "gather", and "frame" contexts.
- Updates to the composite context schema and type definitions to incorporate the new properties.
- Modifications to the frontend components to support decorating and displaying ambiguous context via the new "pick" property.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| schemas/program/context/pick.schema.yaml | New JSON schema defining the "pick" context property. |
| schemas/program/context/gather.schema.yaml | New JSON schema defining the "gather" context property. |
| schemas/program/context/frame.schema.yaml | New JSON schema defining the "frame" context property. |
| schemas/program/context.schema.yaml | Updated to conditionally reference new schemas for pick/gather/frame. |
| packages/web/src/theme/ProgramExample/Viewer.tsx | Updated to replace inlined context details with a dedicated component. |
| packages/web/src/theme/ProgramExample/SourceContents.tsx | Enhanced to support new pick contexts via decoration functions. |
| packages/web/src/theme/ProgramExample/Details.tsx | New component to display detailed context information. |
| packages/web/src/schemas.ts | Extended schema indexing for new context properties. |
| packages/format/src/types/program/context.ts | Extended type definitions and guards to include pick/gather/frame. |
| packages/format/src/types/program/context.test.ts | Added tests for the new context types. |
Files not reviewed (5)
- packages/web/spec/program/context/frame.mdx: Language not supported
- packages/web/spec/program/context/gather.mdx: Language not supported
- packages/web/spec/program/context/pick.mdx: Language not supported
- packages/web/spec/program/example.mdx: Language not supported
- packages/web/src/theme/ProgramExample/SourceContents.css: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new context properties ("pick", "gather", and "frame") to better support ambiguous contexts in the system. Key changes include new JSON schema definitions, updates to type definitions and guards, and adjustments in the interactive example viewer and related components.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/program/context/pick.schema.yaml | Added JSON schema for "pick" context. |
| schemas/program/context/gather.schema.yaml | Added JSON schema for "gather" context with examples. |
| schemas/program/context/frame.schema.yaml | Added JSON schema for "frame" context. |
| schemas/program/context.schema.yaml | Updated main context schema to include "pick", "gather", and "frame". |
| packages/web/src/theme/ProgramExample/Viewer.tsx | Refactored viewer to use new Details component. |
| packages/web/src/theme/ProgramExample/SourceContents.tsx | Integrated support for "pick" context with new decoration logic. |
| packages/web/src/theme/ProgramExample/Details.tsx | New component for detailed context view. |
| packages/web/src/schemas.ts | Updated schema index with new context entries. |
| packages/format/src/types/program/context.ts | Added type definitions and guard functions for new contexts. |
| packages/format/src/types/program/context.test.ts | Extended tests to cover new context types. |
Files not reviewed (5)
- packages/web/spec/program/context/frame.mdx: Language not supported
- packages/web/spec/program/context/gather.mdx: Language not supported
- packages/web/spec/program/context/pick.mdx: Language not supported
- packages/web/spec/program/example.mdx: Language not supported
- packages/web/src/theme/ProgramExample/SourceContents.css: Language not supported
Comments suppressed due to low confidence (1)
packages/web/src/theme/ProgramExample/SourceContents.tsx:89
- [nitpick] Review the naming of the CSS class 'highlighted-ambiguous-code' for consistency with other context classes to ensure it clearly communicates its purpose.
return pick.flatMap((choice) => decorateCodeContext(choice, source, "highlighted-ambiguous-code"));
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces additional context properties ("pick", "gather", and "frame") to expand the program context schema and its corresponding TypeScript definitions, while also updating the UI components and tests to support these new types.
- Added new JSON schemas for pick, gather, and frame contexts.
- Extended TypeScript definitions and tests to recognize the new context types.
- Updated UI components to utilize the new context properties for improved context presentation.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| schemas/program/context/pick.schema.yaml | Defines the "pick" context schema supporting multiple context choices. |
| schemas/program/context/gather.schema.yaml | Adds the "gather" context schema for simultaneous context application. |
| schemas/program/context/frame.schema.yaml | Introduces the "frame" context schema for specifying compilation frame details. |
| schemas/program/context.schema.yaml | Integrates new "if" conditions to reference the new context schemas. |
| packages/web/src/theme/ProgramExample/Viewer.tsx | Refactors viewer component to switch from old context display to the new Details component. |
| packages/web/src/theme/ProgramExample/SourceContents.tsx | Enhances source content decoration to support the "pick" context via a new helper function. |
| packages/web/src/theme/ProgramExample/Details.tsx | New component for rendering detailed context information based on user interaction. |
| packages/web/src/schemas.ts | Updates the schema index with new context mappings. |
| packages/format/src/types/program/context.ts | Extends TypeScript types and guard functions to include pick, gather, and frame contexts. |
| packages/format/src/types/program/context.test.ts | Adds tests to validate the new context type guards. |
Files not reviewed (5)
- packages/web/spec/program/context/frame.mdx: Language not supported
- packages/web/spec/program/context/gather.mdx: Language not supported
- packages/web/spec/program/context/pick.mdx: Language not supported
- packages/web/spec/program/example.mdx: Language not supported
- packages/web/src/theme/ProgramExample/SourceContents.css: Language not supported
Comments suppressed due to low confidence (1)
packages/format/src/types/program/context.test.ts:21
- [nitpick] Ensure the tests for the new context types cover edge cases such as mixed valid and invalid entries (e.g. non-code elements in a Pick array) to prevent unexpected behavior in production.
testSchemaGuards("ethdebug/format/program/context", [
To support ambiguity and such.
Deploy preview