DM Creation Menu Base
It is time to start on the menus for actually creating archives. Spaces and DMs have the same basic elements, so I am planning to create a few custom widgets that I can reuse for both of them. I decided that I would start with creating the DM creation, as DMs are a bit simpler than spaces.
Hub Menu
The first thing I created was a hub menu that will be used to create new DMs, Spaces, or Export the archive. It is fairly similar to the Main Menu, except that I used tcss instead of a container to centre the buttons. i think that this makes the code cleaner, and makes more sense with how textual works. I had a small problem where nothing was happening after I added content-align to my tcss file for the Hub Menu; as it turns out I needed normal align to align buttons.
DM Creation Menu
This menu has a basic docked sidebar just like the User Creation Menu. I am hoping that the plan of using single widgets that “plug in” will prevent UI issues like the user Creation Menu has.
ID and Archive Handling
I added a scripts folder with two small scripts:
-
id_handelerto create the IDs for each message archive -
archive_handelingfor classes to store archive, and, in the future, handle exporting
The ID handler contains a single Enum with values for DMs and Spaces. It also has a single static function to create a custom ID using Python’s uuid and base64 libraries, adding the correct DM or Space value based on the passed type. The archive handler currently contains two stub classes, one for storing archives, and another for storing messages. As more features are added, these classes will grow as well.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.