fix: explicit tag scanning with delete UI
- Remove auto-parsing on collapse - Add "Scan for #tags" button that parses from current textarea content - Always show tags section with delete buttons - Show help text when no tags exist Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -296,6 +296,7 @@ export const actions: Actions = {
|
||||
parseTags: async ({ request }) => {
|
||||
const formData = await request.formData();
|
||||
const id = formData.get('id')?.toString();
|
||||
const content = formData.get('content')?.toString();
|
||||
|
||||
if (!id) {
|
||||
return fail(400, { error: 'Entry ID is required' });
|
||||
@@ -306,8 +307,9 @@ export const actions: Actions = {
|
||||
return fail(404, { error: 'Entry not found' });
|
||||
}
|
||||
|
||||
// Parse hashtags from current content and merge with existing tags
|
||||
const newTags = parseHashtags(existing.content);
|
||||
// Parse hashtags from provided content (or fall back to database content)
|
||||
const textToParse = content ?? existing.content;
|
||||
const newTags = parseHashtags(textToParse);
|
||||
const existingTags = tagRepository.getByEntryId(id).map((t) => t.name.toLowerCase());
|
||||
const allTags = [...new Set([...existingTags, ...newTags])];
|
||||
tagRepository.updateEntryTags(id, allTags);
|
||||
|
||||
Reference in New Issue
Block a user