refactor(style): drop the type role that could never be pushed
TypeRole.Header had no call site and could not get one. The channel header is set apart by small caps and tracking, not by size, so the role resolved to exactly Body -- a value that would sit in the enum being equal to another value forever. That is the precise thing this style track exists to prevent. Five widgets shipped once with no call site at all, and the rule that came out of it says no piece lands without one in the same pass. Writing a caller just to satisfy the rule would have been worse than the rule. Also cleans two comments the pop-out rewrite left pointing at things that are gone: a close button that lived on the removed title row, and a method description with no method under it.
This commit is contained in:
@@ -4,19 +4,22 @@ internal enum TypeRole
|
||||
{
|
||||
Body,
|
||||
Sender,
|
||||
Header,
|
||||
Meta,
|
||||
}
|
||||
|
||||
// Named sizes derived from one base, so a role means the same thing wherever it
|
||||
// is drawn.
|
||||
//
|
||||
// Three of the four share the base size. That is deliberate: what sets the
|
||||
// sender apart is weight and what sets the header apart is small caps with wide
|
||||
// tracking, and neither is a size. Solving those with size instead would make
|
||||
// the log look like a ransom note. Only the meta role -- timestamps and the
|
||||
// header's trailing detail -- steps down, because it is meant to be skipped over
|
||||
// rather than read.
|
||||
// Two of the three share the base size. That is deliberate: what sets the sender
|
||||
// apart is weight, not size. Solving that with size instead would make the log
|
||||
// look like a ransom note. Only the meta role -- timestamps and the header's
|
||||
// trailing detail -- steps down, because it is meant to be skipped over rather
|
||||
// than read.
|
||||
//
|
||||
// There is no Header role. The channel header is set apart by small caps with
|
||||
// wide tracking and runs at the body size, so a role for it would resolve to
|
||||
// exactly Body and never be pushed -- a value with no call site, which is the one
|
||||
// thing this whole style track exists to stop.
|
||||
//
|
||||
// The factors are defaults, not constants. The master spec puts typography under
|
||||
// theme control rather than user control, and ThemeTypography already exists as
|
||||
@@ -31,7 +34,6 @@ internal static class TypeScale
|
||||
[
|
||||
1.00f, // Body -- the reference every other role is stated against
|
||||
1.00f, // Sender -- set apart by weight, see FontManager.SenderWeight
|
||||
1.00f, // Header -- set apart by small caps and tracking
|
||||
0.82f, // Meta -- timestamps, and the world and clock in the header
|
||||
];
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ internal sealed class ChannelPopoutWindow : Window, IFocusableChatWindow
|
||||
InputBar.Height
|
||||
);
|
||||
|
||||
// The header close button can unbind us mid-frame (CloseRequested ->
|
||||
// Anything drawn above can unbind us mid-frame (CloseRequested ->
|
||||
// pool.TryClose -> Unbind nulls Bound). Re-check before the body so we
|
||||
// never hand a null tab to MessageList/InputBar in this same Draw call.
|
||||
if (Bound is null)
|
||||
@@ -173,6 +173,4 @@ internal sealed class ChannelPopoutWindow : Window, IFocusableChatWindow
|
||||
|
||||
_input.Draw(Bound);
|
||||
}
|
||||
|
||||
// Name only. Shown when the window has no title bar to carry it.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user