Skip to content

Commit 92dd606

Browse files
authored
feat: Add tooltip to code preview of monaco editor (#4355)
1 parent dc14277 commit 92dd606

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

public/i18n/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ command-palette:
226226
remove-ns-context: Remove Namespace context
227227
common:
228228
ariaLabel:
229+
code-preview: Code Preview
229230
editor: editor
230231
new-tab-link: This link will be opened in a new tab.
231232
buttons:

src/shared/components/MonacoEditorESM/hooks/useCreateEditor.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ export const useCreateEditor = ({
6161
...options,
6262
});
6363

64+
if (divRef.current) {
65+
const minimapElement = divRef.current.querySelector('.minimap');
66+
if (minimapElement) {
67+
minimapElement.setAttribute(
68+
'title',
69+
t('common.ariaLabel.code-preview'),
70+
);
71+
}
72+
}
73+
6474
setEditorInstance(instance);
6575

6676
return () => {

0 commit comments

Comments
 (0)