aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-08-07 23:24:12 +0200
committerblasty <blasty@local>2026-08-07 23:24:12 +0200
commit5ccbc09ce7d43d226683589e8141f9e216f2f176 (patch)
tree86e83b19c322b1effd4fce42ade3c9f3fbb9cb1e /docs
parentCtrl+F: search the whole database, by text or by bytes (diff)
downloadida-tui-5ccbc09ce7d43d226683589e8141f9e216f2f176.tar.gz
ida-tui-5ccbc09ce7d43d226683589e8141f9e216f2f176.tar.xz
ida-tui-5ccbc09ce7d43d226683589e8141f9e216f2f176.zip
Centre modals with a rule about modals, not a list of them
SearchPalette opened pinned to the top of the screen: the CSS named the screens that centre (`SymbolPalette, StringsPalette, ProjectPalette, …`) and a new dialog is not on a list nobody remembers to edit. The comment sitting above that rule — "every #pal-box palette centres, not just the symbol one" — was the *first* time this happened. `ModalScreen { align: center middle; }` matches subclasses, so every dialog inherits it and the next one is centred for free; the eight per-screen rules that only repeated it are gone. Textual's own Ctrl+P CommandPalette is a ModalScreen too and wants its stock top alignment, so it opts out in one visible line rather than by omission. The `modal_centering` scenario checks both halves: that centring is expressed as a rule, and that it actually reaches a dialog's laid-out region (above/below and left/right within a cell). 894 passed, 0 failed.
Diffstat (limited to 'docs')
-rw-r--r--docs/TEXTUAL_NOTES.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/TEXTUAL_NOTES.md b/docs/TEXTUAL_NOTES.md
index 83d385c..10df669 100644
--- a/docs/TEXTUAL_NOTES.md
+++ b/docs/TEXTUAL_NOTES.md
@@ -53,6 +53,13 @@ Hard-won Textual behaviour and the patterns this app relies on. Pairs with
`build_byte_to_codepoint_dict`, so character offsets smear on non-ASCII), and
a `TextAreaTheme` that sets `base_style` overrides the widget's CSS colours —
ours sets only `syntax_styles` so the editor keeps the app's background.
+- **Centre modals with a rule, not a list.** `ModalScreen { align: center middle; }`
+ matches subclasses, so every dialog inherits it and the next one is centred
+ for free. Naming the screens instead (`SymbolPalette, StringsPalette, …`) is
+ how two palettes shipped pinned to the top of the screen. Textual's own
+ `CommandPalette` is a ModalScreen too and wants its stock top alignment, so it
+ opts out explicitly. The `modal_centering` scenario asserts both the rule and
+ that it reaches a real dialog's `region`.
- **Modal chrome lives in ONE grouped CSS rule** (`#quit-box, #help-box, …` in
`IdaTui.CSS`): `border: round`, title colour, subtitle colour. Per-box rules
carry only size. Dialog titles are `border_title`/`border_subtitle` on the box,