Skip to content

06 Editor Toolbar - #21

Open
notnohora wants to merge 2 commits into
mainfrom
06-editor-toolbar
Open

notnohora wants to merge 2 commits into
mainfrom
06-editor-toolbar

Conversation

@notnohora

Copy link
Copy Markdown

En este PR se implementa la barra de herramientas del editor (editor-toolbar) para el workspace de desafíos.

Cambios realizados:
Se creó el componente editor-toolbar.
Se definió el tipo LanguageId para los lenguajes soportados.
Se implementó un selector de lenguaje con menú desplegable personalizado.
Se agregó el estado local para gestionar el lenguaje seleccionado.
Se implementó la comunicación entre el toolbar y el contenedor mediante eventos.
Se añadieron las acciones básicas del editor (configuración, reiniciar y expandir).
Se integró al componente en challenge-workspace.
Se ajustaron los estilos y la distribución para seguir el diseño de Figma.
Se agregaron pruebas unitarias para la selección de lenguaje y las acciones del componente.

Closes #6

@notnohora
notnohora requested a review from Djkde01 July 18, 2026 17:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7335849c34

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +15 to +19
<app-editor-toolbar
[languages]="state.languages"
[selectedLanguage]="state.selectedLanguage()"
(languageChange)="state.setLanguage($event)">
</app-editor-toolbar>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore logout access in the workspace

In the authenticated challenge-workspace route, this replacement removes the only rendered user/logout controls; a repo-wide search shows no other logout UI, while logout() is still left on the container. After a user reaches the workspace they no longer have a way to sign out, so keep the auth controls in the header/toolbar while adding the editor toolbar.

Useful? React with 👍 / 👎.

Comment on lines +15 to +18
<app-editor-toolbar
[languages]="state.languages"
[selectedLanguage]="state.selectedLanguage()"
(languageChange)="state.setLanguage($event)">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire or hide the inert toolbar actions

When this container renders <app-editor-toolbar>, it only listens to languageChange; the toolbar still shows Settings, Reset, and Expand buttons whose outputs are never bound here, so clicking any of those visible controls is a no-op for every workspace user. Bind those outputs to container behavior or do not render the buttons until they are implemented.

Useful? React with 👍 / 👎.

Comment on lines +42 to +44
background: #262626;
border: none;
outline: none;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve keyboard focus on the language toggle

For keyboard users tabbing through the editor toolbar, this removes the browser focus ring from the language button without adding any replacement :focus-visible styling. The control still receives focus and opens the menu, but users cannot tell where focus is, so keep the outline or provide an explicit visible focus state.

Useful? React with 👍 / 👎.


readonly languages: LanguageId[] = [
'javascript',
'python'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't offer Python before starter code is wired

With this new python option in the rendered language list, selecting Python only changes selectedLanguage; the editor surface still renders the single challenge().editorSnippet from the Two Sum fixture, which is JavaScript. Users can therefore put the toolbar into Python while the code area remains JavaScript starter code, so either wire per-language source updates before exposing Python or keep the list to languages the editor can actually display.

Useful? React with 👍 / 👎.

border-bottom: 1px solid #2a2a2a;
}
display: grid;
grid-template-columns: 1fr 1fr;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let the toolbar stack on narrow screens

On viewports below the existing 900px breakpoint, .workspace-main switches to one column but this toolbar still forces the tabs and the new editor toolbar into two half-width columns. The editor toolbar's language selector plus three icon buttons need more than a phone-width half column, so the controls overflow or get clipped by .workspace-layout { overflow: hidden; }; add a matching responsive rule for the toolbar instead of keeping 1fr 1fr at small widths.

Useful? React with 👍 / 👎.

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-06: Implementar toolbar del editor y selector de lenguaje

1 participant