Skip to content

Commit

Permalink
feat(ui): allow to sort comment columns and show comment in tooltip o…
Browse files Browse the repository at this point in the history
…n icon hover

ref #1054
  • Loading branch information
akiver committed Jan 25, 2025
1 parent 1d2961a commit 0dd7963
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 47 deletions.
1 change: 1 addition & 0 deletions src/node/video/hlae/get-hlae-version-from-executable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function getHlaeVersionFromExecutable(executablePath: string): Prom
return new Promise((resolve, reject) => {
const sanitizedExecutablePath = sanitizeExecutablePath(executablePath);

// TODO wmic is deprecated. https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic
exec(
`wmic datafile where 'name="${sanitizedExecutablePath}"' get version`,
{ windowsHide: true },
Expand Down
4 changes: 4 additions & 0 deletions src/ui/changelog/changelog-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export function ChangelogDialog() {
<Category>DOWNLOAD</Category> Improved error message when retrieving last MM matches while your Steam
account is in-game on another device.
</li>
<li>
<Category>UI</Category> Comment columns are now sortable, and the comment is displayed in a tooltip when
the icon is hovered over.
</li>
<li>
<Category>VIDEO</Category> Allow to set seconds before/after each kill/round to start/stop sequences
through a dialog.
Expand Down
1 change: 0 additions & 1 deletion src/ui/components/matches/use-matches-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function useMatchesColumns() {
width: 20,
allowResize: false,
allowMove: false,
allowSort: false,
},
{
id: 'tags',
Expand Down
10 changes: 2 additions & 8 deletions src/ui/components/table/cells/comment-cell.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Trans } from '@lingui/react/macro';
import { CommentDotsIcon } from 'csdm/ui/icons/comment-dots-icon';
import { Tooltip } from '../../tooltip';
import type { CellProps } from '../table-types';
import { MarkdownEditor } from '../../inputs/markdown-editor';

type Props = CellProps<{ comment?: string }>;

Expand All @@ -13,13 +13,7 @@ export function CommentCell({ data }: Props) {
}

return (
<Tooltip
content={
<p>
<Trans context="Tooltip">Comment</Trans>
</p>
}
>
<Tooltip delay={0} content={<MarkdownEditor defaultValue={comment} />}>
<CommentDotsIcon width={12} height={12} />
</Tooltip>
);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function Table<DataType extends Data>({ table }: Props<DataType>) {
}

return (
<div className="px-4">
<div className={column.allowResize ? 'px-4' : ''}>
{sortDirection === 'desc' ? <ArrowDownLongIcon height={16} /> : <ArrowUpLongIcon height={16} />}
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/ui/demos/table/use-demos-columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function useDemosColumns() {
}),
Cell: CommentCell,
allowResize: false,
allowSort: false,
allowMove: false,
},
{
Expand Down
1 change: 0 additions & 1 deletion src/ui/players/table/use-players-columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function usePlayersColumns() {
width: 20,
allowResize: false,
allowMove: false,
allowSort: false,
},
{
id: 'tags',
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr "Community gesperrt"

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr "Kommentar"

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2316,11 +2316,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr "Community banned"

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr "Comment"

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr ""

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr ""

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr "Ban communautaire"

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr "Commentaire"

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/pt-BR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr "Banido na comunidade"

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr "Comentário"

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/zh-CN/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr "社区封禁"

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr "评论"

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down
5 changes: 0 additions & 5 deletions src/ui/translations/zh-TW/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2321,11 +2321,6 @@ msgctxt "Tooltip"
msgid "Community banned"
msgstr ""

#: src/ui/components/table/cells/comment-cell.tsx
msgctxt "Tooltip"
msgid "Comment"
msgstr ""

#: src/ui/components/table/cells/kill-attributes-cell.tsx
msgctxt "Tooltip kill"
msgid "Headshot"
Expand Down

0 comments on commit 0dd7963

Please sign in to comment.