Skip to content

feat(home): block native context menu and add right-click on recent projects#39

Merged
srfwb merged 2 commits into
mainfrom
feat/home-context-menu
Apr 25, 2026
Merged

feat(home): block native context menu and add right-click on recent projects#39
srfwb merged 2 commits into
mainfrom
feat/home-context-menu

Conversation

@srfwb
Copy link
Copy Markdown
Owner

@srfwb srfwb commented Apr 25, 2026

Summary

Two changes to the right-click experience.

The Chromium/WebView native context menu (Retour, Actualiser, Inspecter…) was showing on every right-click, breaking the desktop-app feel. A one-line global listener in main.tsx now prevents it app-wide.

Right-clicking the "Projets récents" section area (the grid background, the header, or the empty space around cards) opens a custom context menu with "Nouveau projet" and "Rechercher…". Right-clicking a specific project card still shows the card's own menu (Ouvrir, Ouvrir le dossier, Renommer, Supprimer) — stopPropagation prevents the section menu from also appearing.

What changed

User-facing

  • Right-click anywhere in the app no longer shows the browser's built-in menu.
  • Right-click in the recent projects area (not on a card) offers "Nouveau projet" and "Rechercher…".

Internal

  • src/main.tsx — global contextmenupreventDefault() before bootstrap.
  • src/home/sections/ProjectCard.tsxonContext adds stopPropagation() so the card's menu doesn't bubble to the section handler.
  • src/home/sections/RecentProjectsSection.tsxonContextMenu on <section> opens a ContextMenu with two items. Uses the existing ContextMenu component from src/ide/tree/ContextMenu.tsx.

@srfwb srfwb merged commit a758adc into main Apr 25, 2026
2 checks passed
@srfwb srfwb deleted the feat/home-context-menu branch April 25, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant