Skip to content

Commit 694b342

Browse files
committed
Styling fixes, apply informal name style to all anonymous profiles)
1 parent aeced5b commit 694b342

3 files changed

Lines changed: 26 additions & 21 deletions

File tree

frontend/src/components/stages/profile_stage_editor.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99

1010
.checkbox-wrapper {
1111
@include common.flex-row-align-center;
12-
gap: common.$spacing-medium;
12+
gap: common.$spacing-small;
1313
}
1414

1515
md-checkbox {
1616
flex-shrink: 0;
1717
}
1818

19+
.tab {
20+
margin-left: calc(48px + common.$spacing-small);
21+
}
22+
1923
.profile-options {
2024
@include common.flex-column;
2125
gap: common.$spacing-medium;

frontend/src/components/stages/profile_stage_editor.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,25 @@ export class ProfileStageEditorComponent extends MobxLitElement {
9696
></md-radio>
9797
<label>🐱 Generate anonymous animal-themed profiles</label>
9898
</div>
99-
${this.stage.profileType === ProfileType.ANONYMOUS_ANIMAL
99+
<div class="profile-option">
100+
<md-radio
101+
name="profile-type"
102+
value="participant"
103+
?checked=${this.stage.profileType ===
104+
ProfileType.ANONYMOUS_PARTICIPANT}
105+
?disabled=${!this.experimentEditor.canEditStages}
106+
@change=${() =>
107+
handleProfileTypeChange(ProfileType.ANONYMOUS_PARTICIPANT)}
108+
></md-radio>
109+
<label
110+
>👤 Generate anonymous participant profiles (Participant 1, 2,
111+
...)</label
112+
>
113+
</div>
114+
${this.stage.profileType === ProfileType.ANONYMOUS_ANIMAL ||
115+
this.stage.profileType === ProfileType.ANONYMOUS_PARTICIPANT
100116
? html`
101-
<label class="checkbox-wrapper">
117+
<label class="checkbox-wrapper tab">
102118
<md-checkbox
103119
touch-target="wrapper"
104120
?checked=${this.stage.informalNameStyle}
@@ -113,27 +129,12 @@ export class ProfileStageEditorComponent extends MobxLitElement {
113129
>
114130
</md-checkbox>
115131
<span
116-
>Use informal name style (e.g., bear123 instead of Bear
117-
1002)</span
132+
>Use informal name style (e.g., bear123 or
133+
participant123)</span
118134
>
119135
</label>
120136
`
121137
: nothing}
122-
<div class="profile-option">
123-
<md-radio
124-
name="profile-type"
125-
value="participant"
126-
?checked=${this.stage.profileType ===
127-
ProfileType.ANONYMOUS_PARTICIPANT}
128-
?disabled=${!this.experimentEditor.canEditStages}
129-
@change=${() =>
130-
handleProfileTypeChange(ProfileType.ANONYMOUS_PARTICIPANT)}
131-
></md-radio>
132-
<label
133-
>👤 Generate anonymous participant profiles (Participant 1, 2,
134-
...)</label
135-
>
136-
</div>
137138
</div>
138139
`;
139140
}

utils/src/participant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export function setProfile(
223223
[PROFILE_SET_ANIMALS_2_ID]: profileFromSet(PROFILE_SET_ANIMALS_2),
224224
[PROFILE_SET_NATURE_ID]: profileFromSet(PROFILE_SET_NATURE),
225225
[PROFILE_SET_ANONYMOUS_PARTICIPANT_ID]: {
226-
name: `Participant ${randomNumber}`,
226+
name: formatName('Participant'),
227227
avatar: '👤',
228228
repeat: 0,
229229
},

0 commit comments

Comments
 (0)