

// src/starter.js
import { state } from './state.js';
import { renderApps } from './render.js';
import { loadAppOrder } from './order.js';
import { initZoomHandlers } from './zoom.js';
import { initLongPressHandlers, initGlobalCloseHandlers } from './edit.js';
import { initDragHandlers } from './drag.js';
import { initContextMenuActions } from './contextmenu.js';

export async function startLauncher(Storage) {
  // Carica apps salvate
  const saved = await Storage.loadApps();
  if (saved) state.appsData = saved;

  // Carica ordine
  await loadAppOrder(Storage);

  // Render iniziale
  renderApps();

  // Inizializzazioni
  initZoomHandlers();
  initLongPressHandlers();
  initDragHandlers(Storage);
  initContextMenuActions(Storage);   // <-- IMPORTANTE
  initGlobalCloseHandlers();
}
