In dooit, layouts define the order and presence of columns in the UI. You can customize these by subscribing to the Startup event and modifying the api.layouts object.
Important Constraints:
- Editing: You can only edit items if their corresponding column is present in the layout (e.g., if
TodoWidget.due is missing from the layout, you cannot edit the due date). - Description Column: The
Description column automatically expands to fill all remaining space after other columns are rendered.
Available Columns:
- WorkspaceWidget: Only
description is available. - TodoWidget:
description, due, effort, recurrence, status, and urgency are available.
Tip for Hidden Columns: If you want to hide a column (like effort) but still maintain the ability to edit it, you can edit the column-specific formatter to show nothing and instead modify the description formatter to include that information.
from dooit.ui.api.widgets import TodoWidget, WorkspaceWidget
from dooit.ui.api import DooitAPI, subscribe
from dooit.ui.api.events import Startup
@subscribe(Startup)
def layout_setup(api: DooitAPI, _):
# Set the workspace layout
api.layouts.workspace_layout = [WorkspaceWidget.description]
# Set the todo layout
api.layouts.todo_layout = [
TodoWidget.status,
TodoWidget.description,
TodoWidget.recurrence,
TodoWidget.due,
TodoWidget.urgency,
]