A narrow changes toolbar wrapped its controls onto a second row and the header's buttons broke their labels across two lines. Side by side, a right-side comment was placed with clamp(10px, 100% - 700px, 50% + 10px), so below about 1,420 px it crossed into the left column, and only one comment editor could be open at a time. The toolbar now keeps one line. observeToolbarFold measures what each fold level needs and sets data-fold to the shallowest level that fits: level 1 moves the line totals, expanding all files, two columns, and wrapping into a More view options menu, level 2 the test file switch, with the viewed progress shown as a ring and a count, and level 3 refresh; at level 3 the file list entry shortens its label. The menu lists the controls of the level shown when it opens. Measuring instead of fixed widths keeps every locale on one line: the full toolbar needs about 650 px in Chinese and nearly 800 px in Russian. Header buttons keep their labels on one line. Side by side, the comments that end on a row now sit in a row of two cells under its columns, each continuing its line's gutter and background, so a left and a right comment share the row. Any number of editors can stay open; choosing an open editor's range focuses it. Resolves #8176
38 lines
4.4 KiB
CSS
38 lines
4.4 KiB
CSS
/* Inline review forms use the same field, action, and badge treatments as settings and conversation controls. */
|
|
.root, .thread { box-sizing: border-box; width: calc(100% - 20px); max-width: 680px; margin: 10px; padding: 12px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: var(--dsw-font-xs-13); font-family: Inter, var(--dsw-font-family); white-space: normal; }
|
|
.root { background: var(--dsw-alias-bg-layer-2); border-radius: var(--dsw-radius-lg); }
|
|
.root:focus-within { border-color: var(--dsw-alias-border-l4); }
|
|
/* Side by side, a comment fills its side's cell under the code instead of the row's width. */
|
|
[data-forge-comments] > .root, [data-forge-comments] > .thread { width: auto; max-width: none; margin: 0; }
|
|
.title { margin-bottom: 12px; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
|
|
/* Fixed-size textarea layout stays local during typing; native resizing can still change its outer height. */
|
|
.input { display: block; box-sizing: border-box; width: 100%; height: 88px; min-height: 88px; contain: strict; padding: 10px 12px; resize: vertical; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: var(--dsw-radius-md); outline: none; background: var(--dsw-alias-bg-layer-3); color: var(--dsw-alias-label-primary); font: inherit; }
|
|
.input::placeholder { color: var(--dsw-alias-label-dimmed); }
|
|
.input:focus { border-color: var(--dsw-alias-state-business-primary); }
|
|
.root .input { padding: 0; border: 0; border-radius: 0; background: transparent; }
|
|
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 10px; margin-top: 10px; border-top: 0.5px solid var(--dsw-alias-border-l2); }
|
|
.cancel { margin-inline-end: auto; }
|
|
.error { margin-top: 8px; color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; }
|
|
.gitAction { display: inline-flex; flex: none; align-items: stretch; }
|
|
.gitMain { border-start-end-radius: 0; border-end-end-radius: 0; }
|
|
.gitArrow { width: 30px; padding: 0; border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: 0.5px solid color-mix(in srgb, var(--dsw-alias-label-primary-foreground) 25%, transparent); }
|
|
.threadHeader { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
|
|
.author { font-weight: 500; }
|
|
.range { color: var(--dsw-alias-label-secondary); font-size: 12px; }
|
|
.commentBody { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
.threadActions { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px -8px -4px; }
|
|
.gutter { position: relative; }
|
|
.line { display: block; width: 100%; height: 100%; padding: 0; color: inherit; text-align: inherit; cursor: pointer; border: 0; border-radius: 0; background: transparent; font: inherit; user-select: none; touch-action: pan-y; }
|
|
.selected { background: var(--dsw-alias-interactive-bg-hover); outline: 1px solid var(--dsw-alias-border-l2); outline-offset: -1px; }
|
|
@media (hover: hover) { .line:hover { color: var(--dsw-alias-state-business-primary); } }
|
|
@media (pointer: coarse) { .input { font-size: 16px; } .line { min-height: 28px; } }
|
|
|
|
/* The plus starts just inside the number's padding and covers the sign column, or the empty lane side-by-side cells keep instead, so the line number and the code stay clickable. */
|
|
.add, .hoverAdd { position: absolute; z-index: 1; inset-inline-start: calc(100% - 4px); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-foreground); font: inherit; cursor: pointer; user-select: none; }
|
|
/* Unified rows that show both numbers move the left plus past the right number too; it paints over that number's padding. The plus inherits the code font because the number width is measured in `ch`. */
|
|
[data-review]:not([data-split]):not([data-single-side]) [data-review-side="L"] .add,
|
|
[data-review]:not([data-split]):not([data-single-side]) [data-review-side="L"] .hoverAdd { inset-inline-start: calc(100% + var(--forge-number-width, 3.5em) - 4px); }
|
|
/* The mouse shortcut appears only for the hovered side of a row: a split cell or a unified line. */
|
|
.hoverAdd { display: none; }
|
|
@media (hover: hover) { [data-diff-side]:hover .hoverAdd, [data-diff-line]:hover .hoverAdd { display: inline-flex; } }
|