refactor: small ux improvements

- rename dissolve > ungroup
- prevent ondrag when clicking
- add untitled as block title fallback
- move block action to context menu
This commit is contained in:
Carlos Valente
2025-05-23 13:06:48 +02:00
committed by arc-alex
parent 2546159a94
commit 17deeddb87
9 changed files with 47 additions and 53 deletions
+2 -2
View File
@@ -97,8 +97,8 @@ export async function postCloneEntry(entryId: EntryId): Promise<AxiosResponse<Ru
/**
* HTTP request for dissolving of a block
*/
export async function requestDissolveBlock(blockId: EntryId): Promise<AxiosResponse<Rundown>> {
return axios.post(`${rundownPath}/dissolve/${blockId}`);
export async function requestUngroup(blockId: EntryId): Promise<AxiosResponse<Rundown>> {
return axios.post(`${rundownPath}/ungroup/${blockId}`);
}
/**
@@ -26,9 +26,9 @@ import {
ReorderEntry,
requestApplyDelay,
requestDeleteAll,
requestDissolveBlock,
requestEventSwap,
requestGroupEntries,
requestUngroup,
SwapEntry,
} from '../api/rundown';
import { logAxiosError } from '../api/utils';
@@ -544,8 +544,8 @@ export const useEntryActions = () => {
* Calls mutation to dissolve a block
* @private
*/
const _dissolveBlockMutation = useMutation({
mutationFn: requestDissolveBlock,
const _ungroupMutation = useMutation({
mutationFn: requestUngroup,
onSuccess: (response) => {
if (!response.data) return;
@@ -565,15 +565,15 @@ export const useEntryActions = () => {
/**
* Deletes a block and moves its events to the top level
*/
const dissolveBlock = useCallback(
const ungroup = useCallback(
async (blockId: EntryId) => {
try {
await _dissolveBlockMutation.mutateAsync(blockId);
await _ungroupMutation.mutateAsync(blockId);
} catch (error) {
logAxiosError('Error dissolving block', error);
}
},
[_dissolveBlockMutation],
[_ungroupMutation],
);
/**
@@ -762,7 +762,7 @@ export const useEntryActions = () => {
clone,
deleteEntry,
deleteAllEntries,
dissolveBlock,
ungroup,
getEntryById,
groupEntries,
reorderEntry,