Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add thread view tabs to Bluesky thread viewer #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking "Sign up for GitHub", you agree to our terms of service and privacy statement. We'll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to bottom
Merged
simonw merged 1 commit into main from claude/add-thread-view-tabs-01W4v6izpkugMZ4JWBKReVkn
Nov 27, 2025
Merged

Add thread view tabs to Bluesky thread viewer #117

simonw merged 1 commit into main from claude/add-thread-view-tabs-01W4v6izpkugMZ4JWBKReVkn
Nov 27, 2025

Conversation

Copy link
Owner

simonw commented Nov 26, 2025 *
edited
Loading

Add tabs to toggle between Thread View and Most Recent First:

  • Thread View shows posts nested by reply structure (original behavior)
  • Most Recent First shows all posts sorted chronologically with newest at top
  • Switching tabs reorders existing posts without making new API calls
  • In chronological view, replies show "in reply to username" link
  • Clicking reply link scrolls to parent post with highlight animation

Add tabs at the top of the Bluesky thread viewer for toggling between thread order and most recent first

The toggle should not make another API call, it should just change the display of what has already been loaded

In most recent first, the most recent post are at the very top, ordered chronologically from there down

Any that is a reply as a little "in reply to username" blank, which, when clicked, will jump down the page to the thing it is replying to using a fragment #link

Add tabs to toggle between Thread View and Most Recent First:
- Thread View shows posts nested by reply structure (original behavior)
- Most Recent First shows all posts sorted chronologically with newest at top
- Switching tabs reorders existing posts without making new API calls
- In chronological view, replies show "in reply to username" link
- Clicking reply link scrolls to parent post with highlight animation
Copy link
Contributor

claude bot commented Nov 26, 2025 *
edited
Loading

Claude finished @simonw's task ---- View job


PR Review: Thread View Tabs Feature

Review Tasks:

  • Read repository guidelines (CLAUDE.md) - No repo guidelines found
  • Analyze modified bluesky-thread.html file
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Assess performance considerations
  • Review security concerns
  • Evaluate test coverage
  • Provide comprehensive feedback

Overall Assessment

This is a well-implemented feature that adds valuable functionality to the Bluesky thread viewer. The code is clean, follows good practices, and successfully implements the dual-view requirement without breaking existing functionality.

Code Quality & Best Practices

Strengths:

  • Clean separation of concerns: View logic is properly separated between displayThreadView() and displayPostsChronological()
  • Consistent coding style: Functions follow a clear naming pattern and structure
  • Good CSS organization: Uses CSS custom properties for depth colors and maintains responsive design
  • Accessible UI: Proper semantic HTML with keyboard support and focus management
  • Smooth UX: Includes nice touches like highlight animations and smooth scrolling

Minor Suggestions:

  • Consider extracting magic numbers into constants (e.g., Math.min(depth, 8) on line 237, highlight timeout 2000ms on line 282)
  • The allPosts array could benefit from JSDoc comments to document its structure

Potential Issues

Medium Priority:

  • Memory efficiency: allPosts array duplicates data from lastThread - consider using references instead of full objects for better memory usage
  • URL parsing robustness: The URL parsing logic (lines 381-387) could be more resilient to edge cases

Low Priority:

  • Potential race condition: If users rapidly switch tabs during initial load, the view state might become inconsistent
  • Error handling: Copy operations could fail silently in some browsers without clipboard API support

Performance Considerations

Good:

  • No unnecessary API calls: Switching views reuses existing data as specified
  • Efficient DOM manipulation: Views are rebuilt rather than incrementally updated (appropriate for this use case)
  • Minimal CSS reflows: Good use of CSS transitions

Potential Optimizations:

  • For very large threads (1000+ posts), consider virtualizing the chronological view
  • The flattening operation (flattenThread() line 196) could be memoized if switching views frequently

Security Considerations

Secure:

  • XSS protection: All user content is properly escaped using textContent rather than innerHTML
  • Safe URL handling: External links properly set target="_blank" and navigate to expected domains
  • Input validation: URL validation ensures only bsky.app URLs are processed

No security concerns identified.

Test Coverage

Current State:

  • This is a standalone HTML file with embedded JavaScript
  • No automated tests present (typical for this type of tool)

Recommendations:

  • Consider adding basic unit tests for key functions like flattenThread() and URL parsing
  • Manual testing checklist should include:
    • Large threads (100+ posts)
    • Threads with deep nesting (8+ levels)
    • Edge cases like deleted posts or network failures
    • Mobile viewport testing

Implementation Quality

Excellent implementation of requirements:

  • Tabs toggle between Thread View and Most Recent First
  • Thread View maintains nested reply structure
  • Most Recent First shows chronological order
  • No additional API calls when switching views
  • "In reply to" links with smooth scrolling and highlight animation

Code locations:

  • Tab switching logic: bluesky-thread.html:326-336
  • View rendering: bluesky-thread.html:317-323
  • Reply linking: bluesky-thread.html:276-284

Final Recommendation

APPROVE - This is a solid implementation that successfully delivers the requested feature with good code quality and user experience. The minor suggestions above are for future enhancement rather than blocking issues.


Copy link

cloudflare-workers-and-pages bot commented Nov 26, 2025

Deploying tools with Cloudflare Pages

Latest commit: 27662b7
Status: Deploy successful!
Preview URL: https://1b6c21a2.tools-b1q.pages.dev
Branch Preview URL: https://claude-add-thread-view-tabs.tools-b1q.pages.dev

View logs

Copy link
Owner Author

simonw commented Nov 27, 2025

Works great in preview.

simonw merged commit d5225ef into main Nov 27, 2025
3 of 4 checks passed
simonw deleted the claude/add-thread-view-tabs-01W4v6izpkugMZ4JWBKReVkn branch November 27, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants