Skip to content

Trash

macOS-style trash system with drag-and-drop and restore capability.

Features

  • Dock trash icon — Visual trash can in the dock
  • Drag and drop — Drag apps from the dock to trash them
  • Soft delete — Files and apps are recoverable
  • Restore — Restore trashed items to their original location
  • Permanent delete — Delete individual items or empty entire trash
  • Badge — Shows count of trashed items
  • Custom dialog — Eigener Bestaetigungs-Dialog statt Browser-confirm() v3.12

What Can Be Trashed

Files

  • Any file can be moved to trash
  • Files are physically moved to userdata/user_X/.trash/{id}_{name}
  • Original path is preserved in the database for restoration

Apps

  • Custom apps and some system apps can be trashed
  • Trashing an app sets is_active=false in the database
  • App metadata (slug, icon, path) is stored for restoration

Protected Apps

These apps cannot be trashed: notes, files, settings, terminal, finanzen, dokumente, app-builder, team-chat

Trash Viewer

Click the trash dock icon to open the Trash viewer app:

  • See all trashed items with name, type, and deletion date
  • Restore — Returns item to its original location
  • Delete — Permanently removes the item
  • Empty Trash — Permanently removes all items

v3.12 Updates v3.12

Custom Bestaetigungs-Dialog

Der Papierkorb verwendet jetzt einen eigenen Bestaetigungs-Dialog anstelle des nativen Browser-confirm():

  • Gestylter Dialog — Passt zum Niuton Dark/Light Theme
  • Deutliche Warnung — Klare Beschreibung der Aktion
  • Tastatur-Support — Enter zum Bestaetigen, Escape zum Abbrechen

Database

sql
niuton_trash (
    id SERIAL PRIMARY KEY,
    user_id INTEGER NOT NULL,
    item_type VARCHAR(20),  -- 'file' or 'app'
    item_name VARCHAR(255),
    original_path TEXT,
    app_id INTEGER,
    metadata JSONB,
    trashed_at TIMESTAMP DEFAULT NOW()
);

Desktop Integration

  • desktop.js handles dock drag-drop and trash icon rendering
  • The trash app communicates with the desktop via postMessage('niuton-trash-changed')
  • Dock automatically updates when items are trashed or restored

AI-Powered Cloud Desktop OS