feat: add energy-aware scheduling and daily insights
- Learn a per-device 7x24 energy profile from completed tasks\n- Constrain high-energy scheduling and expose energy peaks to AI\n- Add ghost-time overlays, daily review dialog, and proactive suggestions\n- Cover energy/insights logic and local OpenAI-compatible providers with tests\n- Update validation docs and screenshots
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "ElaScrollArea.h"
|
||||
#include "ElaText.h"
|
||||
#include "ElaToolButton.h"
|
||||
#include "TodayItemCard.h"
|
||||
|
||||
TodayPanel::TodayPanel(QWidget* parent)
|
||||
@@ -31,11 +32,26 @@ TodayPanel::TodayPanel(QWidget* parent)
|
||||
m_titleLabel->setFont(titleFont);
|
||||
m_countLabel = new ElaText(this);
|
||||
m_countLabel->setTextPixelSize(11);
|
||||
m_reviewButton = new ElaToolButton(this);
|
||||
m_reviewButton->setIsTransparent(true);
|
||||
m_reviewButton->setElaIcon(ElaIconType::ClipboardCheck);
|
||||
m_reviewButton->setFixedSize(26, 26);
|
||||
m_reviewButton->setToolTip(QStringLiteral("今日复盘 (Ctrl+R)"));
|
||||
connect(m_reviewButton, &ElaToolButton::clicked, this, &TodayPanel::reviewRequested);
|
||||
|
||||
header->addWidget(m_titleLabel);
|
||||
header->addStretch(1);
|
||||
header->addWidget(m_countLabel, 0, Qt::AlignVCenter);
|
||||
header->addWidget(m_reviewButton, 0, Qt::AlignVCenter);
|
||||
root->addLayout(header);
|
||||
|
||||
m_insightLabel = new ElaText(this);
|
||||
m_insightLabel->setTextPixelSize(11);
|
||||
m_insightLabel->setTextStyle(ElaTextType::Caption);
|
||||
m_insightLabel->setWordWrap(true);
|
||||
m_insightLabel->setVisible(false);
|
||||
root->addWidget(m_insightLabel);
|
||||
|
||||
m_scrollArea = new ElaScrollArea(this);
|
||||
m_scrollArea->setWidgetResizable(true);
|
||||
m_scrollArea->setFrameShape(QFrame::NoFrame);
|
||||
@@ -59,9 +75,23 @@ TodayPanel::TodayPanel(QWidget* parent)
|
||||
void TodayPanel::setTokens(const ThemeTokens& tokens)
|
||||
{
|
||||
m_tokens = tokens;
|
||||
if (m_insightLabel)
|
||||
{
|
||||
m_insightLabel->setStyleSheet(QStringLiteral("color:%1;").arg(tokens.accent.name()));
|
||||
}
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void TodayPanel::setInsightText(const QString& text)
|
||||
{
|
||||
if (!m_insightLabel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_insightLabel->setText(text);
|
||||
m_insightLabel->setVisible(!text.trimmed().isEmpty());
|
||||
}
|
||||
|
||||
void TodayPanel::setDate(const QDate& date)
|
||||
{
|
||||
if (!m_titleLabel)
|
||||
|
||||
Reference in New Issue
Block a user