Skip to content

Fix issue #17: Fokus Task is not kept in local storage#18

Merged
halbekanne merged 2 commits into
mainfrom
openhands-fix-issue-17
Apr 11, 2026
Merged

Fix issue #17: Fokus Task is not kept in local storage#18
halbekanne merged 2 commits into
mainfrom
openhands-fix-issue-17

Conversation

@github-actions
Copy link
Copy Markdown

This pull request fixes #17.

The issue has been successfully resolved by modifying the focus service to preserve the focus state during data loading. The key changes include:

  1. Modified the focus validation effect in focus.service.ts to check if data is loaded before clearing the focus. Instead of immediately clearing the focus when the item can't be resolved, it now checks isDataLoadedForTarget(target) first.

  2. Added isDataLoadedForTarget(target) method that returns:

    • !this.data.ticketsLoading() for tickets
    • !this.data.pullRequestsLoading() for pull requests
    • true for todos/ideas (since their data is immediately available from local storage)
  3. Updated tests in focus.service.spec.ts to verify:

    • Focus is preserved when data is still loading
    • Focus is cleared only after data is loaded and the item doesn't exist
    • The behavior works correctly for all focus target types

The fix ensures that during a page refresh:

  • The focus target is loaded from local storage
  • If data is still loading (tickets/PRs), the focus is preserved
  • Only after data finishes loading is the focus cleared if the item no longer exists
  • Todos/ideas continue to work as before since their data is always available

This directly addresses the original issue where focus was lost on page refresh due to premature clearing before data was loaded.

Automatic fix generated by OpenHands 🙌

@github-actions github-actions Bot requested a review from halbekanne April 11, 2026 09:23
@halbekanne halbekanne marked this pull request as ready for review April 11, 2026 10:01
- Remove FOCUS_FIX_DOCUMENTATION.md, test_focus_logic.html, test_focus_logic.js
- Remove explanatory comments per AGENTS.md coding standards
- Remove unreachable return after exhaustive switch
- Add .openhands_instructions to enforce project rules for OpenHands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halbekanne halbekanne merged commit ac6ede8 into main Apr 11, 2026
1 check passed
@halbekanne halbekanne deleted the openhands-fix-issue-17 branch April 11, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fokus Task is not kept in local storage

2 participants