Compare commits

...

12 Commits

Author SHA1 Message Date
CI
9abcd4bd0b chore: release version v1.52.8 2025-02-26 08:34:52 +00:00
Dmitry Popov
b052943e34 fix(Map): Added delete systems hotkey 2025-02-26 09:22:57 +01:00
CI
e1e9b4c2e8 chore: release version v1.52.7
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / Manual Approval (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/arm64) (push) Has been cancelled
Build / merge (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2025-02-24 09:14:05 +00:00
guarzo
42c30e0741 fix: update news image link (#204) 2025-02-24 12:38:15 +04:00
Dmitry Popov
3b45e77e65 Merge branch 'main' of github.com:wanderer-industries/wanderer 2025-02-24 09:35:27 +01:00
Dmitry Popov
dcb2b6b912 fix(Map): Block map events for old client versions 2025-02-24 09:35:24 +01:00
CI
638a4e2535 chore: release version v1.52.6
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / Manual Approval (push) Blocked by required conditions
Build / 🛠 Build (1.17, 18.x, 27) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/arm64) (push) Blocked by required conditions
Build / merge (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2025-02-23 09:16:28 +00:00
Dmitry Popov
489fde16d1 Merge branch 'main' of github.com:wanderer-industries/wanderer 2025-02-23 10:04:09 +01:00
Dmitry Popov
35e1c363e5 fix(Map): Fixed delete systems on map changes 2025-02-23 10:04:05 +01:00
CI
6b97d36bf1 chore: release version v1.52.5
Some checks are pending
Build / 🚀 Deploy to test env (fly.io) (push) Waiting to run
Build / Manual Approval (push) Blocked by required conditions
Build / 🛠 Build (1.17, 18.x, 27) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/amd64) (push) Blocked by required conditions
Build / 🛠 Build Docker Images (linux/arm64) (push) Blocked by required conditions
Build / merge (push) Blocked by required conditions
Build / 🏷 Create Release (push) Blocked by required conditions
2025-02-22 08:21:41 +00:00
Dmitry Popov
82f6a7f701 fix(Map): Fixed delete system on signature deletion 2025-02-22 09:10:12 +01:00
Dmitry Popov
2d92dfbafa fix(Map): Fixed delete system on signature deletion 2025-02-22 08:39:50 +01:00
12 changed files with 137 additions and 65 deletions

View File

@@ -2,6 +2,46 @@
<!-- changelog -->
## [v1.52.8](https://github.com/wanderer-industries/wanderer/compare/v1.52.7...v1.52.8) (2025-02-26)
### Bug Fixes:
* Map: Added delete systems hotkey
## [v1.52.7](https://github.com/wanderer-industries/wanderer/compare/v1.52.6...v1.52.7) (2025-02-24)
### Bug Fixes:
* update news image link (#204)
* Map: Block map events for old client versions
## [v1.52.6](https://github.com/wanderer-industries/wanderer/compare/v1.52.5...v1.52.6) (2025-02-23)
### Bug Fixes:
* Map: Fixed delete systems on map changes
## [v1.52.5](https://github.com/wanderer-industries/wanderer/compare/v1.52.4...v1.52.5) (2025-02-22)
### Bug Fixes:
* Map: Fixed delete system on signature deletion
* Map: Fixed delete system on signature deletion
## [v1.52.4](https://github.com/wanderer-industries/wanderer/compare/v1.52.3...v1.52.4) (2025-02-21)

View File

@@ -2,7 +2,6 @@ import { ForwardedRef, forwardRef, MouseEvent, useCallback, useEffect, useMemo }
import ReactFlow, {
Background,
Edge,
EdgeChange,
MiniMap,
Node,
NodeChange,
@@ -79,11 +78,12 @@ const edgeTypes = {
floating: SolarSystemEdge,
};
export const MAP_ROOT_ID = 'MAP_ROOT_ID';
interface MapCompProps {
refn: ForwardedRef<MapHandlers>;
onCommand: OutCommandHandler;
onSelectionChange: OnMapSelectionChange;
onManualDelete(systems: string[]): void;
onConnectionInfoClick?(e: SolarSystemConnection): void;
onAddSystem?: OnMapAddSystemCallback;
onSelectionContextMenu?: NodeSelectionMouseHandler;
@@ -105,7 +105,6 @@ const MapComp = ({
onSystemContextMenu,
onConnectionInfoClick,
onSelectionContextMenu,
onManualDelete,
isShowMinimap,
showKSpaceBG,
isThickConnections,
@@ -114,7 +113,7 @@ const MapComp = ({
theme,
onAddSystem,
}: MapCompProps) => {
const { getNode, getNodes } = useReactFlow();
const { getNodes } = useReactFlow();
const [nodes, , onNodesChange] = useNodesState<Node<SolarSystemRawType>>(initialNodes);
const [edges, , onEdgesChange] = useEdgesState<Edge<SolarSystemConnection>>(initialEdges);
@@ -187,8 +186,6 @@ const MapComp = ({
const handleNodesChange = useCallback(
(changes: NodeChange[]) => {
const systemsIdsToRemove: string[] = [];
// prevents single node deselection on background / same node click
// allows deseletion of all nodes if multiple are currently selected
if (changes.length === 1 && changes[0].type == 'select' && changes[0].selected === false) {
@@ -196,30 +193,12 @@ const MapComp = ({
}
const nextChanges = changes.reduce((acc, change) => {
if (change.type !== 'remove') {
return [...acc, change];
}
const node = getNode(change.id);
if (!node) {
return [...acc, change];
}
if (node.data.locked) {
return acc;
}
systemsIdsToRemove.push(node.data.id);
return [...acc, change];
}, [] as NodeChange[]);
if (systemsIdsToRemove.length > 0) {
onManualDelete(systemsIdsToRemove);
}
onNodesChange(nextChanges);
},
[getNode, getNodes, onManualDelete, onNodesChange],
[getNodes, onNodesChange],
);
useEffect(() => {
@@ -232,7 +211,10 @@ const MapComp = ({
return (
<>
<div className={clsx(classes.MapRoot, { [classes.BackgroundAlternateColor]: isSoftBackground })}>
<div
data-window-id={MAP_ROOT_ID}
className={clsx(classes.MapRoot, { [classes.BackgroundAlternateColor]: isSoftBackground })}
>
<ReactFlow
nodes={nodes}
edges={edges}
@@ -276,7 +258,7 @@ const MapComp = ({
minZoom={0.2}
maxZoom={1.5}
elevateNodesOnSelect
deleteKeyCode={['Delete']}
deleteKeyCode={['']}
{...(isPanAndDrag
? {
selectionOnDrag: true,

View File

@@ -5,12 +5,14 @@ import clsx from 'clsx';
export interface WidgetProps {
label: React.ReactNode | string;
windowId?: string;
children?: React.ReactNode;
}
export const Widget = ({ label, children }: WidgetProps) => {
export const Widget = ({ label, children, windowId }: WidgetProps) => {
return (
<div
data-window-id={windowId}
className={clsx(
classes.root,
'flex flex-col w-full h-full rounded',

View File

@@ -20,6 +20,7 @@ import { COMPACT_MAX_WIDTH } from './constants';
import { renderHeaderLabel } from './renders';
const SIGNATURE_SETTINGS_KEY = 'wanderer_system_signature_settings_v5_5';
export const SIGNATURE_WINDOW_ID = 'system_signatures_window';
export const SHOW_DESCRIPTION_COLUMN_SETTING = 'show_description_column_setting';
export const SHOW_UPDATED_COLUMN_SETTING = 'SHOW_UPDATED_COLUMN_SETTING';
export const SHOW_CHARACTER_COLUMN_SETTING = 'SHOW_CHARACTER_COLUMN_SETTING';
@@ -89,7 +90,7 @@ export const SystemSignatures: React.FC = () => {
const lazyDeleteValue = useMemo(
() => currentSettings.find(setting => setting.key === LAZY_DELETE_SIGNATURES_SETTING)?.value || false,
[currentSettings]
[currentSettings],
);
const handleSettingsChange = useCallback((newSettings: Setting[]) => {
@@ -99,7 +100,7 @@ export const SystemSignatures: React.FC = () => {
const handleLazyDeleteChange = useCallback((value: boolean) => {
setCurrentSettings(prevSettings =>
prevSettings.map(setting => (setting.key === LAZY_DELETE_SIGNATURES_SETTING ? { ...setting, value } : setting))
prevSettings.map(setting => (setting.key === LAZY_DELETE_SIGNATURES_SETTING ? { ...setting, value } : setting)),
);
}, []);
@@ -151,6 +152,7 @@ export const SystemSignatures: React.FC = () => {
})}
</div>
}
windowId={SIGNATURE_WINDOW_ID}
>
{isNotSelectedSystem ? (
<div className="w-full h-full flex justify-center items-center select-none text-center text-stone-400/80 text-sm">

View File

@@ -13,18 +13,15 @@ import {
GROUPS_LIST,
MEDIUM_MAX_WIDTH,
OTHER_COLUMNS_WIDTH,
getGroupIdByRawGroup,
} from '@/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/constants';
import {
SHOW_DESCRIPTION_COLUMN_SETTING,
SHOW_UPDATED_COLUMN_SETTING,
SHOW_CHARACTER_COLUMN_SETTING,
SIGNATURE_WINDOW_ID,
} from '../SystemSignatures';
import {
getGroupIdByRawGroup,
GROUPS_LIST,
} from '@/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/constants.ts';
import { COSMIC_SIGNATURE } from '../SystemSignatureSettingsDialog';
import {
renderAddedTimeLeft,
@@ -104,7 +101,17 @@ export function SystemSignaturesContent({
}, [selectable, clipboardContent]);
useHotkey(true, ['a'], handleSelectAll);
useHotkey(false, ['Backspace', 'Delete'], handleDeleteSelected);
useHotkey(false, ['Backspace', 'Delete'], (event: KeyboardEvent) => {
const targetWindow = (event.target as HTMLHtmlElement)?.closest(`[data-window-id="${SIGNATURE_WINDOW_ID}"]`);
if (!targetWindow) {
return;
}
event.preventDefault();
event.stopPropagation();
handleDeleteSelected();
});
const [nameColumnWidth, setNameColumnWidth] = useState('auto');
const handleResize = useCallback(() => {

View File

@@ -1,4 +1,4 @@
import { Map } from '@/hooks/Mapper/components/map/Map.tsx';
import { Map, MAP_ROOT_ID } from '@/hooks/Mapper/components/map/Map.tsx';
import { useCallback, useRef, useState } from 'react';
import { OutCommand, OutCommandHandler, SolarSystemConnection } from '@/hooks/Mapper/types';
import { MapRootData, useMapRootState } from '@/hooks/Mapper/mapRootProvider';
@@ -15,7 +15,7 @@ import { Connections } from '@/hooks/Mapper/components/mapRootContent/components
import { ContextMenuSystemMultiple, useContextMenuSystemMultipleHandlers } from '../contexts/ContextMenuSystemMultiple';
import { getSystemById } from '@/hooks/Mapper/helpers';
import { Commands } from '@/hooks/Mapper/types/mapHandlers.ts';
import { Node, XYPosition } from 'reactflow';
import { Node, useReactFlow, XYPosition } from 'reactflow';
import { useCommandsSystems } from '@/hooks/Mapper/mapRootProvider/hooks/api';
import { emitMapEvent, useMapEventListener } from '@/hooks/Mapper/events';
@@ -27,6 +27,7 @@ import {
AddSystemDialog,
SearchOnSubmitCallback,
} from '@/hooks/Mapper/components/mapInterface/components/AddSystemDialog';
import { useHotkey } from '../../hooks/useHotkey';
// TODO: INFO - this component needs for abstract work with Map instance
export const MapWrapper = () => {
@@ -46,6 +47,7 @@ export const MapWrapper = () => {
} = useMapRootState();
const { deleteSystems } = useDeleteSystems();
const { mapRef, runCommand } = useCommonMapEventProcessor();
const { getNodes } = useReactFlow();
const { updateLinkSignatureToSystem } = useCommandsSystems();
const { open, ...systemContextProps } = useContextMenuSystemHandlers({ systems, hubs, outCommand });
@@ -114,12 +116,14 @@ export const MapWrapper = () => {
const handleConnectionDbClick = useCallback((e: SolarSystemConnection) => setSelectedConnection(e), []);
const handleManualDelete = useCallback((toDelete: string[]) => {
const restDel = toDelete.filter(x => ref.current.systems.some(y => y.id === x));
const handleDeleteSelected = useCallback(() => {
const restDel = getNodes()
.filter(x => x.selected && !x.data.locked)
.map(x => x.data.id);
if (restDel.length > 0) {
ref.current.deleteSystems(restDel);
}
}, []);
}, [getNodes]);
const onAddSystem: OnMapAddSystemCallback = useCallback(({ coordinates }) => {
setOpenAddSystem(coordinates);
@@ -143,6 +147,18 @@ export const MapWrapper = () => {
[openAddSystem, outCommand],
);
useHotkey(false, ['Delete'], (event: KeyboardEvent) => {
const targetWindow = (event.target as HTMLHtmlElement)?.closest(`[data-window-id="${MAP_ROOT_ID}"]`);
if (!targetWindow) {
return;
}
event.preventDefault();
event.stopPropagation();
handleDeleteSelected();
});
return (
<>
<Map
@@ -155,7 +171,6 @@ export const MapWrapper = () => {
minimapClasses={!isShowMenu ? classes.MiniMap : undefined}
isShowMinimap={isShowMinimap}
showKSpaceBG={isShowKSpace}
onManualDelete={handleManualDelete}
isThickConnections={isThickConnections}
isShowBackgroundPattern={isShowBackgroundPattern}
isSoftBackground={isSoftBackground}

View File

@@ -1,6 +1,9 @@
import { createRoot } from 'react-dom/client';
import Mapper from './MapRoot';
const LAST_VERSION_KEY = 'wandererLastVersion';
const UI_LOADED_EVENT = 'ui_loaded';
export default {
_rootEl: null,
_errorCount: 0,
@@ -8,7 +11,7 @@ export default {
mounted() {
// create react root element
const rootEl = document.getElementById(this.el.id);
this._version = this.el.dataset.version;
const activeVersion = localStorage.getItem(LAST_VERSION_KEY);
this._rootEl = createRoot(rootEl!);
const handleError = (error: Error, componentStack: string) => {
@@ -22,7 +25,7 @@ export default {
onError: handleError,
});
this.pushEvent('ui_loaded');
this.pushEvent(UI_LOADED_EVENT, { version: activeVersion });
},
handleEventWrapper(event: string, handler: (payload: any) => void) {
@@ -32,7 +35,8 @@ export default {
},
reconnected() {
this.pushEvent('ui_loaded');
const activeVersion = localStorage.getItem(LAST_VERSION_KEY);
this.pushEvent(UI_LOADED_EVENT, { version: activeVersion });
},
async pushEventAsync(event: string, payload: any) {

View File

@@ -128,18 +128,26 @@ defmodule WandererAppWeb.MapCoreEventHandler do
socket
end
def handle_ui_event("ui_loaded", _body, %{assigns: %{map_slug: map_slug} = assigns} = socket) do
assigns
|> Map.get(:map_id)
|> case do
map_id when not is_nil(map_id) ->
maybe_start_map(map_id)
def handle_ui_event(
"ui_loaded",
%{"version" => version},
%{assigns: %{map_slug: map_slug, app_version: app_version} = assigns} = socket
) do
is_version_valid? = to_string(version) == to_string(app_version)
_ ->
WandererApp.Cache.insert("map_#{map_slug}:ui_loaded", true)
if is_version_valid? do
assigns
|> Map.get(:map_id)
|> case do
map_id when not is_nil(map_id) ->
maybe_start_map(map_id)
_ ->
WandererApp.Cache.insert("map_#{map_slug}:ui_loaded", true)
end
end
{:noreply, socket}
{:noreply, socket |> assign(:is_version_valid?, is_version_valid?)}
end
def handle_ui_event(

View File

@@ -257,13 +257,23 @@ defmodule WandererAppWeb.MapEventHandler do
end
end
def push_map_event(socket, type, body),
do:
socket
|> Phoenix.LiveView.Utils.push_event("map_event", %{
type: type,
body: body
})
def push_map_event(
%{
assigns: %{
is_version_valid?: true
}
} = socket,
type,
body
),
do:
socket
|> Phoenix.LiveView.Utils.push_event("map_event", %{
type: type,
body: body
})
def push_map_event(socket, _type, _body), do: socket
def map_ui_character_stat(character),
do:

View File

@@ -28,7 +28,8 @@ defmodule WandererAppWeb.MapsLive do
map_subscriptions_enabled?: WandererApp.Env.map_subscriptions_enabled?(),
restrict_maps_creation?: WandererApp.Env.restrict_maps_creation?(),
acls: [],
location: nil
location: nil,
is_version_valid?: false
)
|> assign_async(:maps, fn ->
_load_maps(current_user)
@@ -43,7 +44,8 @@ defmodule WandererAppWeb.MapsLive do
maps: [],
characters: [],
location: nil,
map_subscriptions: []
map_subscriptions: [],
is_version_valid?: false
)}
end

View File

@@ -3,7 +3,7 @@ defmodule WandererApp.MixProject do
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.52.4"
@version "1.52.8"
def project do
[

View File

@@ -1,7 +1,7 @@
%{
title: "User Guide: Characters & ACL API Endpoints",
author: "Wanderer Team",
cover_image_uri: "/images/news/02-20-acl-api/generate-key.png",
cover_image_uri: "/images/news/02-20-acl-api/generate-acl-key.png",
tags: ~w(acl characters guide interface),
description: "Learn how to retrieve and manage Access Lists and Characters through the Wanderer public APIs. This guide covers available endpoints, request examples, and sample responses."
}