Skip to content

v3.45.4

@MrCoder MrCoder tagged this 09 Jan 11:32
* adjust top of participant element for creation.

* fix: adjust creation message vertical positioning for pixel-perfect alignment

- Updated Creation component translation from -50% to calc(50%-1px)
- Adjusted VerticalCoordinates paddingTop from top-8 to top-7
- Updated all Playwright test snapshots to reflect visual changes

* chore: update Playwright snapshots for Linux CI

  Generated Linux-specific snapshots for chromium-linux platform.

  🤖 Generated with [Claude Code](https://claude.ai/code)

  Co-Authored-By: Claude <noreply@anthropic.com>

* fix: adjust cursor increment for assignment calculation in CreationStatementVM

* docs: add assignment context details to Assignment.md

* refactor: simplify assignment return condition in Occurrence component

* fix: remove unnecessary context from return values of assigneeData

* refactor: move labelPosition calculation into Assignment class

- Add labelPosition property to Assignment class and IAssignment interface
- Calculate labelPosition during Assignment creation in MessageContext.prototype.Assignment()
- Update Occurrence component to use assignment.labelPosition directly
- Update tests to handle new Assignment constructor signature
- Eliminates duplicate labelPosition calculation code

* refactor: extract Assignment class into dedicated module and unify assignment logic

- Create src/parser/Messages/Assignment.ts with Assignment class and prototype functions
- Add CreationContext.prototype.Assignment() for creation statements
- Extract both MessageContext and CreationContext Assignment functions to dedicated module
- Update imports in test files to use new Assignment module
- Merge duplicate assignment logic in Occurrence component into single unified code path
- Use duck typing to check for Assignment function, eliminating need for context type detection
- Reduce Occurrence assigneeData memo from 21 lines to 10 lines

Benefits:
- Single source of truth for Assignment class and prototype extensions
- Unified API for both CreationContext and MessageContext
- Eliminated 11 lines of duplicate code in Occurrence component
- Better code organization with dedicated Assignment module

* feat: implement structured assignment editing with separate assignee and type

- Add typePosition tracking to Assignment class for independent position tracking
- Create AssignmentReturnLabel component with dual EditableSpan for separate editing
- Update Message and MessageView components to support children composition pattern
- Refactor Occurrence component to use structured assignment rendering
- Add comprehensive tests for new assignment position tracking
- Update Playwright snapshots for visual regression testing

This enables users to independently edit assignee and type in assignment return
messages (e.g., 'Type ret = A.m()' renders as 'ret:Type' with separate edit regions).
Uses React children composition pattern to maintain Message component reusability
while supporting structured content.

All 572 unit tests and Playwright tests passing.

* refactor: apply composition pattern to Creation message label

- Create CreationMessageLabel component encapsulating creation-specific rendering
- Update Creation component to use CreationMessageLabel as children
- Handle both static and editable modes correctly:
  - Static mode: show «labelText || 'create'»
  - Editable mode with empty parameters: show «create» as non-editable placeholder
  - Editable mode with parameters: show guillemets with EditableSpan
- Update test expectations to match correct behavior

This applies the composition pattern established for assignment returns to
creation messages, improving architectural consistency. The CreationMessageLabel
encapsulates creation-specific rendering (guillemets around parameters) while
the Message component provides the structural chrome (border, arrow, numbering).

The component properly handles the default 'create' text when no constructor
parameters are present, matching the original MessageView behavior.

All 488 unit tests and Playwright tests passing.

* refactor: remove creation-specific logic from MessageView

Remove creation message handling from MessageView now that CreationMessageLabel
handles all creation-specific rendering through composition pattern:
- Remove isCreation variable and guillemet wrapping logic
- Remove static mode creation-specific rendering
- Simplify to render just labelText in non-editable mode

This completes the composition pattern migration where:
- CreationMessageLabel: handles all creation rendering (guillemets, 'create' default)
- MessageView: provides generic message structure (border, arrow, numbering)
- Clean separation of concerns with no conditional creation logic

All 488 unit tests and Playwright tests passing.

* refactor: extract EditableLabelField and complete composition pattern

Extract duplicated editable label logic into reusable EditableLabelField
component and complete composition pattern across all message types.

Core Changes:
- Create EditableLabelField atomic component with shared position-based
  editing logic (handles modeAtom, codeAtom, onContentChangeAtom, formatText,
  and save handler)
- Refactor MessageLabel to compose EditableLabelField (50 → 17 lines)
- Refactor CreationMessageLabel to compose EditableLabelField (70 → 40 lines)
- Refactor AssignmentReturnLabel to compose EditableLabelField (95 → 40 lines)
- Simplify MessageView to require children, remove all conditionals (81 → 60 lines)
- Simplify Message component API, remove unused props (67 → 47 lines)
- Update Interaction, Return, and Interaction-async to pass MessageLabel as children

Architectural Benefits:
- DRY: Single source of truth eliminates 150+ lines of duplication
- Atomic Design: Clear hierarchy (EditableLabelField → Labels → Message)
- Zero Conditionals: MessageView is pure structural with no business logic
- Consistent Pattern: ALL messages use children composition pattern
- Single Responsibility: Each component has one clear, focused purpose
- Type Safety: children prop is required, not optional
- Maintainability: Changes to editing logic in one place

Code Reduction:
- Before: 296 total lines with 150+ lines duplicated
- After: 195 total lines, zero duplication
- Savings: 101 lines eliminated (34% reduction)

All 488 unit tests and Playwright tests passing.

* refactor: eliminate duplication in Assignment extraction logic

Extract common assignment extraction logic into extractAssignmentFromContext()
helper function to remove ~25 lines of duplicated code between
MessageContext.prototype.Assignment and CreationContext.prototype.Assignment.

Both contexts use the same assignment rule structure from the grammar,
so the extraction logic can be shared. This reduces Assignment.ts from
89 lines to 81 lines while maintaining the same functionality.

* refactor: clean up commented code in SyncMessageStatementVM

Remove commented-out console.info statements and unused signature
variable that are no longer needed after the refactoring.

* chore: update Playwright snapshots for Linux CI

  Generated Linux-specific snapshots for chromium-linux platform.

  🤖 Generated with [Claude Code](https://claude.ai/code)

  Co-Authored-By: Claude <noreply@anthropic.com>

* ci: chain e2e workflow after update-snapshots using workflow_call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Assets 2
Loading