Make story filtering and ranking configurable - #22
Merged
Conversation
Create a settings module that allows users to configure story filtering, ranking, comment display, and caching behavior through the settings panel. Key changes: - New src/settings.ts with FilterSettings interface, defaults, validation ranges, and load/save/reset functions - Update api.ts to use settings instead of hardcoded constants for all filters - Update cache.ts to use configurable TTL - Update config.ts to persist filter settings - Update SettingsPanel to display filter settings with left/right arrow adjustment - Update app.ts to handle new settings actions (adjust_setting, reset_filters) Settings are organized into categories: - Story Filtering: maxPosts, hoursWindow, minPoints, minComments - Ranking: commentWeight, recencyBonusMax - Comments: maxRootComments, maxChildComments, maxCommentLevel - Advanced: fetchLimit, storiesTtlMinutes All settings have validation ranges to prevent invalid values.
brianlovin
force-pushed
the
claude/add-configurable-settings-Koml9
branch
from
January 26, 2026 15:50
cb75f2e to
49d3baf
Compare
Restructure settings panel to match the story detail view pattern: - Fixed "Settings" header at top with border - Scrollable content area for all settings items - Fixed shortcuts bar at bottom showing navigation hints This allows the settings panel to handle tall content gracefully when many filter settings are displayed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change "Settings" header to bold text-secondary - Move Telemetry section to bottom before actions - Add "(private and anonymous)" sublabel to telemetry toggle - Remove "Done" button in favor of save-on-close with Esc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Hide "Advanced" and "Ranking" sections (need more explanation) - Add subtitle descriptions under each setting in text-secondary - Arrow keys skip subtitle lines (non-selectable) - Updated descriptions to be clearer and more helpful Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documentation:
- Add comprehensive Settings section to README with tables for all options
- Add Settings System section to CLAUDE.md with interface, functions, and behavior
- Update keyboard shortcuts and architecture sections in both files
Code fixes:
- Fix import placement in settings.test.ts (move to top of file)
- Remove stale "done" action test (button was removed from UI)
- Remove unused currentCategoryKey variable in SettingsPanel.ts
- Fix scroll reset on every render (preserve scroll when adjusting settings)
- Fix maxPosts description ("display" not "fetch")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the HN CLI's story filtering, ranking, and comment display behavior fully configurable through an interactive settings panel. Previously, these parameters were hardcoded constants. Users can now adjust 10 different settings to customize how stories are filtered, ranked, and displayed.
Key Changes
New settings module (
src/settings.ts): Centralized configuration system with:Updated API layer (
src/api.ts):loadSettings()FilterSettingsparameter for dependency injectionEnhanced settings UI (
src/components/SettingsPanel.ts):App integration (
src/app.ts):handleSettingsActioncases foradjust_settingandreset_filtersConfig persistence (
src/config.ts):clearAllApiKeys()now preserves filter settings when clearingCache integration (
src/cache.ts):Configurable Settings
Story Filtering: Max stories, time window, minimum points/comments
Ranking: Comment weight in scoring, recency bonus magnitude
Comments: Root comment limit, child comment limit, nesting depth
Advanced: API fetch limit, cache TTL
All settings have sensible defaults matching the original briOS implementation.