Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {core} from '../../core/core';
import {AnalyticsService, ButtonClick} from '../../services/analytics.service';
import {ExperimentManager} from '../../services/experiment.manager';
import {ExperimentService} from '../../services/experiment.service';
import {Pages, RouterService} from '../../services/router.service';
import {RouterService} from '../../services/router.service';

import {
ParticipantProfileExtended,
Expand Down Expand Up @@ -81,7 +81,8 @@ export class ParticipantSummary extends MobxLitElement {
>
</participant-progress-bar>
${this.renderPauseButton()} ${this.renderCopyButton()}
${this.renderAttentionButton()} ${this.renderBootButton()}
${this.renderMessageButton()} ${this.renderAttentionButton()}
${this.renderBootButton()}
</div>
</div>
`;
Expand Down Expand Up @@ -332,6 +333,40 @@ export class ParticipantSummary extends MobxLitElement {
</pr-tooltip>
`;
}

private renderMessageButton() {
if (!this.participant || this.participant.agentConfig) {
return nothing;
}

const messageParticipant = () => {
if (!this.participant) return;
this.analyticsService.trackButtonClick(ButtonClick.PARTICIPANT_MESSAGE);

// Select the participant
this.experimentManager.setCurrentParticipantId(
this.participant.privateId,
);
// Open the alerts panel
this.experimentManager.setActivePanel('alerts');
// Pre-populate alert compose target
this.experimentManager.alertComposeTarget = this.participant.privateId;
};

return html`
<pr-tooltip text="Message participant" position="LEFT_START">
<pr-icon-button
icon="mail"
color="neutral"
variant="default"
?disabled=${!this.participant ||
isParticipantEndedExperiment(this.participant)}
@click=${messageParticipant}
>
</pr-icon-button>
</pr-tooltip>
`;
}
}

declare global {
Expand Down
62 changes: 61 additions & 1 deletion frontend/src/components/experimenter/experimenter_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pr-button pr-icon {
gap: common.$spacing-xs;
}

.alert-response-input {
.alert-input-wrapper {
@include common.flex-row-align-center;
border: 1px solid var(--md-sys-color-outline);
border-radius: common.$spacing-small;
Expand Down Expand Up @@ -312,3 +312,63 @@ pr-button pr-icon {
gap: common.$spacing-small;
}
}

.chip {
display: inline-flex;
align-items: center;
font-size: 10px;
font-weight: bold;
padding: 2px 6px;
border-radius: 4px;
text-transform: uppercase;

&.outgoing-badge {
background: var(--md-sys-color-secondary);
color: var(--md-sys-color-on-secondary);
}
}

.alert.outgoing {
background: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
border-color: var(--md-sys-color-secondary);

.alert-top {
border-bottom: 2px solid var(--md-sys-color-outline-variant);
}
}

.compose-section {
@include common.flex-column;
background: var(--md-sys-color-surface-variant);
border: 1px solid var(--md-sys-color-outline-variant);
border-radius: common.$spacing-medium;
gap: common.$spacing-medium;
padding: common.$spacing-large;
margin-bottom: common.$spacing-large;

.compose-header {
@include typescale.title-small;
color: var(--md-sys-color-on-surface-variant);
}

.compose-fields {
@include common.flex-column;
gap: common.$spacing-medium;
}

.participant-select {
@include typescale.body-medium;
background: var(--md-sys-color-surface);
border: 1px solid var(--md-sys-color-outline);
border-radius: common.$spacing-small;
color: var(--md-sys-color-on-surface);
padding: common.$spacing-medium;
width: 100%;
outline: none;

&:focus {
border-color: var(--md-sys-color-primary);
}
}
}
Loading
Loading