bug(layout-editor): theme refinements like "change it to dark" are ignored with AI providers
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 88/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, react
- Domínio
- frontend
Direção de pesquisa
Comece por packages/layout_editor/src/lib/themeGenerationService.js, com foco em inferMode, requestedRefinementFields e limitRefinementSuggestion. Adicione um teste de regressão para as frases de acompanhamento listadas e verifique se o modo é mantido; o trabalho estará concluído quando esses refinamentos mudarem para o modo claro ou escuro solicitado e o comportamento existente continuar funcionando.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description:
In the layout editor's theme assistant, a follow-up request like "change it to dark" does not switch the mode when an AI provider (Ollama, OpenAI or Gemini) is used. The request is understood, then discarded.
In packages/layout_editor/src/lib/themeGenerationService.js, inferMode accepts switch|change|set|turn (it) to light|dark, but requestedRefinementFields only allows the mode field for "light/dark mode", "light/dark theme" or exactly "switch to light/dark". limitRefinementSuggestion then drops mode, both from the provider's answer and from the local parsing that is meant to take precedence.
Steps to reproduce:
- Open the layout editor theme assistant with an AI provider selected and generate a light theme.
- Send the follow-up "change it to dark".
Or directly:
limitRefinementSuggestion({ primaryHex: '#ef4444', mode: 'dark' }, 'Change it to dark');
Expected behavior:
The theme switches to dark mode, as it does for "switch to dark theme".
Actual behavior:
Nothing changes, because limitRefinementSuggestion returns {}. The same happens for "switch it to dark", "set it to dark", "turn it to light" and "change to light". The fallback provider is not affected, because it skips limitRefinementSuggestion.
I'd like to send a fix that uses the same pattern for both checks, with a regression test.
- Linguagem predominante
- JavaScript
- Estrelas
- 170
- Forks
- 397
- Merge médio
- 8d 20h
- PRs com merge (30d)
- 6
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de RocketChat/EmbeddedChat
-
Bug: Unused media visibility check and missing useMemo dependencies cause stale/invalid actions in MessageToolbox.jsTalvez já em andamento @yashsarvaiya45 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
RocketChat/EmbeddedChat#1437 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
RocketChat/EmbeddedChat#1432 ·
Mantenedores costumam responder em até 1 dia
-
bug: emoji suggestions open for times like 12:00 and Enter inserts an emoji instead of sendingAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
RocketChat/EmbeddedChat#1431 ·
Mantenedores costumam responder em até 1 dia
-
bug: editing a multi-line message saves literal \n instead of line breaksTalvez já em andamento @arshil42 assumiu hoje. Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 92/100
RocketChat/EmbeddedChat#1430 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Nested inline code, emoji and mentions disappear inside bold, italic and strikethroughTalvez já em andamento @gitseraj assumiu há 2 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
RocketChat/EmbeddedChat#1429 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de RocketChat/EmbeddedChat
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
sfbrigade/pocket-gardens#60 ·
Mantenedores costumam responder em até 5 dias
-
The print preview leaves writing space short by the margins of hidden headers, footers and solutionsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
PreTeXtBook/pretext#3329 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
NativeScript/ios#577 ·
Mantenedores costumam responder em até 1 dia
-
could-have
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
-
01 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 2 dias