feat: show acks on particles

This commit is contained in:
talksik
2026-02-06 15:06:11 -08:00
parent fefba20571
commit 01529e8d14
3 changed files with 56 additions and 0 deletions
+32
View File
@@ -115,11 +115,29 @@ MainWindow::MainWindow(QWidget *parent)
connect(m_authManager, &AuthManager::signedOut, m_authDialog, &AuthDialog::reset);
connect(m_authManager, &AuthManager::signedOut, m_authDialog, &AuthDialog::show);
connect(m_authManager, &AuthManager::signedIn, this, [this]() {
m_store->setCurrentUserEmail(m_authManager->sessionData()->email);
m_store->loadStartupData();
});
connect(m_store, &Store::startupDataLoaded, this, [this]() {
ui->topLevelParticlesView->expandAll();
});
connect(m_store, &Store::particleUpdated, this, [this](const QString &, const QString &particleId) {
if (particleId == m_selectedParticleId)
{
const Particle *particle = m_store->particleById(particleId);
if (particle && !particle->ackedByEmails.empty())
{
QStringList acked;
for (const auto &email : particle->ackedByEmails)
acked.append(email);
ui->label_3->setText("Acked by: " + acked.join(", "));
}
else
{
ui->label_3->setText("");
}
}
});
// DocumentSend toolbar button opens text input dialog
connect(ui->toolButton_3, &QToolButton::clicked, this, &MainWindow::showTextInputDialog);
@@ -329,6 +347,7 @@ void MainWindow::onParticleSelectionChanged(const QItemSelection &selected, cons
{
ui->label->setText("");
ui->label_2->setText("");
ui->label_3->setText("");
m_selectedParticleId.clear();
m_selectedParticleRow = -1;
updateStatusBar();
@@ -352,6 +371,19 @@ void MainWindow::onParticleSelectionChanged(const QItemSelection &selected, cons
ui->label->setText("");
}
// Show ack info
if (!particle->ackedByEmails.empty())
{
QStringList acked;
for (const auto &email : particle->ackedByEmails)
acked.append(email);
ui->label_3->setText("Acked by: " + acked.join(", "));
}
else
{
ui->label_3->setText("");
}
// Mark seen on selection
if (!particle->seen)
{