refactor(angular): deduplicate services/components — misc shrinks - #692
Merged
Merged
Conversation
- config.ts: single DEFAULT_CONFIG literal. - CollectionService base for IntegrationsService/PathPairsService. - View-file filter: predicate functions instead of criteria classes. - settings-page: applyDisableRules moved to options-list; one rebuild path; OPTIONS map for the template; notification test parameterized by channel. - DoubleClickConfirm helper replaces four copies of the confirm state. - LoggerService reduced to console bindings; logs-page tracks by identity. - ROUTES derived from ROUTE_INFOS; mapState collapsed; enum lookups via keyof; server-status factory; ArrInstanceCreate = Omit; shared TestResult + failureFromHttpError; header rule level as field; inline URL templates; Localization as const object; fetchHistory param loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nitrobass24
force-pushed
the
refactor/angular-dedup
branch
from
August 24, 2026 22:45
32d9c5d to
bf0fc6e
Compare
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (35)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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.
Closes #676. Part of #682. No user-visible behavior change. Net 542 insertions / 908 deletions, 35 files.
Applied
DEFAULT_*section constsDEFAULT_CONFIGliteral (no other consumers).IntegrationsService/PathPairsServiceCollectionService<T>base (services/settings/collection.service.ts) withrefresh/createItem/updateItem/removeItem; both services are thin typed wrappers. The one real difference — PathPairs clears to[]on a failed refresh, Integrations keeps the last list — is a ctor flag. CLAUDE.md's reference-implementation pointer updated.ViewFileFilterCriteriais now(f: ViewFile) => boolean;Andis&&. Specs adjusted from{meetsCriteria}literals to plain predicates.applyDisableRulesis an exported pure function inoptions-list.ts(specs import it directly — no more statics cast); onerebuildContexts()with the full active-flag set; 8 template aliases →OPTIONSmap;OVERRIDE_NOTEfield removed.common/double-click-confirm.ts(DoubleClickConfirm<K>) replaces the copies infile,bulk-action-bar,path-pairs, andintegrations(a 4th copy the issue didn't list). Components keepconfirmingDelete/confirmingDeleteIdas getters so templates and specs are untouched.onExpire→cdr.markForCheck()per the OnPush rule.testDiscord/testTelegramNotificationsService.test(channel); settings-page hastesting/resultsrecords and oneonTest; template loopsNOTIFICATION_CHANNELS. SharedTestResult+failureFromHttpError(services/utils/test-result.ts) also used byIntegrationsService.test.LoggerServiceconsolespies still work).ROUTESROUTE_INFOS.mapStateObject.valuesguard so the "unknown state → DEFAULT" spec still holds.STATE_LOOKUP/LEVEL_LOOKUPEnum[k as keyof typeof Enum] ?? DEFAULT.disconnectedStatus()factory,ArrInstanceCreate = Omit<…>, shared result type,NotificationRule.levelfield, inline URL templates,Localizationconst object,fetchHistoryObject.entriesloop + deadbeforeparam removed.Skipped
isExtractable/isLocallyDeletableinto one flag: 18 spec sites constructViewFileliterals with both fields plus thefile.componenttemplate/API; the churn outweighs ~6 lines. Left as-is.Test plan
npx ng lintcleannpx ng test— 562 passednpx ng build --configuration production(bundle budget warning is pre-existing ondevelop)🤖 Generated with Claude Code