Skip to content

Restore self.update() in DateSelector.set_date()#243

Merged
clstaudt merged 2 commits intostreamlinefrom
copilot/sub-pr-239-yet-again
Mar 12, 2026
Merged

Restore self.update() in DateSelector.set_date()#243
clstaudt merged 2 commits intostreamlinefrom
copilot/sub-pr-239-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

DateSelector.set_date() was mutating internal state and updating control values without calling self.update(), leaving the UI stale when invoked on an already-mounted control (e.g., date presets in invoicing, loading an entity into an editor).

Change

  • Appended self.update() to DateSelector.set_date() so the control repaints after state mutation:
def set_date(self, date: Optional[datetime.date] = None):
    if date is None:
        return
    self._selected_date = date
    self._picker.value = datetime.datetime.combine(date, datetime.time())
    self._date_text.value = date.strftime(self._DATE_FMT)
    self._date_text.color = colors.text_primary
    self.update()  # restored: ensures mounted control reflects new date

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: clstaudt <875194+clstaudt@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on UI/UX improvements for version 2.1 Restore self.update() in DateSelector.set_date() Mar 10, 2026
@clstaudt clstaudt marked this pull request as ready for review March 12, 2026 21:24
@clstaudt clstaudt merged commit 7a37679 into streamline Mar 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants