mirror of
https://github.com/devonthesofa/obsidian-note-status.git
synced 2026-07-22 12:30:24 +00:00
chore: improve no notes with status found button
This commit is contained in:
parent
e84e86f82b
commit
ecc9629cb1
2 changed files with 52 additions and 6 deletions
36
styles.css
36
styles.css
|
|
@ -1309,4 +1309,40 @@
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 4px; /* Add margin to prevent overlap */
|
||||
}
|
||||
|
||||
.note-status-empty-message {
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.note-status-button-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.note-status-show-unassigned-button {
|
||||
background-color: var(--interactive-accent);
|
||||
color: var(--text-on-accent);
|
||||
padding: 8px 16px;
|
||||
border-radius: var(--radius-s, 4px);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: var(--font-ui-small);
|
||||
transition: all 0.2s var(--ease-out);
|
||||
box-shadow: var(--shadow-s);
|
||||
}
|
||||
|
||||
.note-status-show-unassigned-button:hover {
|
||||
background-color: var(--interactive-accent-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-m);
|
||||
}
|
||||
|
||||
.note-status-show-unassigned-button:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: var(--shadow-xs);
|
||||
}
|
||||
|
|
@ -200,12 +200,24 @@ export class StatusPaneView extends View {
|
|||
if (searchQuery) {
|
||||
emptyMessage.textContent = `No notes found matching "${searchQuery}"`;
|
||||
} else if (this.settings.excludeUnknownStatus) {
|
||||
emptyMessage.textContent = 'No notes with status found. Unassigned notes are currently hidden.';
|
||||
// Clear any existing content and use a structured layout
|
||||
emptyMessage.empty();
|
||||
|
||||
// Add a button to show unknown status
|
||||
const showUnknownBtn = emptyMessage.createEl('button', {
|
||||
// Add message text in its own container
|
||||
emptyMessage.createDiv({
|
||||
text: 'No notes with status found. Unassigned notes are currently hidden.',
|
||||
cls: 'note-status-empty-message'
|
||||
});
|
||||
|
||||
// Create separate container for the button
|
||||
const btnContainer = emptyMessage.createDiv({
|
||||
cls: 'note-status-button-container'
|
||||
});
|
||||
|
||||
// Add a styled button in its own container
|
||||
const showUnknownBtn = btnContainer.createEl('button', {
|
||||
text: 'Show unassigned notes',
|
||||
cls: 'note-status-action-button'
|
||||
cls: 'note-status-show-unassigned-button'
|
||||
});
|
||||
|
||||
showUnknownBtn.addEventListener('click', async () => {
|
||||
|
|
@ -213,8 +225,6 @@ export class StatusPaneView extends View {
|
|||
await this.plugin.saveSettings();
|
||||
this.renderGroups(searchQuery);
|
||||
});
|
||||
} else {
|
||||
emptyMessage.textContent = 'No notes found';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue