#117 Code coloré dans le panneau d'un fichier lié
Le panneau qui s'ouvre au clic sur un lien vers un fichier de code montre le code coloré comme dans l'onglet Fichiers (CodeMirror en lecture seule, langage d'après le nom ou l'extension). #118 : l'historique ↑ sera par channel. #117 fermé (testé sur le Mac). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8c3138a parent: 713ea6e modified
.memory/history.md +2 -0 | @@ -374,3 +374,5 @@ | ||
| 374 | 374 | - **2026-11-15 — #111 composer height** (branch feature/111-composer-height): fit() in a $effect on text + window resize (was only in onInput); composerHeight() in composer.ts with a test; Xvfb: send / ↑ / ↓ resize correctly. Release notes v1.7.0. Not committed; #111 open for the owner's test. |
| 375 | 375 | - **2026-11-15 — tickets #117** (code of a linked source file not coloured: LinkedFilePanel shows <pre>) **and #118** (↑ recall works with mini-me kept sessions, not other agents; composer history is in-memory per Composer — to reproduce). Owner restated #111 (reset after send) — already what the branch does; likely an old build on the Mac. |
| 376 | 376 | - **2026-11-15 — #111 closed** (owner); feature/111-composer-height merged into main with tickets #117, #118 (not pushed). |
| 377 | +- **2026-11-15 — #117** (branch feature/117-linked-code-colours): LinkedFilePanel shows source code in a read-only FileEditor (codeLanguage() in files.ts); Xvfb light/dark/read-only. #118: owner wants the ↑ history per channel (comment + acceptance criterion added). Not committed. | |
| 378 | +- **2026-11-15 — #117 closed** (owner); feature/117-linked-code-colours merged into main with the #118 per-channel note (not pushed). | |
| @@ -374,3 +374,5 @@ | |||
| 374 | - **2026-11-15 — #111 composer height** (branch feature/111-composer-height): fit() in a $effect on text + window resize (was only in onInput); composerHeight() in composer.ts with a test; Xvfb: send / ↑ / ↓ resize correctly. Release notes v1.7.0. Not committed; #111 open for the owner's test. | 374 | - **2026-11-15 — #111 composer height** (branch feature/111-composer-height): fit() in a $effect on text + window resize (was only in onInput); composerHeight() in composer.ts with a test; Xvfb: send / ↑ / ↓ resize correctly. Release notes v1.7.0. Not committed; #111 open for the owner's test. |
| 375 | - **2026-11-15 — tickets #117** (code of a linked source file not coloured: LinkedFilePanel shows <pre>) **and #118** (↑ recall works with mini-me kept sessions, not other agents; composer history is in-memory per Composer — to reproduce). Owner restated #111 (reset after send) — already what the branch does; likely an old build on the Mac. | 375 | - **2026-11-15 — tickets #117** (code of a linked source file not coloured: LinkedFilePanel shows <pre>) **and #118** (↑ recall works with mini-me kept sessions, not other agents; composer history is in-memory per Composer — to reproduce). Owner restated #111 (reset after send) — already what the branch does; likely an old build on the Mac. |
| 376 | - **2026-11-15 — #111 closed** (owner); feature/111-composer-height merged into main with tickets #117, #118 (not pushed). | 376 | - **2026-11-15 — #111 closed** (owner); feature/111-composer-height merged into main with tickets #117, #118 (not pushed). |
| 377 | +- **2026-11-15 — #117** (branch feature/117-linked-code-colours): LinkedFilePanel shows source code in a read-only FileEditor (codeLanguage() in files.ts); Xvfb light/dark/read-only. #118: owner wants the ↑ history per channel (comment + acceptance criterion added). Not committed. | ||
| 378 | +- **2026-11-15 — #117 closed** (owner); feature/117-linked-code-colours merged into main with the #118 per-channel note (not pushed). | ||
modified
.tickets/issues/0117-panneau-d-un-fichier-lie-colorer-le-code-source.yaml +31 -6 | @@ -1,12 +1,12 @@ | ||
| 1 | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | 2 | id: 117 |
| 3 | 3 | title: "Panneau d'un fichier lié : colorer le code source" |
| 4 | -state: open | |
| 4 | +state: closed | |
| 5 | 5 | author: |
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-15T18:23:34.000Z |
| 9 | -updatedAt: 2026-11-15T18:23:34.000Z | |
| 9 | +updatedAt: 2026-11-15T18:38:25.000Z | |
| 10 | 10 | labels: |
| 11 | 11 | - kind::feature |
| 12 | 12 | - area::ui |
| @@ -42,26 +42,51 @@ body: | | ||
| 42 | 42 | tasks: |
| 43 | 43 | - id: 1 |
| 44 | 44 | title: "Choisir la coloration (Shiki ou CodeMirror en lecture seule) et le langage d'après l'extension" |
| 45 | - state: open | |
| 45 | + state: closed | |
| 46 | 46 | priority: high |
| 47 | 47 | author: |
| 48 | 48 | name: k33g |
| 49 | 49 | email: ph.charriere@gmail.com |
| 50 | 50 | createdAt: 2026-11-15T18:23:34.000Z |
| 51 | + updatedAt: 2026-11-15T18:34:01.000Z | |
| 52 | + closedAt: 2026-11-15T18:34:01.000Z | |
| 51 | 53 | - id: 2 |
| 52 | 54 | title: "Colorer le code dans LinkedFilePanel (thème clair/sombre, gros fichiers)" |
| 53 | - state: open | |
| 55 | + state: closed | |
| 54 | 56 | priority: high |
| 55 | 57 | author: |
| 56 | 58 | name: k33g |
| 57 | 59 | email: ph.charriere@gmail.com |
| 58 | 60 | createdAt: 2026-11-15T18:23:34.000Z |
| 61 | + updatedAt: 2026-11-15T18:34:01.000Z | |
| 62 | + closedAt: 2026-11-15T18:34:01.000Z | |
| 59 | 63 | - id: 3 |
| 60 | 64 | title: "Tests vitest, doc EN + FR, notes de release v1.7.0" |
| 61 | - state: open | |
| 65 | + state: closed | |
| 62 | 66 | priority: medium |
| 63 | 67 | author: |
| 64 | 68 | name: k33g |
| 65 | 69 | email: ph.charriere@gmail.com |
| 66 | 70 | createdAt: 2026-11-15T18:23:34.000Z |
| 67 | -comments: [] | |
| 71 | + updatedAt: 2026-11-15T18:34:01.000Z | |
| 72 | + closedAt: 2026-11-15T18:34:01.000Z | |
| 73 | +comments: | |
| 74 | + - id: 1 | |
| 75 | + author: | |
| 76 | + name: k33g | |
| 77 | + email: ph.charriere@gmail.com | |
| 78 | + createdAt: 2026-11-15T18:34:01.000Z | |
| 79 | + body: | | |
| 80 | + Fait sur `feature/117-linked-code-colours`, selon la recommandation : **CodeMirror en lecture seule** (le | |
| 81 | + `FileEditor` de l'onglet Fichiers avec `readOnly`), langage d'après le nom ou l'extension (`codeLanguage` = | |
| 82 | + `languageFor` sauf `text`, ~30 langages) ; mêmes couleurs, numéros de ligne, thème sombre One Dark ; un gros | |
| 83 | + fichier reste sans couleurs (`maxHighlightedSize`), un langage inconnu en texte brut. Vérifié sous Xvfb avec un | |
| 84 | + faux agent qui répond par un lien vers `main.go` : couleurs en clair et en sombre, frappe sans effet. Doc EN + FR, | |
| 85 | + notes v1.7.0. Reste : le test de l'owner. | |
| 86 | + - id: 2 | |
| 87 | + author: | |
| 88 | + name: k33g | |
| 89 | + email: ph.charriere@gmail.com | |
| 90 | + createdAt: 2026-11-15T18:38:25.000Z | |
| 91 | + body: | | |
| 92 | + Testé sur le Mac par l'owner : ça fonctionne. Mergé dans main. Ticket fermé. | |
| @@ -1,12 +1,12 @@ | |||
| 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | id: 117 | 2 | id: 117 |
| 3 | title: "Panneau d'un fichier lié : colorer le code source" | 3 | title: "Panneau d'un fichier lié : colorer le code source" |
| 4 | -state: open | 4 | +state: closed |
| 5 | author: | 5 | author: |
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-15T18:23:34.000Z | 8 | createdAt: 2026-11-15T18:23:34.000Z |
| 9 | -updatedAt: 2026-11-15T18:23:34.000Z | 9 | +updatedAt: 2026-11-15T18:38:25.000Z |
| 10 | labels: | 10 | labels: |
| 11 | - kind::feature | 11 | - kind::feature |
| 12 | - area::ui | 12 | - area::ui |
| @@ -42,26 +42,51 @@ body: | | |||
| 42 | tasks: | 42 | tasks: |
| 43 | - id: 1 | 43 | - id: 1 |
| 44 | title: "Choisir la coloration (Shiki ou CodeMirror en lecture seule) et le langage d'après l'extension" | 44 | title: "Choisir la coloration (Shiki ou CodeMirror en lecture seule) et le langage d'après l'extension" |
| 45 | - state: open | 45 | + state: closed |
| 46 | priority: high | 46 | priority: high |
| 47 | author: | 47 | author: |
| 48 | name: k33g | 48 | name: k33g |
| 49 | email: ph.charriere@gmail.com | 49 | email: ph.charriere@gmail.com |
| 50 | createdAt: 2026-11-15T18:23:34.000Z | 50 | createdAt: 2026-11-15T18:23:34.000Z |
| 51 | + updatedAt: 2026-11-15T18:34:01.000Z | ||
| 52 | + closedAt: 2026-11-15T18:34:01.000Z | ||
| 51 | - id: 2 | 53 | - id: 2 |
| 52 | title: "Colorer le code dans LinkedFilePanel (thème clair/sombre, gros fichiers)" | 54 | title: "Colorer le code dans LinkedFilePanel (thème clair/sombre, gros fichiers)" |
| 53 | - state: open | 55 | + state: closed |
| 54 | priority: high | 56 | priority: high |
| 55 | author: | 57 | author: |
| 56 | name: k33g | 58 | name: k33g |
| 57 | email: ph.charriere@gmail.com | 59 | email: ph.charriere@gmail.com |
| 58 | createdAt: 2026-11-15T18:23:34.000Z | 60 | createdAt: 2026-11-15T18:23:34.000Z |
| 61 | + updatedAt: 2026-11-15T18:34:01.000Z | ||
| 62 | + closedAt: 2026-11-15T18:34:01.000Z | ||
| 59 | - id: 3 | 63 | - id: 3 |
| 60 | title: "Tests vitest, doc EN + FR, notes de release v1.7.0" | 64 | title: "Tests vitest, doc EN + FR, notes de release v1.7.0" |
| 61 | - state: open | 65 | + state: closed |
| 62 | priority: medium | 66 | priority: medium |
| 63 | author: | 67 | author: |
| 64 | name: k33g | 68 | name: k33g |
| 65 | email: ph.charriere@gmail.com | 69 | email: ph.charriere@gmail.com |
| 66 | createdAt: 2026-11-15T18:23:34.000Z | 70 | createdAt: 2026-11-15T18:23:34.000Z |
| 67 | -comments: [] | 71 | + updatedAt: 2026-11-15T18:34:01.000Z |
| 72 | + closedAt: 2026-11-15T18:34:01.000Z | ||
| 73 | +comments: | ||
| 74 | + - id: 1 | ||
| 75 | + author: | ||
| 76 | + name: k33g | ||
| 77 | + email: ph.charriere@gmail.com | ||
| 78 | + createdAt: 2026-11-15T18:34:01.000Z | ||
| 79 | + body: | | ||
| 80 | + Fait sur `feature/117-linked-code-colours`, selon la recommandation : **CodeMirror en lecture seule** (le | ||
| 81 | + `FileEditor` de l'onglet Fichiers avec `readOnly`), langage d'après le nom ou l'extension (`codeLanguage` = | ||
| 82 | + `languageFor` sauf `text`, ~30 langages) ; mêmes couleurs, numéros de ligne, thème sombre One Dark ; un gros | ||
| 83 | + fichier reste sans couleurs (`maxHighlightedSize`), un langage inconnu en texte brut. Vérifié sous Xvfb avec un | ||
| 84 | + faux agent qui répond par un lien vers `main.go` : couleurs en clair et en sombre, frappe sans effet. Doc EN + FR, | ||
| 85 | + notes v1.7.0. Reste : le test de l'owner. | ||
| 86 | + - id: 2 | ||
| 87 | + author: | ||
| 88 | + name: k33g | ||
| 89 | + email: ph.charriere@gmail.com | ||
| 90 | + createdAt: 2026-11-15T18:38:25.000Z | ||
| 91 | + body: | | ||
| 92 | + Testé sur le Mac par l'owner : ça fonctionne. Mergé dans main. Ticket fermé. | ||
modified
.tickets/issues/0118-rappeler-les-derniers-messages-avec-pour-tous-le.yaml +11 -2 | @@ -6,7 +6,7 @@ author: | ||
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-15T18:23:34.000Z |
| 9 | -updatedAt: 2026-11-15T18:23:34.000Z | |
| 9 | +updatedAt: 2026-11-15T18:34:01.000Z | |
| 10 | 10 | labels: |
| 11 | 11 | - kind::bug |
| 12 | 12 | - area::ui |
| @@ -34,6 +34,7 @@ body: | | ||
| 34 | 34 | conversation, même après un changement de channel ou un redémarrage. |
| 35 | 35 | |
| 36 | 36 | ## Critères d'acceptation |
| 37 | + - L'historique est **par channel** (et par conversation directe) : ↑ ne rappelle jamais un message d'un autre channel. | |
| 37 | 38 | - Dans une conversation ou un channel, ↑ rappelle les derniers messages envoyés, quel que soit le type d'agent, |
| 38 | 39 | y compris après être revenu sur le channel ou avoir relancé Sidekicks. |
| 39 | 40 | - ↓ revient au brouillon en cours ; pas de doublons consécutifs ; tests vitest ; notes de release v1.7.0. |
| @@ -62,4 +63,12 @@ tasks: | ||
| 62 | 63 | name: k33g |
| 63 | 64 | email: ph.charriere@gmail.com |
| 64 | 65 | createdAt: 2026-11-15T18:23:34.000Z |
| 65 | -comments: [] | |
| 66 | +comments: | |
| 67 | + - id: 1 | |
| 68 | + author: | |
| 69 | + name: k33g | |
| 70 | + email: ph.charriere@gmail.com | |
| 71 | + createdAt: 2026-11-15T18:34:01.000Z | |
| 72 | + body: | | |
| 73 | + Précision de l'owner : **l'historique est par channel** — dans un channel, ↑ ne rappelle que les messages envoyés | |
| 74 | + dans ce channel (ou cette conversation directe), jamais ceux d'un autre channel. | |
| @@ -6,7 +6,7 @@ author: | |||
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-15T18:23:34.000Z | 8 | createdAt: 2026-11-15T18:23:34.000Z |
| 9 | -updatedAt: 2026-11-15T18:23:34.000Z | 9 | +updatedAt: 2026-11-15T18:34:01.000Z |
| 10 | labels: | 10 | labels: |
| 11 | - kind::bug | 11 | - kind::bug |
| 12 | - area::ui | 12 | - area::ui |
| @@ -34,6 +34,7 @@ body: | | |||
| 34 | conversation, même après un changement de channel ou un redémarrage. | 34 | conversation, même après un changement de channel ou un redémarrage. |
| 35 | 35 | ||
| 36 | ## Critères d'acceptation | 36 | ## Critères d'acceptation |
| 37 | + - L'historique est **par channel** (et par conversation directe) : ↑ ne rappelle jamais un message d'un autre channel. | ||
| 37 | - Dans une conversation ou un channel, ↑ rappelle les derniers messages envoyés, quel que soit le type d'agent, | 38 | - Dans une conversation ou un channel, ↑ rappelle les derniers messages envoyés, quel que soit le type d'agent, |
| 38 | y compris après être revenu sur le channel ou avoir relancé Sidekicks. | 39 | y compris après être revenu sur le channel ou avoir relancé Sidekicks. |
| 39 | - ↓ revient au brouillon en cours ; pas de doublons consécutifs ; tests vitest ; notes de release v1.7.0. | 40 | - ↓ revient au brouillon en cours ; pas de doublons consécutifs ; tests vitest ; notes de release v1.7.0. |
| @@ -62,4 +63,12 @@ tasks: | |||
| 62 | name: k33g | 63 | name: k33g |
| 63 | email: ph.charriere@gmail.com | 64 | email: ph.charriere@gmail.com |
| 64 | createdAt: 2026-11-15T18:23:34.000Z | 65 | createdAt: 2026-11-15T18:23:34.000Z |
| 65 | -comments: [] | 66 | +comments: |
| 67 | + - id: 1 | ||
| 68 | + author: | ||
| 69 | + name: k33g | ||
| 70 | + email: ph.charriere@gmail.com | ||
| 71 | + createdAt: 2026-11-15T18:34:01.000Z | ||
| 72 | + body: | | ||
| 73 | + Précision de l'owner : **l'historique est par channel** — dans un channel, ↑ ne rappelle que les messages envoyés | ||
| 74 | + dans ce channel (ou cette conversation directe), jamais ceux d'un autre channel. | ||
modified
docs/en/how-to/work-with-an-agents-files.md +1 -1 | @@ -32,7 +32,7 @@ Markdown (`.md`), AsciiDoc (`.adoc`, `.asciidoc`, `.asc`) and HTML (`.html`, `.h | ||
| 32 | 32 | |
| 33 | 33 | When an agent writes a document and gives a link to it in its answer, click the link: the file opens in a panel at the right of the conversation, which stays in view. |
| 34 | 34 | |
| 35 | -- The panel previews Markdown, AsciiDoc, HTML and images as above, and shows any other text file as is. Links of the document to other files of the folder open in the same panel. | |
| 35 | +- The panel previews Markdown, AsciiDoc, HTML and images as above. Source code (Go, TypeScript, Python, shell, YAML… the languages of the editor) is coloured like in the **Files** tab, read-only, with line numbers (issue #117); any other text file is shown as is. Links of the document to other files of the folder open in the same panel. | |
| 36 | 36 | - **📂 Show where it is** opens the Finder (macOS) or the Explorer (Windows) with the file selected. It shows only when the agent's folder is on this computer: an agent on this computer, or in a container or sandbox whose folder is mounted from here. |
| 37 | 37 | - **Open in the agent's files** shows the file in the **Files** tab, to change it. **↻** reads it again after the agent changed it. |
| 38 | 38 | - **×** or **Escape** closes the panel; drag its left edge to resize it. |
| @@ -32,7 +32,7 @@ Markdown (`.md`), AsciiDoc (`.adoc`, `.asciidoc`, `.asc`) and HTML (`.html`, `.h | |||
| 32 | 32 | ||
| 33 | When an agent writes a document and gives a link to it in its answer, click the link: the file opens in a panel at the right of the conversation, which stays in view. | 33 | When an agent writes a document and gives a link to it in its answer, click the link: the file opens in a panel at the right of the conversation, which stays in view. |
| 34 | 34 | ||
| 35 | -- The panel previews Markdown, AsciiDoc, HTML and images as above, and shows any other text file as is. Links of the document to other files of the folder open in the same panel. | 35 | +- The panel previews Markdown, AsciiDoc, HTML and images as above. Source code (Go, TypeScript, Python, shell, YAML… the languages of the editor) is coloured like in the **Files** tab, read-only, with line numbers (issue #117); any other text file is shown as is. Links of the document to other files of the folder open in the same panel. |
| 36 | - **📂 Show where it is** opens the Finder (macOS) or the Explorer (Windows) with the file selected. It shows only when the agent's folder is on this computer: an agent on this computer, or in a container or sandbox whose folder is mounted from here. | 36 | - **📂 Show where it is** opens the Finder (macOS) or the Explorer (Windows) with the file selected. It shows only when the agent's folder is on this computer: an agent on this computer, or in a container or sandbox whose folder is mounted from here. |
| 37 | - **Open in the agent's files** shows the file in the **Files** tab, to change it. **↻** reads it again after the agent changed it. | 37 | - **Open in the agent's files** shows the file in the **Files** tab, to change it. **↻** reads it again after the agent changed it. |
| 38 | - **×** or **Escape** closes the panel; drag its left edge to resize it. | 38 | - **×** or **Escape** closes the panel; drag its left edge to resize it. |
modified
docs/fr/how-to/fichiers-et-terminal-d-un-agent.md +1 -1 | @@ -32,7 +32,7 @@ Les fichiers Markdown (`.md`), AsciiDoc (`.adoc`, `.asciidoc`, `.asc`) et HTML ( | ||
| 32 | 32 | |
| 33 | 33 | Quand un agent écrit un document et donne un lien vers lui dans sa réponse, cliquez sur le lien : le fichier s'ouvre dans un panneau à droite de la conversation, qui reste visible. |
| 34 | 34 | |
| 35 | -- Le panneau prévisualise le Markdown, l'AsciiDoc, le HTML et les images comme ci-dessus, et affiche tout autre fichier texte tel quel. Les liens du document vers d'autres fichiers du dossier s'ouvrent dans le même panneau. | |
| 35 | +- Le panneau prévisualise le Markdown, l'AsciiDoc, le HTML et les images comme ci-dessus. Le code source (Go, TypeScript, Python, shell, YAML… les langages de l'éditeur) est coloré comme dans l'onglet **Fichiers**, en lecture seule, avec les numéros de ligne (issue #117) ; tout autre fichier texte est affiché tel quel. Les liens du document vers d'autres fichiers du dossier s'ouvrent dans le même panneau. | |
| 36 | 36 | - **📂 Afficher l'emplacement** ouvre le Finder (macOS) ou l'Explorateur (Windows) avec le fichier sélectionné. Il n'apparaît que si le dossier de l'agent est sur cet ordinateur : un agent sur cet ordinateur, ou dans un conteneur ou une sandbox dont le dossier est monté depuis celui-ci. |
| 37 | 37 | - **Ouvrir dans les fichiers de l'agent** montre le fichier dans l'onglet **Files**, pour le modifier. **↻** le relit après un changement de l'agent. |
| 38 | 38 | - **×** ou **Échap** ferme le panneau ; faites glisser son bord gauche pour le redimensionner. |
| @@ -32,7 +32,7 @@ Les fichiers Markdown (`.md`), AsciiDoc (`.adoc`, `.asciidoc`, `.asc`) et HTML ( | |||
| 32 | 32 | ||
| 33 | Quand un agent écrit un document et donne un lien vers lui dans sa réponse, cliquez sur le lien : le fichier s'ouvre dans un panneau à droite de la conversation, qui reste visible. | 33 | Quand un agent écrit un document et donne un lien vers lui dans sa réponse, cliquez sur le lien : le fichier s'ouvre dans un panneau à droite de la conversation, qui reste visible. |
| 34 | 34 | ||
| 35 | -- Le panneau prévisualise le Markdown, l'AsciiDoc, le HTML et les images comme ci-dessus, et affiche tout autre fichier texte tel quel. Les liens du document vers d'autres fichiers du dossier s'ouvrent dans le même panneau. | 35 | +- Le panneau prévisualise le Markdown, l'AsciiDoc, le HTML et les images comme ci-dessus. Le code source (Go, TypeScript, Python, shell, YAML… les langages de l'éditeur) est coloré comme dans l'onglet **Fichiers**, en lecture seule, avec les numéros de ligne (issue #117) ; tout autre fichier texte est affiché tel quel. Les liens du document vers d'autres fichiers du dossier s'ouvrent dans le même panneau. |
| 36 | - **📂 Afficher l'emplacement** ouvre le Finder (macOS) ou l'Explorateur (Windows) avec le fichier sélectionné. Il n'apparaît que si le dossier de l'agent est sur cet ordinateur : un agent sur cet ordinateur, ou dans un conteneur ou une sandbox dont le dossier est monté depuis celui-ci. | 36 | - **📂 Afficher l'emplacement** ouvre le Finder (macOS) ou l'Explorateur (Windows) avec le fichier sélectionné. Il n'apparaît que si le dossier de l'agent est sur cet ordinateur : un agent sur cet ordinateur, ou dans un conteneur ou une sandbox dont le dossier est monté depuis celui-ci. |
| 37 | - **Ouvrir dans les fichiers de l'agent** montre le fichier dans l'onglet **Files**, pour le modifier. **↻** le relit après un changement de l'agent. | 37 | - **Ouvrir dans les fichiers de l'agent** montre le fichier dans l'onglet **Files**, pour le modifier. **↻** le relit après un changement de l'agent. |
| 38 | - **×** ou **Échap** ferme le panneau ; faites glisser son bord gauche pour le redimensionner. | 38 | - **×** ou **Échap** ferme le panneau ; faites glisser son bord gauche pour le redimensionner. |
modified
docs/release-notes/v1.7.0.fr.md +1 -0 | @@ -15,4 +15,5 @@ Brouillon — complété au fil des tickets de la 1.7.0. | ||
| 15 | 15 | |
| 16 | 16 | ### Petits changements |
| 17 | 17 | |
| 18 | +- Le code d'un fichier dont un agent donne le lien dans sa réponse est maintenant coloré dans le panneau à côté de la conversation, comme dans l'onglet Fichiers, en lecture seule (#117). | |
| 18 | 19 | - La zone de saisie grandit avec un long message et reprend maintenant sa taille une fois le message envoyé, ou quand ↑ / ↓ rappellent un message plus court (#111). |
| @@ -15,4 +15,5 @@ Brouillon — complété au fil des tickets de la 1.7.0. | |||
| 15 | 15 | ||
| 16 | ### Petits changements | 16 | ### Petits changements |
| 17 | 17 | ||
| 18 | +- Le code d'un fichier dont un agent donne le lien dans sa réponse est maintenant coloré dans le panneau à côté de la conversation, comme dans l'onglet Fichiers, en lecture seule (#117). | ||
| 18 | - La zone de saisie grandit avec un long message et reprend maintenant sa taille une fois le message envoyé, ou quand ↑ / ↓ rappellent un message plus court (#111). | 19 | - La zone de saisie grandit avec un long message et reprend maintenant sa taille une fois le message envoyé, ou quand ↑ / ↓ rappellent un message plus court (#111). |
modified
docs/release-notes/v1.7.0.md +1 -0 | @@ -15,4 +15,5 @@ Draft — completed as the 1.7.0 tickets are done. | ||
| 15 | 15 | |
| 16 | 16 | ### Smaller changes |
| 17 | 17 | |
| 18 | +- The code of a file an agent links to in its answer is now coloured in the panel beside the conversation, like in the Files tab, read-only (#117). | |
| 18 | 19 | - The message box grows with a long message and now shrinks back once it is sent, or when ↑ / ↓ bring back a shorter message (#111). |
| @@ -15,4 +15,5 @@ Draft — completed as the 1.7.0 tickets are done. | |||
| 15 | 15 | ||
| 16 | ### Smaller changes | 16 | ### Smaller changes |
| 17 | 17 | ||
| 18 | +- The code of a file an agent links to in its answer is now coloured in the panel beside the conversation, like in the Files tab, read-only (#117). | ||
| 18 | - The message box grows with a long message and now shrinks back once it is sent, or when ↑ / ↓ bring back a shorter message (#111). | 19 | - The message box grows with a long message and now shrinks back once it is sent, or when ↑ / ↓ bring back a shorter message (#111). |
modified
frontend/src/lib/agent/LinkedFilePanel.svelte +10 -0 | @@ -8,10 +8,14 @@ | ||
| 8 | 8 | import { previewKind } from '../preview' |
| 9 | 9 | import { act, agentTitle, appState, closeLinkedFile, openLinkedFile, openWorkspace, type LinkedView } from '../state.svelte' |
| 10 | 10 | import FilePreview from './FilePreview.svelte' |
| 11 | + import FileEditor from './FileEditor.svelte' | |
| 12 | + import { codeLanguage } from '../files' | |
| 11 | 13 | |
| 12 | 14 | let { linked }: { linked: LinkedView } = $props() |
| 13 | 15 | |
| 14 | 16 | const kind = $derived(previewKind(linked.path)) |
| 17 | + // Source code is coloured like in the Files tab, read-only (issue #117). | |
| 18 | + const language = $derived(codeLanguage(linked.path)) | |
| 15 | 19 | const name = $derived(linked.path.slice(linked.path.lastIndexOf('/') + 1)) |
| 16 | 20 | let content = $state('') |
| 17 | 21 | let problem = $state('') |
| @@ -73,6 +77,11 @@ | ||
| 73 | 77 | <p class="muted">…</p> |
| 74 | 78 | {:else if kind} |
| 75 | 79 | <FilePreview agent={linked.agent} path={linked.path} {content} {kind} {revision} onFile={(file) => openLinkedFile(linked.channel, linked.agent, file)} /> |
| 80 | + {:else if language} | |
| 81 | + <!-- Shown again from scratch when the file is read again (↻ or the agent's changes). --> | |
| 82 | + {#key content} | |
| 83 | + <div class="code"><FileEditor {content} {language} readOnly onChange={() => {}} onSave={() => {}} /></div> | |
| 84 | + {/key} | |
| 76 | 85 | {:else} |
| 77 | 86 | <pre>{content}</pre> |
| 78 | 87 | {/if} |
| @@ -89,6 +98,7 @@ | ||
| 89 | 98 | .actions { grid-column: 1 / span 2; display: flex; flex-wrap: wrap; gap: 6px; } |
| 90 | 99 | .actions button { font-size: 12px; padding: 2px 8px; } |
| 91 | 100 | .body { flex: 1; min-height: 0; padding: 10px 12px; overflow: auto; } |
| 101 | + .code { height: 100%; } | |
| 92 | 102 | pre { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; } |
| 93 | 103 | .problem { color: var(--danger); font-size: 13px; } |
| 94 | 104 | .muted { color: var(--muted); } |
| @@ -8,10 +8,14 @@ | |||
| 8 | import { previewKind } from '../preview' | 8 | import { previewKind } from '../preview' |
| 9 | import { act, agentTitle, appState, closeLinkedFile, openLinkedFile, openWorkspace, type LinkedView } from '../state.svelte' | 9 | import { act, agentTitle, appState, closeLinkedFile, openLinkedFile, openWorkspace, type LinkedView } from '../state.svelte' |
| 10 | import FilePreview from './FilePreview.svelte' | 10 | import FilePreview from './FilePreview.svelte' |
| 11 | + import FileEditor from './FileEditor.svelte' | ||
| 12 | + import { codeLanguage } from '../files' | ||
| 11 | 13 | ||
| 12 | let { linked }: { linked: LinkedView } = $props() | 14 | let { linked }: { linked: LinkedView } = $props() |
| 13 | 15 | ||
| 14 | const kind = $derived(previewKind(linked.path)) | 16 | const kind = $derived(previewKind(linked.path)) |
| 17 | + // Source code is coloured like in the Files tab, read-only (issue #117). | ||
| 18 | + const language = $derived(codeLanguage(linked.path)) | ||
| 15 | const name = $derived(linked.path.slice(linked.path.lastIndexOf('/') + 1)) | 19 | const name = $derived(linked.path.slice(linked.path.lastIndexOf('/') + 1)) |
| 16 | let content = $state('') | 20 | let content = $state('') |
| 17 | let problem = $state('') | 21 | let problem = $state('') |
| @@ -73,6 +77,11 @@ | |||
| 73 | <p class="muted">…</p> | 77 | <p class="muted">…</p> |
| 74 | {:else if kind} | 78 | {:else if kind} |
| 75 | <FilePreview agent={linked.agent} path={linked.path} {content} {kind} {revision} onFile={(file) => openLinkedFile(linked.channel, linked.agent, file)} /> | 79 | <FilePreview agent={linked.agent} path={linked.path} {content} {kind} {revision} onFile={(file) => openLinkedFile(linked.channel, linked.agent, file)} /> |
| 80 | + {:else if language} | ||
| 81 | + <!-- Shown again from scratch when the file is read again (↻ or the agent's changes). --> | ||
| 82 | + {#key content} | ||
| 83 | + <div class="code"><FileEditor {content} {language} readOnly onChange={() => {}} onSave={() => {}} /></div> | ||
| 84 | + {/key} | ||
| 76 | {:else} | 85 | {:else} |
| 77 | <pre>{content}</pre> | 86 | <pre>{content}</pre> |
| 78 | {/if} | 87 | {/if} |
| @@ -89,6 +98,7 @@ | |||
| 89 | .actions { grid-column: 1 / span 2; display: flex; flex-wrap: wrap; gap: 6px; } | 98 | .actions { grid-column: 1 / span 2; display: flex; flex-wrap: wrap; gap: 6px; } |
| 90 | .actions button { font-size: 12px; padding: 2px 8px; } | 99 | .actions button { font-size: 12px; padding: 2px 8px; } |
| 91 | .body { flex: 1; min-height: 0; padding: 10px 12px; overflow: auto; } | 100 | .body { flex: 1; min-height: 0; padding: 10px 12px; overflow: auto; } |
| 101 | + .code { height: 100%; } | ||
| 92 | pre { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; } | 102 | pre { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; } |
| 93 | .problem { color: var(--danger); font-size: 13px; } | 103 | .problem { color: var(--danger); font-size: 13px; } |
| 94 | .muted { color: var(--muted); } | 104 | .muted { color: var(--muted); } |
modified
frontend/src/lib/files.test.ts +14 -1 | @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE |
| 2 | 2 | |
| 3 | 3 | import { describe, expect, it } from 'vitest' |
| 4 | -import { iconFor, isHidden, languageFor, parentsOf, validFileName } from './files' | |
| 4 | +import { codeLanguage, iconFor, isHidden, languageFor, parentsOf, validFileName } from './files' | |
| 5 | 5 | |
| 6 | 6 | describe('workspace files', () => { |
| 7 | 7 | it('hides dot files and generated folders by default', () => { |
| @@ -54,3 +54,16 @@ describe('workspace files', () => { | ||
| 54 | 54 | expect(parentsOf('AGENTS.md')).toEqual([]) |
| 55 | 55 | }) |
| 56 | 56 | }) |
| 57 | + | |
| 58 | +describe('the code of a linked file (issue #117)', () => { | |
| 59 | + it('is coloured in the language of its name or extension', () => { | |
| 60 | + expect(codeLanguage('src/main.go')).toBe('go') | |
| 61 | + expect(codeLanguage('app/index.TS')).toBe('typescript') | |
| 62 | + expect(codeLanguage('Dockerfile')).toBe('dockerfile') | |
| 63 | + }) | |
| 64 | + it('stays plain text when the language is unknown', () => { | |
| 65 | + expect(codeLanguage('notes.txt')).toBeNull() | |
| 66 | + expect(codeLanguage('LICENSE')).toBeNull() | |
| 67 | + }) | |
| 68 | +}) | |
| 69 | + | |
| @@ -1,7 +1,7 @@ | |||
| 1 | // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | 1 | // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE |
| 2 | 2 | ||
| 3 | import { describe, expect, it } from 'vitest' | 3 | import { describe, expect, it } from 'vitest' |
| 4 | -import { iconFor, isHidden, languageFor, parentsOf, validFileName } from './files' | 4 | +import { codeLanguage, iconFor, isHidden, languageFor, parentsOf, validFileName } from './files' |
| 5 | 5 | ||
| 6 | describe('workspace files', () => { | 6 | describe('workspace files', () => { |
| 7 | it('hides dot files and generated folders by default', () => { | 7 | it('hides dot files and generated folders by default', () => { |
| @@ -54,3 +54,16 @@ describe('workspace files', () => { | |||
| 54 | expect(parentsOf('AGENTS.md')).toEqual([]) | 54 | expect(parentsOf('AGENTS.md')).toEqual([]) |
| 55 | }) | 55 | }) |
| 56 | }) | 56 | }) |
| 57 | + | ||
| 58 | +describe('the code of a linked file (issue #117)', () => { | ||
| 59 | + it('is coloured in the language of its name or extension', () => { | ||
| 60 | + expect(codeLanguage('src/main.go')).toBe('go') | ||
| 61 | + expect(codeLanguage('app/index.TS')).toBe('typescript') | ||
| 62 | + expect(codeLanguage('Dockerfile')).toBe('dockerfile') | ||
| 63 | + }) | ||
| 64 | + it('stays plain text when the language is unknown', () => { | ||
| 65 | + expect(codeLanguage('notes.txt')).toBeNull() | ||
| 66 | + expect(codeLanguage('LICENSE')).toBeNull() | ||
| 67 | + }) | ||
| 68 | +}) | ||
| 69 | + | ||
modified
frontend/src/lib/files.ts +13 -0 | @@ -76,6 +76,19 @@ export function languageFor(path: string): EditorLanguage { | ||
| 76 | 76 | return languagesByExtension[extensionOf(name)] ?? 'text' |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | +/** | |
| 80 | + * The language a linked file's code is coloured in (issue #117), or null | |
| 81 | + * when it is not one the editor knows: such a file stays plain text. | |
| 82 | + * | |
| 83 | + * @example | |
| 84 | + * codeLanguage('src/main.go') // 'go' | |
| 85 | + * codeLanguage('notes.txt') // null | |
| 86 | + */ | |
| 87 | +export function codeLanguage(path: string): EditorLanguage | null { | |
| 88 | + const language = languageFor(path) | |
| 89 | + return language === 'text' ? null : language | |
| 90 | +} | |
| 91 | + | |
| 79 | 92 | function extensionOf(name: string): string { |
| 80 | 93 | const dot = name.lastIndexOf('.') |
| 81 | 94 | return dot > 0 ? name.slice(dot + 1).toLowerCase() : '' |
| @@ -76,6 +76,19 @@ export function languageFor(path: string): EditorLanguage { | |||
| 76 | return languagesByExtension[extensionOf(name)] ?? 'text' | 76 | return languagesByExtension[extensionOf(name)] ?? 'text' |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | +/** | ||
| 80 | + * The language a linked file's code is coloured in (issue #117), or null | ||
| 81 | + * when it is not one the editor knows: such a file stays plain text. | ||
| 82 | + * | ||
| 83 | + * @example | ||
| 84 | + * codeLanguage('src/main.go') // 'go' | ||
| 85 | + * codeLanguage('notes.txt') // null | ||
| 86 | + */ | ||
| 87 | +export function codeLanguage(path: string): EditorLanguage | null { | ||
| 88 | + const language = languageFor(path) | ||
| 89 | + return language === 'text' ? null : language | ||
| 90 | +} | ||
| 91 | + | ||
| 79 | function extensionOf(name: string): string { | 92 | function extensionOf(name: string): string { |
| 80 | const dot = name.lastIndexOf('.') | 93 | const dot = name.lastIndexOf('.') |
| 81 | return dot > 0 ? name.slice(dot + 1).toLowerCase() : '' | 94 | return dot > 0 ? name.slice(dot + 1).toLowerCase() : '' |