feat(ext/popup): add "View history" link to login detail view
Shows button when item.field_history is non-empty. Navigates to field-history screen with historyItemId set. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,7 @@ export async function renderDetail(app: HTMLElement, item: Item): Promise<void>
|
||||
${renderAttachmentsDisclosure({ itemId: item.id, attachments: item.attachments, mode: 'view' })}
|
||||
<div class="form-actions" style="margin-top:14px;">
|
||||
<button class="btn" id="back-btn">back</button>
|
||||
${Object.keys(item.field_history).length > 0 ? '<button class="btn" id="history-btn">view history</button>' : ''}
|
||||
<button class="btn" id="edit-btn">edit</button>
|
||||
<button class="btn" id="fill-btn">autofill</button>
|
||||
<button class="btn danger" id="trash-btn">trash</button>
|
||||
@@ -91,6 +92,10 @@ export async function renderDetail(app: HTMLElement, item: Item): Promise<void>
|
||||
teardown();
|
||||
navigate('list');
|
||||
});
|
||||
document.getElementById('history-btn')?.addEventListener('click', () => {
|
||||
setState({ historyItemId: item.id });
|
||||
navigate('field-history');
|
||||
});
|
||||
document.getElementById('edit-btn')?.addEventListener('click', () => {
|
||||
teardown();
|
||||
navigate('edit');
|
||||
|
||||
Reference in New Issue
Block a user