Skip to content
Merged
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
33 changes: 24 additions & 9 deletions ui/analyse/src/explorer/explorerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ const playerModal = (ctrl: ExplorerConfigCtrl) => {
ctrl.selectPlayer(name);
ctrl.root.redraw();
};
const nameToOptionalColor = (name: string | undefined) => {
if (!name) {
return;
} else if (name === ctrl.myName) {
return '.button-green';
} else if (ctrl.data.playerName.previous().includes(name)) {
return '';
}
return '.button-metal';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the colour for game participants? It seems unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it would be nice to distinguish between participants whose names are in the search history and those that aren't, using that shade of gray to denote the participants who aren't in the search history can be controversial.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Aesthetically-speaking)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since users cannot add participants to the search history, it makes sense to gray out a participant if they are not in the search history.

};
return snabModal({
class: 'explorer__config__player__choice',
onClose() {
Expand Down Expand Up @@ -344,15 +354,20 @@ const playerModal = (ctrl: ExplorerConfigCtrl) => {
]),
h(
'div.previous',
[...(ctrl.myName ? [ctrl.myName] : []), ...ctrl.participants, ...ctrl.data.playerName.previous()].map(
name =>
h(
`button.button${name == ctrl.myName ? '.button-green' : ''}`,
{
hook: bind('click', () => onSelect(name)),
},
name,
),
[
...new Set([
...(ctrl.myName ? [ctrl.myName] : []),
...ctrl.participants,
...ctrl.data.playerName.previous(),
]),
].map(name =>
h(
`button.button${nameToOptionalColor(name)}`,
{
hook: bind('click', () => onSelect(name)),
},
name,
),
),
),
],
Expand Down