Skip to content

Commit 6889ad5

Browse files
committed
ux: unify Monaco scrollbar width to 8px across pre-diff entry and post-diff view
The home-page paste boxes (pages/index.vue) used Monaco's stock ~14-px vertical scrollbar, while the diff viewer's modified pane had been narrowed to 8-px via inline createDiffEditor options. Visual weight of the right-edge scrollbar differed between the two pages — chunky on the entry page, slim on the diff page. Move the scrollbar config into the shared getMonacoEditorDefaultOptions in helpers/utils.ts: scrollbar: { useShadows: false, verticalScrollbarSize: 8, horizontalScrollbarSize: 8, verticalSliderSize: 8, horizontalSliderSize: 8, } Both pages spread these defaults, so the entry boxes now get the same slim 8-px scrollbar that the diff viewer's modified pane shows. The diff editor's per-side updateOptions still overrides this for the original pane (verticalScrollbarSize:0 to hide it entirely while intra-diff sync drives both panes from the modified scrollbar). Removed the now-redundant explicit scrollbar block from diff.vue's createDiffEditor call — the spread defaults cover it.
1 parent 1cc1b0b commit 6889ad5

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

helpers/utils.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ export function getMonacoEditorDefaultOptions(theme: string): any {
9393
selectionHighlight: false,
9494
renderLineHighlight: 'none',
9595
inlineSuggest: { enabled: false },
96+
/* Slim 8-px scrollbars on every Monaco editor that consumes these
97+
* defaults — the home page paste boxes AND the diff editor below.
98+
* Without this, the home editors get Monaco's stock ~14-px bars
99+
* which look chunky next to the diff page's 8-px modified-pane
100+
* scrollbar. Consistency across pre-diff (entry) and post-diff
101+
* (view) keeps the visual weight of vertical chrome the same. */
102+
scrollbar: {
103+
useShadows: false,
104+
verticalScrollbarSize: 8,
105+
horizontalScrollbarSize: 8,
106+
verticalSliderSize: 8,
107+
horizontalSliderSize: 8,
108+
},
96109
}
97110
}
98111

pages/diff.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,9 @@ export default Vue.extend({
297297
// change overview rather than a redundant scrollbar.
298298
overviewRulerBorder: false,
299299
overviewRulerLanes: 3,
300-
scrollbar: {
301-
useShadows: false,
302-
verticalScrollbarSize: 8,
303-
horizontalScrollbarSize: 8,
304-
verticalSliderSize: 8,
305-
horizontalSliderSize: 8,
306-
},
300+
/* scrollbar settings (8-px slim bars) inherited from
301+
* getMonacoEditorDefaultOptions(); per-side overrides
302+
* below tune width=0 on the hidden original pane. */
307303
renderLineHighlight: 'none',
308304
renderOverviewRuler: true,
309305
}

0 commit comments

Comments
 (0)