Repository navigation
fix: el campo de subtarea vacío se retira solo - #3
Merged
Merged
Conversation
El chevron que agregué antes existía pero no resolvía el problema real: nadie espera cerrar un campo huérfano con una flecha de 8 píxeles. Ahora el grupo vacío se colapsa al perder el foco (clic en otra parte) o con Esc, y '+' alterna en vez de solo abrir. Verificado renderizando el estado exacto (grupo expandido sin subtareas) antes y después.
There was a problem hiding this comment.
Pull request overview
Este PR ajusta el comportamiento de la UI de subtareas para que el campo vacío de “Agregar paso…” no quede “colgado” cuando el usuario abre un grupo vacío y luego se arrepiente (alineado con SPEC §4.2), haciendo que se retire al perder foco, con Esc, o al tocar + nuevamente.
Changes:
- Actualiza la SPEC para detallar el nuevo cierre automático del campo de subtarea vacío (blur/
Esc/+). - Hace que
+actúe como toggle en grupos vacíos ya expandidos (segundo toque cierra). - Notifica cancelación al perder foco cuando el campo está vacío (para permitir retirar el campo).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/SPEC.md | Documenta el nuevo comportamiento de cierre del campo vacío en grupos de subtareas. |
| Corner/UI/TaskGroupRows.swift | Cambia onAddSubtask para que + cierre un grupo vacío ya expandido. |
| Corner/UI/NewTaskField.swift | Añade cancelación por pérdida de foco cuando el campo queda vacío. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+38
to
+43
| .onChange(of: focused) { wasFocused, isFocused in | ||
| // Perder el foco con el campo vacío = el usuario se | ||
| // arrepintió: avisar para que quien lo muestre lo retire | ||
| // (un campo vacío colgando no debe quedarse, SPEC §4.2). | ||
| if wasFocused, !isFocused, text.isEmpty { onCancel?() } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
El fix anterior (chevron disponible en grupos vacíos) era correcto pero insuficiente: la salida no era evidente. Ahora el campo vacío desaparece al hacer clic fuera, con Esc, o tocando '+' de nuevo.