Debian Codegraph @

docs/future.md

raw symbols SCIP
1 # The future of this library
2
3 I intend on growing this library as long as there are ways to improve it; life might get in the way at some points, but I want to keep using the project in my personal tooling, and I know many people count on it's reliability for their own.
4
5 The current version of the module is pretty stable in terms of the API. There is only a handful of upcoming API changes, some of which will unfortunately have to roll over a major version. This page exists as a sort of heads-up note, so users know what to expect. I will try to keep this up to date whenever plans change, or tasks are complete.
6
7
8 ## **8.0.0** - The _(second)_ widget update
9
10 The next major release is, according to my plans, the last one for a long time. It will be a modernization of a lot of APIs, and it's main purpose is to bundle all the minor but compatibility breaking changes together into a single release.
11
12 The end goal of this version is to make it so implementing the [7GUIs](https://eugenkiss.github.io/7guis/) is simple, and can be done by most newcomers to the library.
13
14 ### Planned changes
15
16 - A new, more stable `Container.get_lines` implementation
17 - Better API for aligning widgets within containers
18 - A rethink of the sizing system -- likely implementing the layout system's [dimensions](/reference/pytermgui/window_manager/layouts#pytermgui.window_manager.layouts.Dimension), and possibly removing static sizes
19 - Better implementation of heights, one that is more consistent with widths
20 - Better buttons: checkboxes with labels, new base button class with more customization and nicer styling and rethink of toggle
21 - Better, more customizable layouts within containers: probably a better splitter, possibly allowing Containers to use [layouts](/reference/pytermgui/window_manager/layouts#pytermgui.window_manager.layouts.Layout)
22
23
24 ## **8.1.0** - A better YAML styling engine
25
26 The current YAML styling works, but doesn't support quite as much as I would like it to. CSS, as <sub>as hideous as it can be</sub> does some things well: being able to apply styles to specific elements individually, swapping style groups on the fly and integration with the scripting language, just to name a few.
27
28 With this update, our YAML files should do more or less the same as CSS, but in a more thought-out manner, with clear and readable syntax.
29
30 An example PTG YAML file could be the following:
31
32 ```yaml title="styles.ptg"
33 aliases:
34 main-background: '@surface-1'
35 main-foreground: 'surface+1'
36
37 config:
38 *:
39 background: 'main-background'
40
41 Window is_modal?:
42 borders: 'DOUBLE'
43 styles.border__corner: 'error'
44
45 Button .confirm:
46 styles.normal:
47 background: '@success-2'
48 foreground: 'success'
49
50 styles.hover:
51 background: '@success'
52 foreground: 'success+1'
53
54 styles.active:
55 background: '@success+1'
56 foreground: 'success+2'
57 ```
58
59 ```python
60 from pytermgui import Stylesheet
61
62 styles = Stylesheet.load("styles.ptg", auto_reload=True)
63 ```
64
65 ### Planned changes
66
67 - Re-wiring `_IdManager` to act as the style managment overlord
68 - Likely re-writing the `file_loaders` module. I hope to keep the current API alive, with massive deprecation notices
69 - Moving some of the default widget configuration into a `default.yaml` file
70
71
72 ## **8.X.0**: A better composition
73
74 The current compositor isn't super smart. It does _way_ too much writes to the terminal, and thus it makes things flickery and unstable on lower power emulators. A fix to this is already far in the works, and involves a resizable matrix of screen coordinates to their content. I want this update to happen seemlessly on the user's side, but this makes things a _lot_ more difficult.
75
76 ### Planned changes
77
78 - Add a canvas class that handles emulating the terminal's display
79 - Change compositor to write to a canvas, and to only update the terminal with the canvas' contents