Skip to content

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Apr 10, 2025

To support ambiguity and such.

Deploy preview

@gnidan gnidan requested a review from Copilot April 23, 2025 19:57
Copy link
Contributor

Copilot AI left a 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

@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-04-29 19:02 UTC

gnidan added 2 commits April 29, 2025 14:45
- Add code to check for `"pick"` contexts
- Highlight multiple source ranges with different color
@gnidan gnidan requested a review from Copilot April 29, 2025 18:47
Copy link
Contributor

Copilot AI left a 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

@gnidan gnidan requested a review from Copilot April 29, 2025 18:50
Copy link
Contributor

Copilot AI left a 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

@gnidan gnidan marked this pull request as ready for review April 29, 2025 18:52
@gnidan gnidan requested a review from Copilot April 29, 2025 18:53
Copy link
Contributor

Copilot AI left a 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"));

@gnidan gnidan requested a review from Copilot April 29, 2025 18:58
Copy link
Contributor

Copilot AI left a 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", [

@gnidan gnidan merged commit a9dbbbb into main Apr 29, 2025
3 checks passed
@gnidan gnidan deleted the fancy-contexts branch April 29, 2025 19:00
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.

2 participants