Skip to content

US-07: Code editor surface and problems integrations#15

Open
Copilot wants to merge 10 commits into
mainfrom
copilot/us-07-implementar-superficie-editor-codigo
Open

US-07: Code editor surface and problems integrations#15
Copilot wants to merge 10 commits into
mainfrom
copilot/us-07-implementar-superficie-editor-codigo

Conversation

Copy link
Copy Markdown

Copilot AI commented May 9, 2026

This PR introduces a real code editing surface in challenge-workspace for efficient code writing with visual feedback (gutter, active line, basic syntax highlighting), keeping code editable per language from the feature state.
Additionally, a decoupled contract is defined to allow future replacement of the internal editor without breaking container integration.

What’s included

  • Decoupled Editor UI (code-editor):

    • New standalone component with explicit API: code, language, codeChange.
    • Renders line numbers, active line (cursor/scroll), and basic syntax highlighting per language.
    • Surface is ready for future editor implementation swaps.
  • Feature State (challenge-workspace.state):

    • New state with selectedLanguage, codeByLanguage, computed code, and language catalog.
    • Loads starter code per language and preserves edits per language when switching.
  • Types and Contracts (challenge.types):

    • Adds ChallengeLanguage, challengeLanguages, labels, starter templates, and isChallengeLanguage type guard.
    • Removes dependency on loose strings in selector/state.
  • Container Integration:

    • challenge-workspace replaces the static <pre><code> block with <app-code-editor>.
    • Language selector is connected to state and starter code.
    • Now also connects <app-problem-content> and <app-code-editor> in the workspace layout, using the shared problem content component for the problem panel.
  • Behavior Coverage:

    • New specs for:
      • Editor (lines, change emission, active line, highlight)
      • State (starter per language, edit persistence per language)
      • Container (selector/editor/state synchronization)

Example usage

<app-problem-content></app-problem-content>
<app-code-editor
  [code]="challengeWorkspaceState.code()"
  [language]="challengeWorkspaceState.selectedLanguage()"
  (codeChange)="onCodeChange($event)"
></app-code-editor>

Copilot AI linked an issue May 9, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Add code editor surface for challenge workspace US-07: implementar superficie de editor en challenge-workspace May 9, 2026
Copilot AI requested a review from juanjo36 May 9, 2026 16:29
@juanjo36 juanjo36 changed the title US-07: implementar superficie de editor en challenge-workspace US-07: Code editor surface and problems integrations May 9, 2026
@juanjo36 juanjo36 closed this May 9, 2026
@juanjo36 juanjo36 deleted the copilot/us-07-implementar-superficie-editor-codigo branch May 9, 2026 23:25
@juanjo36 juanjo36 restored the copilot/us-07-implementar-superficie-editor-codigo branch May 9, 2026 23:27
@juanjo36 juanjo36 deleted the copilot/us-07-implementar-superficie-editor-codigo branch May 9, 2026 23:28
@juanjo36 juanjo36 restored the copilot/us-07-implementar-superficie-editor-codigo branch May 9, 2026 23:30
@juanjo36 juanjo36 reopened this May 9, 2026
…to copilot/us-07-implementar-superficie-editor-codigo
@juanjo36 juanjo36 marked this pull request as ready for review May 16, 2026 17:56
juanjo36 added 3 commits May 16, 2026 13:14
…estore types and fix templates

Restore challenge types, add ProblemContent component, wire CodeEditor to workspace state, and fix unit tests to match updated fixtures.
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.

US-07: Implementar superficie del editor de codigo

2 participants