modification des menus contextuels

This commit is contained in:
2025-07-19 11:15:10 +02:00
parent e4ed326485
commit 695054b2bb
2 changed files with 26 additions and 18 deletions

View File

@ -51,24 +51,32 @@ export function WelcomeModal({ isOpen, onClose }: WelcomeModalProps) {
> >
<div style={{ padding: '24px' }}> <div style={{ padding: '24px' }}>
<h2 style={{ margin: '0 0 20px 0', fontSize: '18px', color: '#fff' }}> <h2 style={{ margin: '0 0 20px 0', fontSize: '18px', color: '#fff' }}>
Bienvenue dans Palace Welcome to Bubo's Memory Palace
</h2> </h2>
<div style={{ marginBottom: '20px', lineHeight: '1.5', color: '#ccc' }}> <div style={{ marginBottom: '20px', lineHeight: '1.5', color: '#ccc' }}>
<p style={{ margin: '0 0 12px 0' }}> <p style={{ margin: '0 0 12px 0' }}>
<strong>Navigation :</strong> Tapez <code style={{ background: '#333', padding: '2px 4px', borderRadius: '2px' }}>:</code> pour ouvrir la console de navigation This is Bubo's Memory Palace. You can write words and sentences in space.
Double click a word to navigate to the corresponding space. Empty spaces
are deleted. Spaces with no words linking to them are kept, only forgotten.
</p>
<p style={{ margin: '0 0 12px 0' }}>
<strong>Navigation :</strong> Hit <code style={{ background: '#333', padding: '2px 4px', borderRadius: '2px' }}>:</code> to open a navigation console.
</p>
<p style={{ margin: '0 0 12px 0' }}>
<strong>Writing:</strong> Double click in the void to write anything.
</p> </p>
<p style={{ margin: '0 0 12px 0' }}> <p style={{ margin: '0 0 12px 0' }}>
<strong>Création de notes :</strong> Double-cliquez sur l'espace vide pour créer une note <strong>Selection:</strong> Shift+click or click and drag to select.
</p> </p>
<p style={{ margin: '0 0 12px 0' }}> <p style={{ margin: '0 0 12px 0' }}>
<strong>Sélection multiple :</strong> Shift+clic ou glisser pour sélectionner plusieurs notes <strong>Warping:</strong> Double click on a note to warp between spaces.
</p>
<p style={{ margin: '0 0 12px 0' }}>
<strong>Navigation entre espaces :</strong> Double-cliquez sur une note pour naviguer vers l'espace correspondant
</p> </p>
<p style={{ margin: '0' }}> <p style={{ margin: '0' }}>
<strong>Raccourcis :</strong> Suppr/Backspace pour effacer, Échap pour désélectionner <strong>Delete :</strong> Backspace/Del to delete a note.
</p> </p>
</div> </div>
@ -80,7 +88,7 @@ export function WelcomeModal({ isOpen, onClose }: WelcomeModalProps) {
onChange={(e) => setNeverShowAgain(e.target.checked)} onChange={(e) => setNeverShowAgain(e.target.checked)}
style={{ marginRight: '8px' }} style={{ marginRight: '8px' }}
/> />
Ne plus afficher ce message Don't show this again (<code style={{ background: '#333', padding: '2px 4px', borderRadius: '2px' }}>? </code> to open this modal again)
</label> </label>
</div> </div>
@ -103,7 +111,7 @@ export function WelcomeModal({ isOpen, onClose }: WelcomeModalProps) {
e.currentTarget.style.background = '#333' e.currentTarget.style.background = '#333'
}} }}
> >
Compris ! OK !
</button> </button>
</div> </div>
</div> </div>

View File

@ -13,9 +13,9 @@ type Space = {
notes: Note[] notes: Note[]
} }
export const currentSpaceId = atom<string>('home') export const currentSpaceId = atom<string>('crossroad')
export const currentSpace = atom<Space | null>(null) export const currentSpace = atom<Space | null>(null)
export const navigationHistory = atom<string[]>(['home']) export const navigationHistory = atom<string[]>(['crossroad'])
export const editingNoteId = atom<string | null>(null) export const editingNoteId = atom<string | null>(null)
export const selectedNoteIds = atom<string[]>([]) export const selectedNoteIds = atom<string[]>([])
export const existingSpaceIds = atom<string[]>([]) export const existingSpaceIds = atom<string[]>([])
@ -26,10 +26,10 @@ export const refreshExistingSpaces = async () => {
} }
export const loadSpace = async (spaceId: string) => { export const loadSpace = async (spaceId: string) => {
// Check if current space is empty and delete it (except 'home') // Check if current space is empty and delete it (except 'crossroad')
const currentSpace_value = currentSpace.get() const currentSpace_value = currentSpace.get()
const currentSpaceId_value = currentSpaceId.get() const currentSpaceId_value = currentSpaceId.get()
if (currentSpace_value && currentSpaceId_value !== 'home' && currentSpace_value.notes.length === 0) { if (currentSpace_value && currentSpaceId_value !== 'crossroad' && currentSpace_value.notes.length === 0) {
await db.deleteSpace(currentSpaceId_value) await db.deleteSpace(currentSpaceId_value)
} }
@ -104,7 +104,7 @@ export const deleteNote = async (noteId: string) => {
export const getSpaceFromUrl = () => { export const getSpaceFromUrl = () => {
const hash = window.location.hash.slice(1) const hash = window.location.hash.slice(1)
return hash || 'home' return hash || 'crossroad'
} }
// Selection management // Selection management