diff --git a/services/web/app/views/project/editor/left-menu.pug b/services/web/app/views/project/editor/left-menu.pug
index 953e390692..13c2adf50e 100644
--- a/services/web/app/views/project/editor/left-menu.pug
+++ b/services/web/app/views/project/editor/left-menu.pug
@@ -120,7 +120,7 @@ aside#left-menu.full-size(
if dictionaryEditorEnabled
.form-controls(ng-controller="DictionaryModalController")
label #{translate("dictionary")}
- button.btn.btn-default.btn-sm(ng-click="openModal()") #{translate("edit")}
+ button.btn.btn-default.btn-xs(ng-click="openModal()") #{translate("edit")}
dictionary-modal(
handle-hide="handleHide"
diff --git a/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx b/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx
index 44c6c05fb3..03b4032c7f 100644
--- a/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx
+++ b/services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx
@@ -1,4 +1,4 @@
-import { useCallback } from 'react'
+import { useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Alert, Button, Modal } from 'react-bootstrap'
import Icon from '../../../shared/components/icon'
@@ -6,11 +6,14 @@ import Tooltip from '../../../shared/components/tooltip'
import useAsync from '../../../shared/hooks/use-async'
import { postJSON } from '../../../infrastructure/fetch-json'
import ignoredWords from '../ignored-words'
+import BetaBadge from '../../../shared/components/beta-badge'
type DictionaryModalContentProps = {
handleHide: () => void
}
+const wordsSortFunction = (a, b) => a.localeCompare(b)
+
export default function DictionaryModalContent({
handleHide,
}: DictionaryModalContentProps) {
@@ -32,10 +35,31 @@ export default function DictionaryModalContent({
[runAsync]
)
+ const betaBadgeTooltipProps = useMemo(() => {
+ return {
+ id: 'dictionary-modal-tooltip',
+ placement: 'bottom',
+ className: 'tooltip-wide',
+ text: (
+ <>
+ We are beta testing the dictionary manager.
+
+ Click to give feedback
+ >
+ ),
+ }
+ }, [])
+
return (
<>
- {t('edit_dictionary')}
+
+ {t('edit_dictionary')}{' '}
+
+
@@ -44,26 +68,30 @@ export default function DictionaryModalContent({
) : null}
{ignoredWords.learnedWords?.size > 0 ? (
-
- {[...ignoredWords.learnedWords].sort().map(learnedWord => (
- -
-
-
-
- {learnedWord}
-
- ))}
+
+
+
+ ))}
) : (
{t('edit_dictionary_empty')}
diff --git a/services/web/frontend/stylesheets/app/editor.less b/services/web/frontend/stylesheets/app/editor.less
index 8a715135d3..13741f120b 100644
--- a/services/web/frontend/stylesheets/app/editor.less
+++ b/services/web/frontend/stylesheets/app/editor.less
@@ -15,6 +15,7 @@
@import './editor/publish-modal.less';
@import './editor/outline.less';
@import './editor/logs.less';
+@import './editor/dictionary.less';
@ui-layout-toggler-def-height: 50px;
@ui-resizer-size: 7px;
diff --git a/services/web/frontend/stylesheets/app/editor/dictionary.less b/services/web/frontend/stylesheets/app/editor/dictionary.less
new file mode 100644
index 0000000000..021eb96105
--- /dev/null
+++ b/services/web/frontend/stylesheets/app/editor/dictionary.less
@@ -0,0 +1,29 @@
+#dictionary-modal {
+ .modal-body {
+ padding: 0;
+ }
+}
+
+.dictionary-entries-list {
+ overflow-y: scroll;
+ max-height: calc(100vh - 225px);
+ margin: 0;
+ padding: @padding-sm;
+}
+
+.dictionary-entry {
+ word-break: break-all;
+ display: flex;
+ padding: @padding-sm;
+ border-bottom: solid 1px @modal-header-border-color;
+ align-items: center;
+
+ &:last-child {
+ border-bottom: none;
+ }
+}
+
+.dictionary-entry-name {
+ flex-grow: 1;
+ padding-right: @padding-xs;
+}
diff --git a/services/web/frontend/stylesheets/app/editor/left-menu.less b/services/web/frontend/stylesheets/app/editor/left-menu.less
index 906f1d61de..7a6f607d0b 100644
--- a/services/web/frontend/stylesheets/app/editor/left-menu.less
+++ b/services/web/frontend/stylesheets/app/editor/left-menu.less
@@ -126,9 +126,3 @@
background-color: #999;
z-index: 99;
}
-
-#dictionary-modal {
- li {
- word-break: break-all;
- }
-}
diff --git a/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.test.js b/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.test.js
index 437eadfd09..072357dd83 100644
--- a/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.test.js
+++ b/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.test.js
@@ -33,7 +33,7 @@ describe('', function () {
it('removes words', async function () {
fetchMock.post('/spelling/unlearn', 200)
- setLearnedWords(['foo', 'bar'])
+ setLearnedWords(['Foo', 'bar'])
renderWithEditorContext( {}} />)
screen.getByText('bar')
const [firstButton] = screen.getAllByRole('button', {
@@ -41,7 +41,7 @@ describe('', function () {
})
fireEvent.click(firstButton)
expect(screen.queryByText('bar')).to.not.exist
- screen.getByText('foo')
+ screen.getByText('Foo')
})
it('handles errors', async function () {