Skip to content

Commit f911e9e

Browse files
remove DeputyPreferences
DeputyPreferences is a forgotten duplicate of what is now UserConfiguration, and only ever has one setting inside of it. Removing it in favor of the more-featured and maintained Configuration system.
1 parent e4c177b commit f911e9e

File tree

5 files changed

+9
-37
lines changed

5 files changed

+9
-37
lines changed

i18n/settings/en.json

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"deputy.setting.user.cci.showCvLink.description": "Show a \"cv\" link next to \"cur\" and \"prev\" on revision rows. This link will only appear if this wiki is configured to use Earwig's Copyvio Detector.",
5454
"deputy.setting.user.cci.showUsername.name": "Show username",
5555
"deputy.setting.user.cci.showUsername.description": "Show the username of the user who made the edit on revision rows. This may be redundant for cases which only have one editor.",
56+
"deputy.setting.user.cci.autoCollapseRows.name": "Automatically collapse rows",
57+
"deputy.setting.user.cci.autoCollapseRows.description": "Automatically collapse rows when the page is loaded. This is useful for cases where each row has many revisions, but may be annoying for cases where each row has few revisions.",
5658
"deputy.setting.user.cci.autoShowDiff.name": "Automatically show diffs",
5759
"deputy.setting.user.cci.autoShowDiff.description": "Enabling automatic loading of diffs. Configurable with two additional options to avoid loading too much content.",
5860
"deputy.setting.user.cci.maxRevisionsToAutoShowDiff.name": "Maximum revisions to automatically show diff",

src/Deputy.ts

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import DeputySession from './session/DeputySession';
55
import DeputyCasePage from './wiki/DeputyCasePage';
66
import DeputyDispatch from './api/DeputyDispatch';
77
import ContributionSurveyRow from './models/ContributionSurveyRow';
8-
import { DeputyPreferences } from './DeputyPreferences';
98
import performHacks from './wiki/util/performHacks';
109
import DeputyCase from './wiki/DeputyCase';
1110
import unwrapWidget from './util/unwrapWidget';
@@ -43,7 +42,6 @@ class Deputy {
4342
readonly DeputyDispatch = DeputyDispatch;
4443
readonly DeputyStorage = DeputyStorage;
4544
readonly DeputySession = DeputySession;
46-
readonly DeputyPreferences = DeputyPreferences;
4745
readonly DeputyCommunications = DeputyCommunications;
4846
readonly DeputyCase = DeputyCase;
4947
readonly DeputyCasePage = DeputyCasePage;
@@ -74,7 +72,6 @@ class Deputy {
7472

7573
dispatch: DeputyDispatch;
7674
storage: DeputyStorage;
77-
prefs: DeputyPreferences;
7875
comms: DeputyCommunications;
7976
session: DeputySession;
8077
config: UserConfiguration;
@@ -153,8 +150,6 @@ class Deputy {
153150
await this.storage.init();
154151
// Initialize the Deputy API interface
155152
this.dispatch = new DeputyDispatch();
156-
// Initialize the Deputy preferences instance
157-
this.prefs = new DeputyPreferences();
158153
// Initialize communications
159154
this.comms = new DeputyCommunications();
160155
this.comms.init();

src/DeputyPreferences.ts

-31
This file was deleted.

src/config/UserConfiguration.ts

+6
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ export default class UserConfiguration extends ConfigurationBase {
9292
type: 'checkbox'
9393
}
9494
} ),
95+
autoCollapseRows: new Setting<boolean, boolean>( {
96+
defaultValue: false,
97+
displayOptions: {
98+
type: 'checkbox'
99+
}
100+
} ),
95101
autoShowDiff: new Setting<boolean, boolean>( {
96102
defaultValue: false,
97103
displayOptions: {

src/ui/root/DeputyContributionSurveyRow.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ export default class DeputyContributionSurveyRow extends EventTarget implements
845845
framed: false
846846
} );
847847

848-
let contentToggled = window.deputy.prefs.get( 'cci.contentDefault' );
848+
let contentToggled = !window.deputy.config.cci.autoCollapseRows.get();
849849
/**
850850
* Toggles the content.
851851
*

0 commit comments

Comments
 (0)