diff --git a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx
index 340f746f..a75c266e 100644
--- a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx
+++ b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx
@@ -11,35 +11,28 @@ type KillsBookmarkTooltipProps = {
systemId: string;
className?: string;
size?: TooltipSize;
- timeRange?: number;
} & WithChildren &
WithClassName;
-export const KillsCounter = ({
- killsCount,
- systemId,
- className,
- children,
- size = 'xs',
- timeRange = 1,
-}: KillsBookmarkTooltipProps) => {
+export const KillsCounter = ({ killsCount, systemId, className, children, size = 'xs' }: KillsBookmarkTooltipProps) => {
const { isLoading, kills: detailedKills, systemNameMap } = useKillsCounter({ realSystemId: systemId });
if (!killsCount || detailedKills.length === 0 || !systemId || isLoading) return null;
const tooltipContent = (
-
+
+
+
);
return (
- // @ts-ignore
{children}
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKills.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKills.tsx
index 9e2e4ce0..d57d379c 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKills.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKills.tsx
@@ -91,10 +91,8 @@ export const SystemKills: React.FC = React.memo(() => {
) : (
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.module.scss b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.module.scss
index 0b6d72c3..6914a74b 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.module.scss
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.module.scss
@@ -1,18 +1,12 @@
-.TableRowCompact {
- height: 8px;
- max-height: 8px;
- font-size: 12px !important;
- line-height: 8px;
+.wrapper {
+ overflow-x: hidden;
+ box-sizing: border-box;
}
-.Table {
- font-size: 12px;
- border-collapse: collapse;
-}
-
-.Tooltip {
- white-space: pre-line;
- line-height: 1.2rem;
+.scrollerContent {
+ width: 100%;
+ box-sizing: border-box;
+ overflow-x: hidden;
}
.VirtualScroller {
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.tsx
index 3b7909ac..efe531af 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/SystemKillsContent/SystemKillsContent.tsx
@@ -2,57 +2,52 @@ import React, { useMemo, useRef, useEffect, useState } from 'react';
import clsx from 'clsx';
import { DetailedKill } from '@/hooks/Mapper/types/kills';
import { VirtualScroller } from 'primereact/virtualscroller';
-import { useSystemKillsItemTemplate } from '../hooks/useSystemKillsTemplate';
+import { useSystemKillsItemTemplate } from '../hooks/useSystemKillsItemTemplate';
+import classes from './SystemKillsContent.module.scss';
export interface SystemKillsContentProps {
kills: DetailedKill[];
systemNameMap: Record
;
- compact?: boolean;
onlyOneSystem?: boolean;
autoSize?: boolean;
- timeRange: number;
+ timeRange?: number;
+ limit?: number;
}
export const SystemKillsContent: React.FC = ({
kills,
systemNameMap,
- compact = false,
onlyOneSystem = false,
autoSize = false,
- timeRange = 1,
+ timeRange = 4,
+ limit,
}) => {
const processedKills = useMemo(() => {
- const validKills = kills.filter(kill => kill.kill_time);
+ const sortedKills = kills
+ .filter(k => k.kill_time)
+ .sort((a, b) => new Date(b.kill_time!).getTime() - new Date(a.kill_time!).getTime());
- const sortedKills = validKills.sort((a, b) => {
- const timeA = a.kill_time ? new Date(a.kill_time).getTime() : 0;
- const timeB = b.kill_time ? new Date(b.kill_time).getTime() : 0;
- return timeB - timeA;
- });
+ if (limit !== undefined) {
+ return sortedKills.slice(0, limit);
+ } else {
+ const now = Date.now();
+ const cutoff = now - timeRange * 60 * 60 * 1000;
+ return sortedKills.filter(k => new Date(k.kill_time!).getTime() >= cutoff);
+ }
+ }, [kills, timeRange, limit]);
- const now = Date.now();
- const cutoff = now - timeRange * 60 * 60 * 1000;
- return sortedKills.filter(kill => {
- if (!kill.kill_time) return false;
- const killTime = new Date(kill.kill_time).getTime();
- return killTime >= cutoff;
- });
- }, [kills, timeRange]);
-
- const itemSize = compact ? 35 : 50;
- const computedHeight = autoSize ? Math.max(processedKills.length, 1) * itemSize + 5 : undefined;
+ const itemSize = 35;
+ const computedHeight = autoSize ? Math.max(processedKills.length, 1) * itemSize : undefined;
const containerRef = useRef(null);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const scrollerRef = useRef(null);
+ const scrollerRef = useRef(null);
const [containerHeight, setContainerHeight] = useState(0);
useEffect(() => {
if (!autoSize && containerRef.current) {
const measure = () => {
- const newHeight = containerRef.current?.clientHeight ?? 0;
+ const newHeight = containerRef.current?.clientHeight || 0;
setContainerHeight(newHeight);
- scrollerRef.current?.refresh?.();
};
measure();
@@ -67,18 +62,27 @@ export const SystemKillsContent: React.FC = ({
}
}, [autoSize]);
- const itemTemplate = useSystemKillsItemTemplate(systemNameMap, compact, onlyOneSystem);
+ const itemTemplate = useSystemKillsItemTemplate(systemNameMap, onlyOneSystem);
+ const scrollerHeight = autoSize ? `${computedHeight}px` : containerHeight ? `${containerHeight}px` : '100%';
return (
-
+
);
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/FullKillRow.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/FullKillRow.tsx
deleted file mode 100644
index 060acba7..00000000
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/FullKillRow.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-import React from 'react';
-import clsx from 'clsx';
-import { DetailedKill } from '@/hooks/Mapper/types/kills';
-import {
- formatISK,
- formatTimeMixed,
- zkillLink,
- getAttackerSubscript,
- buildVictimImageUrls,
- buildAttackerImageUrls,
- getPrimaryLogoAndTooltip,
- getAttackerPrimaryImageAndTooltip,
-} from '../helpers';
-import { VictimRowSubInfo } from './VictimRowSubInfo';
-import { WdTooltipWrapper } from '../../../../ui-kit/WdTooltipWrapper';
-import classes from './SystemKillRow.module.scss';
-import { TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
-
-export interface FullKillRowProps {
- killDetails: DetailedKill;
- systemName: string;
- onlyOneSystem: boolean;
-}
-
-export const FullKillRow: React.FC
= ({ killDetails, systemName, onlyOneSystem }) => {
- const {
- killmail_id = 0,
- // Victim data
- victim_char_name = '',
- victim_alliance_ticker = '',
- victim_corp_ticker = '',
- victim_ship_name = '',
- victim_char_id = 0,
- victim_corp_id = 0,
- victim_alliance_id = 0,
- victim_ship_type_id = 0,
- victim_corp_name = '',
- victim_alliance_name = '',
- // Attacker data
- final_blow_char_id = 0,
- final_blow_char_name = '',
- final_blow_alliance_ticker = '',
- final_blow_corp_ticker = '',
- final_blow_corp_name = '',
- final_blow_alliance_name = '',
- final_blow_corp_id = 0,
- final_blow_alliance_id = 0,
- final_blow_ship_name = '',
- final_blow_ship_type_id = 0,
- total_value = 0,
- kill_time = '',
- } = killDetails || {};
-
- const attackerIsNpc = final_blow_char_id === 0;
- const victimAffiliation = victim_alliance_ticker || victim_corp_ticker || null;
- const attackerAffiliation = attackerIsNpc ? '' : final_blow_alliance_ticker || final_blow_corp_ticker || '';
-
- const killValueFormatted = total_value != null && total_value > 0 ? `${formatISK(total_value)} ISK` : null;
- const killTimeAgo = kill_time ? formatTimeMixed(kill_time) : '0h ago';
-
- // Build victim images
- const { victimPortraitUrl, victimCorpLogoUrl, victimAllianceLogoUrl, victimShipUrl } = buildVictimImageUrls({
- victim_char_id,
- victim_ship_type_id,
- victim_corp_id,
- victim_alliance_id,
- });
-
- // Build attacker images
- const { attackerPortraitUrl, attackerCorpLogoUrl, attackerAllianceLogoUrl } = buildAttackerImageUrls({
- final_blow_char_id,
- final_blow_corp_id,
- final_blow_alliance_id,
- });
-
- // Primary image for victim
- const { url: victimPrimaryImageUrl, tooltip: victimPrimaryTooltip } = getPrimaryLogoAndTooltip(
- victimAllianceLogoUrl,
- victimCorpLogoUrl,
- victim_alliance_name,
- victim_corp_name,
- 'Victim',
- );
-
- // Primary image for attacker
- const { url: attackerPrimaryImageUrl, tooltip: attackerPrimaryTooltip } = getAttackerPrimaryImageAndTooltip(
- attackerIsNpc,
- attackerAllianceLogoUrl,
- attackerCorpLogoUrl,
- final_blow_alliance_name,
- final_blow_corp_name,
- final_blow_ship_type_id,
- );
-
- const attackerSubscript = getAttackerSubscript(killDetails);
-
- return (
-
-
- {/* Victim Section */}
-
- {victimShipUrl && (
-
- )}
- {victimPrimaryImageUrl && (
-
-
-
- )}
-
-
-
- {victim_char_name}
- {victimAffiliation && / {victimAffiliation}}
-
-
- {victim_ship_name}
- {killValueFormatted && (
- <>
- /
- {killValueFormatted}
- >
- )}
-
-
{!onlyOneSystem && systemName && {systemName}}
-
-
-
-
- {!attackerIsNpc && (
-
- {final_blow_char_name}
- {attackerAffiliation && / {attackerAffiliation}}
-
- )}
- {!attackerIsNpc && final_blow_ship_name && (
-
{final_blow_ship_name}
- )}
-
{killTimeAgo}
-
- {!attackerIsNpc && attackerPortraitUrl && final_blow_char_id &&final_blow_char_id > 0 && (
-
- )}
- {attackerPrimaryImageUrl && (
-
-
-
- )}
-
-
-
- );
-};
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillItemTemplate.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillItemTemplate.tsx
index e495c066..f8dc7ac9 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillItemTemplate.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillItemTemplate.tsx
@@ -5,7 +5,6 @@ import clsx from 'clsx';
export function KillItemTemplate(
systemNameMap: Record,
- compact: boolean,
onlyOneSystem: boolean,
kill: DetailedKill,
options: VirtualScrollerTemplateOptions,
@@ -15,7 +14,7 @@ export function KillItemTemplate(
return (
-
+
);
}
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillRow.module.scss b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillRowDetail.module.scss
similarity index 100%
rename from assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillRow.module.scss
rename to assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillRowDetail.module.scss
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/CompactKillRow.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillRowDetail.tsx
similarity index 84%
rename from assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/CompactKillRow.tsx
rename to assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillRowDetail.tsx
index 6e94c64c..712080ad 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/CompactKillRow.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/KillRowDetail.tsx
@@ -11,8 +11,8 @@ import {
getPrimaryLogoAndTooltip,
getAttackerPrimaryImageAndTooltip,
} from '../helpers';
-import { WdTooltipWrapper } from '../../../../ui-kit/WdTooltipWrapper';
-import classes from './SystemKillRow.module.scss';
+import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit';
+import classes from './KillRowDetail.module.scss';
import { TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
export interface CompactKillRowProps {
@@ -21,10 +21,10 @@ export interface CompactKillRowProps {
onlyOneSystem: boolean;
}
-export const CompactKillRow: React.FC = ({ killDetails, systemName, onlyOneSystem }) => {
+export const KillRowDetail: React.FC = ({ killDetails, systemName, onlyOneSystem }) => {
const {
killmail_id = 0,
- // Victim
+ // Victim data
victim_char_name = 'Unknown Pilot',
victim_alliance_ticker = '',
victim_corp_ticker = '',
@@ -35,7 +35,7 @@ export const CompactKillRow: React.FC = ({ killDetails, sys
victim_corp_id = 0,
victim_alliance_id = 0,
victim_ship_type_id = 0,
- // Attacker
+ // Attacker data
final_blow_char_id = 0,
final_blow_char_name = '',
final_blow_alliance_ticker = '',
@@ -51,11 +51,12 @@ export const CompactKillRow: React.FC = ({ killDetails, sys
const attackerIsNpc = final_blow_char_id === 0;
+ // Define victim affiliation ticker.
const victimAffiliationTicker = victim_alliance_ticker || victim_corp_ticker || 'No Ticker';
+
const killValueFormatted = total_value != null && total_value > 0 ? `${formatISK(total_value)} ISK` : null;
- const attackerName = attackerIsNpc ? '' : final_blow_char_name;
- const attackerTicker = attackerIsNpc ? '' : final_blow_alliance_ticker || final_blow_corp_ticker || '';
const killTimeAgo = kill_time ? formatTimeMixed(kill_time) : '0h ago';
+
const attackerSubscript = getAttackerSubscript(killDetails);
const { victimCorpLogoUrl, victimAllianceLogoUrl, victimShipUrl } = buildVictimImageUrls({
@@ -88,6 +89,12 @@ export const CompactKillRow: React.FC = ({ killDetails, sys
final_blow_ship_type_id,
);
+ // Define attackerTicker to use the alliance ticker if available, otherwise the corp ticker.
+ const attackerTicker = attackerIsNpc ? '' : final_blow_alliance_ticker || final_blow_corp_ticker || '';
+
+ // For the attacker image link: if the attacker is not an NPC, link to the character page; otherwise, link to the kill page.
+ const attackerLink = attackerIsNpc ? zkillLink('kill', killmail_id) : zkillLink('character', final_blow_char_id);
+
return (
= ({ killDetails, sys
'text-xs whitespace-nowrap overflow-hidden leading-none',
)}
>
+ {/* Victim Section */}
{victimShipUrl && (
@@ -106,7 +114,7 @@ export const CompactKillRow: React.FC
= ({ killDetails, sys
>
@@ -122,7 +130,7 @@ export const CompactKillRow: React.FC = ({ killDetails, sys
>
@@ -146,10 +154,10 @@ export const CompactKillRow: React.FC = ({ killDetails, sys
- {!attackerIsNpc && (attackerName || attackerTicker) && (
+ {!attackerIsNpc && (final_blow_char_name || attackerTicker) && (
- {attackerName}
- {attackerTicker && / {attackerTicker}}
+ {final_blow_char_name}
+ {!attackerIsNpc && attackerTicker && / {attackerTicker}}
)}
@@ -165,14 +173,14 @@ export const CompactKillRow: React.FC
= ({ killDetails, sys
{attackerPrimaryImageUrl && (
{attackerSubscript && (
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsRow.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsRow.tsx
index 704b96ec..e3afa3b2 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsRow.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsRow.tsx
@@ -1,25 +1,15 @@
import React from 'react';
import { DetailedKill } from '@/hooks/Mapper/types/kills';
-import { CompactKillRow } from './CompactKillRow';
-import { FullKillRow } from './FullKillRow';
+import { KillRowDetail } from './KillRowDetail.tsx';
export interface KillRowProps {
killDetails: DetailedKill;
systemName: string;
- isCompact?: boolean;
onlyOneSystem?: boolean;
}
-const KillRowComponent: React.FC = ({
- killDetails,
- systemName,
- isCompact = false,
- onlyOneSystem = false,
-}) => {
- if (isCompact) {
- return ;
- }
- return ;
+const KillRowComponent: React.FC = ({ killDetails, systemName, onlyOneSystem = false }) => {
+ return ;
};
export const KillRow = React.memo(KillRowComponent);
diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsSettingsDialog.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsSettingsDialog.tsx
index 6cee23cb..b55e274e 100644
--- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsSettingsDialog.tsx
+++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemKills/components/SystemKillsSettingsDialog.tsx
@@ -1,14 +1,14 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Dialog } from 'primereact/dialog';
import { Button } from 'primereact/button';
-import { InputSwitch } from 'primereact/inputswitch';
-import { WdImgButton, SystemView, TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
+import { WdImgButton } from '@/hooks/Mapper/components/ui-kit';
import { PrimeIcons } from 'primereact/api';
import { useKillsWidgetSettings } from '../hooks/useKillsWidgetSettings';
import {
AddSystemDialog,
SearchOnSubmitCallback,
} from '@/hooks/Mapper/components/mapInterface/components/AddSystemDialog';
+import { SystemView, TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
interface KillsSettingsDialogProps {
visible: boolean;
@@ -18,7 +18,6 @@ interface KillsSettingsDialogProps {
export const KillsSettingsDialog: React.FC = ({ visible, setVisible }) => {
const [globalSettings, setGlobalSettings] = useKillsWidgetSettings();
const localRef = useRef({
- compact: globalSettings.compact,
showAll: globalSettings.showAll,
whOnly: globalSettings.whOnly,
excludedSystems: globalSettings.excludedSystems || [],
@@ -31,7 +30,6 @@ export const KillsSettingsDialog: React.FC = ({ visibl
useEffect(() => {
if (visible) {
localRef.current = {
- compact: globalSettings.compact,
showAll: globalSettings.showAll,
whOnly: globalSettings.whOnly,
excludedSystems: globalSettings.excludedSystems || [],
@@ -41,14 +39,6 @@ export const KillsSettingsDialog: React.FC = ({ visibl
}
}, [visible, globalSettings]);
- const handleCompactChange = useCallback((checked: boolean) => {
- localRef.current = {
- ...localRef.current,
- compact: checked,
- };
- forceRender(n => n + 1);
- }, []);
-
const handleWHChange = useCallback((checked: boolean) => {
localRef.current = {
...localRef.current,
@@ -57,8 +47,7 @@ export const KillsSettingsDialog: React.FC = ({ visibl
forceRender(n => n + 1);
}, []);
- // Updated handler to set time range as a number: 1 or 24
- const handleTimeRangeChange = useCallback((newTimeRange: 1 | 24) => {
+ const handleTimeRangeChange = useCallback((newTimeRange: number) => {
localRef.current = {
...localRef.current,
timeRange: newTimeRange,
@@ -99,22 +88,11 @@ export const KillsSettingsDialog: React.FC = ({ visibl
const localData = localRef.current;
const excluded = localData.excludedSystems || [];
+ const timeRangeOptions = [4, 12, 24];
return (