Skip to content

Refactor cache path and standardize layout storage keys#71

Merged
t0mdavid-m merged 1 commit into
developfrom
claude/vigilant-bell-QkHj9
May 26, 2026
Merged

Refactor cache path and standardize layout storage keys#71
t0mdavid-m merged 1 commit into
developfrom
claude/vigilant-bell-QkHj9

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Summary

This PR refactors the cache directory structure and standardizes the storage keys used for layout persistence in FLASHTnT, improving consistency and simplifying the file organization.

Key Changes

  • Cache path simplification: Changed cache directory from workspace/flashtnt/cache to workspace/cache, removing the redundant flashtnt subdirectory level
  • Storage key standardization: Renamed layout storage key from 'layout' to 'flashtnt_layout' across all file manager operations to:
    • Avoid potential key collisions in shared cache directories
    • Provide clearer namespace separation for FLASHTnT-specific data
    • Improve maintainability when multiple tools share the same workspace
  • Code cleanup: Fixed trailing whitespace in get_layout() return statement and removed trailing whitespace in FLASHTnTViewer.py

Files Modified

  • content/FLASHTnT/FLASHTnTLayoutManager.py: Updated cache path initialization and all layout storage/retrieval operations
  • content/FLASHTnT/FLASHTnTViewer.py: Updated layout retrieval to use new storage key

Implementation Details

All file manager calls (store_data, result_exists, get_results, remove_results) have been updated consistently to use the new 'flashtnt_layout' key, ensuring layout persistence continues to work correctly across the application.

https://claude.ai/code/session_01YTN6PkcSfg2b21zHL7cYGg

The FLASHTnT Layout Manager appeared to "save" layouts (success toast
and download button worked) but the Tagger Viewer never applied them.

Root cause: FLASHTnTLayoutManager built its FileManager against
`workspace/flashtnt/cache`, while FLASHTnTViewer read from
`workspace/cache`. The Layout Manager wrote to an orphan SQLite DB
that nobody read, so `result_exists('layout', 'layout')` in the Viewer
always returned False and it fell back to DEFAULT_LAYOUT. This is the
same class of bug fixed for FLASHDeconv in f107715; the analogous fix
was never propagated to FLASHTnT (added separately in #12).

Just realigning the path is unsafe: it would land FLASHTnT's layout
on the same SQLite row+pickle as FLASHDeconv's (`dataset_id='layout'`),
so one tool's save would overwrite the other's, and a Reset Setting
in one tool would call `remove_results('layout')` and wipe both. Move
FLASHTnT to a dedicated `dataset_id='flashtnt_layout'` so it gets a
distinct row (`stored_data` filters by `id`) and a distinct file
(`cache_path/files/flashtnt_layout/layout.pkl.gz`). FLASHDeconv keeps
its existing `'layout'` id so pre-existing user layouts survive.
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@t0mdavid-m, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 45 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60c23ecd-3634-4bcd-ac07-cee3970060c2

📥 Commits

Reviewing files that changed from the base of the PR and between 29e0882 and f48f658.

📒 Files selected for processing (2)
  • content/FLASHTnT/FLASHTnTLayoutManager.py
  • content/FLASHTnT/FLASHTnTViewer.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/vigilant-bell-QkHj9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@t0mdavid-m t0mdavid-m merged commit 3f031e7 into develop May 26, 2026
1 check passed
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.

2 participants