Skip to content

Commit a415f2a

Browse files
committed
fix: preserva estado do Settings ao trocar de aba com display:none
Substituída renderização condicional (desmonta/remonta o componente) por display:none/block em todas as views. Assim SettingsView nunca é desmontado e os valores digitados nos campos são mantidos independentemente de salvar ou trocar de aba.
1 parent 23e66cc commit a415f2a

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

webview-ui/src/App.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const App: React.FC = () => {
206206

207207
<div className="pc">
208208

209-
{activeTab === 'dashboard' && (
209+
<div style={{ display: activeTab === 'dashboard' ? 'block' : 'none' }}>
210210
<DashboardView
211211
scoreData={scoreData}
212212
scoreLoading={scoreLoading}
@@ -218,21 +218,21 @@ const App: React.FC = () => {
218218
isPublishing={isPublishing}
219219
onPublish={handlePublish}
220220
/>
221-
)}
221+
</div>
222222

223-
{activeTab === 'output' && (
223+
<div style={{ display: activeTab === 'output' ? 'block' : 'none' }}>
224224
<OutputView lines={logLines} />
225-
)}
225+
</div>
226226

227-
{activeTab === 'settings' && (
227+
<div style={{ display: activeTab === 'settings' ? 'block' : 'none' }}>
228228
<SettingsView
229229
initialData={settings}
230230
onSave={handleSaveSettings}
231231
savedFeedback={settingsSavedFeedback}
232232
/>
233-
)}
233+
</div>
234234

235-
{activeTab === 'action' && (
235+
<div style={{ display: activeTab === 'action' ? 'block' : 'none' }}>
236236
<ActionView
237237
yaml={yaml}
238238
onChange={setYaml}
@@ -242,7 +242,7 @@ const App: React.FC = () => {
242242
running={isRunning}
243243
alert={actionAlert}
244244
/>
245-
)}
245+
</div>
246246

247247
</div>
248248
</>

0 commit comments

Comments
 (0)