feat: Add arrow toggle functionality in WikiBrowser component
Implemented new features in the WikiBrowser component to allow users to toggle the visibility of arrows on graph edges. This includes: 1. **Localization Updates**: Added translations for "Show arrows" and "Hide arrows" in English, Korean, Russian, and Chinese. 2. **Graph Rendering Enhancements**: Introduced logic to dynamically update SVG line attributes based on the toggle state, improving visual clarity in graph representations. 3. **State Management**: Added reactive state management for arrow visibility, ensuring seamless user interaction. These changes enhance the user experience by providing more control over graph visualizations.
This commit is contained in:
@@ -87,7 +87,7 @@ func (s *wikiPageService) UpdatePage(ctx context.Context, page *types.WikiPage)
|
||||
|
||||
oldOutLinks := existing.OutLinks
|
||||
|
||||
// Update fields
|
||||
// Update fields (version is incremented by the repository's optimistic lock)
|
||||
existing.Title = page.Title
|
||||
existing.Content = page.Content
|
||||
existing.Summary = page.Summary
|
||||
@@ -95,7 +95,6 @@ func (s *wikiPageService) UpdatePage(ctx context.Context, page *types.WikiPage)
|
||||
existing.SourceRefs = page.SourceRefs
|
||||
existing.PageMetadata = page.PageMetadata
|
||||
existing.Status = page.Status
|
||||
existing.Version++
|
||||
existing.UpdatedAt = time.Now()
|
||||
|
||||
// Re-parse outbound links
|
||||
@@ -117,6 +116,12 @@ func (s *wikiPageService) UpdatePage(ctx context.Context, page *types.WikiPage)
|
||||
return existing, nil
|
||||
}
|
||||
|
||||
// UpdatePageMeta updates only metadata (status, source_refs) without version bump or link re-parse.
|
||||
func (s *wikiPageService) UpdatePageMeta(ctx context.Context, page *types.WikiPage) error {
|
||||
page.UpdatedAt = time.Now()
|
||||
return s.repo.UpdateMeta(ctx, page)
|
||||
}
|
||||
|
||||
// GetPageBySlug retrieves a wiki page by its slug
|
||||
func (s *wikiPageService) GetPageBySlug(ctx context.Context, kbID string, slug string) (*types.WikiPage, error) {
|
||||
return s.repo.GetBySlug(ctx, kbID, slug)
|
||||
@@ -325,10 +330,10 @@ func (s *wikiPageService) RebuildLinks(ctx context.Context, kbID string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Save all pages
|
||||
// Save all pages (link rebuild is metadata-only, no version bump)
|
||||
for _, p := range pages {
|
||||
p.UpdatedAt = time.Now()
|
||||
if err := s.repo.Update(ctx, p); err != nil {
|
||||
if err := s.repo.UpdateMeta(ctx, p); err != nil {
|
||||
logger.Warnf(ctx, "wiki: failed to update links for page %s: %v", p.Slug, err)
|
||||
}
|
||||
}
|
||||
@@ -383,7 +388,7 @@ func (s *wikiPageService) updateInLinks(ctx context.Context, kbID string, source
|
||||
if !containsString(targetPage.InLinks, sourceSlug) {
|
||||
targetPage.InLinks = append(targetPage.InLinks, sourceSlug)
|
||||
targetPage.UpdatedAt = time.Now()
|
||||
if err := s.repo.Update(ctx, targetPage); err != nil {
|
||||
if err := s.repo.UpdateMeta(ctx, targetPage); err != nil {
|
||||
logger.Warnf(ctx, "wiki: failed to update in_links for %s: %v", targetSlug, err)
|
||||
}
|
||||
}
|
||||
@@ -401,7 +406,7 @@ func (s *wikiPageService) removeInLinks(ctx context.Context, kbID string, source
|
||||
if len(newInLinks) != len(targetPage.InLinks) {
|
||||
targetPage.InLinks = newInLinks
|
||||
targetPage.UpdatedAt = time.Now()
|
||||
if err := s.repo.Update(ctx, targetPage); err != nil {
|
||||
if err := s.repo.UpdateMeta(ctx, targetPage); err != nil {
|
||||
logger.Warnf(ctx, "wiki: failed to update in_links for %s: %v", targetSlug, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user