feat(p8): vue IDE /workspace (arbre + Monaco + diff + terminal)
- backend: garde-fou conflit d'édition par mtime (GET renvoie mtime, PUT refuse en 409 STALE_FILE si baseMtime périmé) - lib: wt-key (base64url du chemin worktree), diff-parse (parseur pur du diff unifié → hunks) - composables: useMonaco (import dynamique → chunk isolé), useWorkspaceLayout (largeurs/panneau persistés) - components/workspace: GitStatusBadge, FileTree+FileTreeNode (lazy fs/list includeFiles), ChangedFilesPanel, DiffViewer (coloration +/-), MonacoEditor (Ctrl+S + bannière conflit reload/overwrite) - views/WorkspaceView: 3 colonnes desktop redimensionnables + SegmentedControl mobile, header live (GitStatusBadge), watchWorktree → refresh diff/changements, terminal de la session corrélée - router meta 'ide' + route /workspace/:repoId/:wt ; App.vue plein écran sans AppShell ; WorktreeCard bouton « Ouvrir l'IDE » - deps: monaco-editor (lazy, vendor-monaco isolé, 0 impact bundle initial) ; vite manualChunks - i18n EN+FR (workspace/editor/diff/git) ; tests diff-parse + wt-key ; acceptance-p8.mjs (mtime/409 + diff)
This commit is contained in:
24
packages/web/test/wt-key.test.ts
Normal file
24
packages/web/test/wt-key.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { encodeWtKey, decodeWtKey } from '../src/lib/wt-key';
|
||||
|
||||
describe('wt-key (base64url)', () => {
|
||||
const paths = [
|
||||
'/home/johan/WebstormProjects/arboretum',
|
||||
'/srv/code/feature-branch',
|
||||
'/tmp/with space/and-dash',
|
||||
'/projets/accentué/café/é',
|
||||
'/a/b/c/d/e/f/g',
|
||||
];
|
||||
|
||||
it('round-trip encode → decode pour divers chemins', () => {
|
||||
for (const p of paths) expect(decodeWtKey(encodeWtKey(p))).toBe(p);
|
||||
});
|
||||
|
||||
it('produit un segment d’URL sûr (pas de + / =)', () => {
|
||||
for (const p of paths) {
|
||||
const key = encodeWtKey(p);
|
||||
expect(key).not.toMatch(/[+/=]/);
|
||||
expect(encodeURIComponent(key)).toBe(key); // déjà URL-safe
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user