Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions client/src/components/settings/GeneralTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ export function GeneralTab() {
label="Discard unsaved General settings changes"
onDiscard={discardAndExit}
/>
<div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">
<h3 className="text-lg font-semibold text-white mb-4">Interface Theme</h3>
<ThemePickerPanel />
</div>

<div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">
<h3 className="text-lg font-semibold text-white mb-4">Timezone</h3>
<p className="text-sm text-gray-400 mb-4">
Expand Down Expand Up @@ -288,6 +283,11 @@ export function GeneralTab() {
)}
</div>
</div>

<div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">
<h3 className="text-lg font-semibold text-white mb-4">Interface Theme</h3>
<ThemePickerPanel />
</div>
</div>
);
}
Expand Down
8 changes: 8 additions & 0 deletions client/src/components/settings/GeneralTab.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ beforeEach(() => {
});

describe('GeneralTab unsaved changes', () => {
it('places save-backed settings before the instant theme picker', async () => {
await renderTab();

const headings = screen.getAllByRole('heading').map(heading => heading.textContent);
expect(headings).toEqual(expect.arrayContaining(['Timezone', 'Interface Theme']));
expect(headings.indexOf('Timezone')).toBeLessThan(headings.indexOf('Interface Theme'));
});

it('guards edits made against the displayed fallback after loading fails', async () => {
getSettings.mockRejectedValueOnce(new Error('settings offline'));
const router = await renderTab({ expectedTimezone: null });
Expand Down