Skip to content

Move ThumbnailFactory and manifesto.js wrappers into selectors and hooks#4102

Merged
cbeer merged 3 commits intoProjectMirador:mainfrom
cul:selectors-for-wrappers-and-thumbnails
Feb 27, 2025
Merged

Move ThumbnailFactory and manifesto.js wrappers into selectors and hooks#4102
cbeer merged 3 commits intoProjectMirador:mainfrom
cul:selectors-for-wrappers-and-thumbnails

Conversation

@barmintor
Copy link
Collaborator

- prepare for auth2 service parsing changes
- prevent exposing wrapper constructor changes to wrappers to broad swathes of app
- stabilize empty object/array references for input selectors
- fixes ProjectMirador#4100
@barmintor
Copy link
Collaborator Author

@cbeer this is one way to address the issue of config references propagating everywhere if they're added to the MiradorCanvas constructor.

@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.09%. Comparing base (5f72533) to head (82dc6c0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4102      +/-   ##
==========================================
+ Coverage   95.07%   95.09%   +0.01%     
==========================================
  Files         317      322       +5     
  Lines       15973    16038      +65     
  Branches     2509     2521      +12     
==========================================
+ Hits        15187    15252      +65     
  Misses        782      782              
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

describe('getThumbnailFactory', () => {
const state = { config: miradorConfigSlice() };
const iiifOpts = {};
it('returns the manifest of a certain id', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "the manifest of a certain id" being returned in this test? It seems to expect ThumbnailFactory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Do you want to suggest a change here, or do you want me to push an additional commit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I can't suggest a change. Can you push a commit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

import { getCanvas, getVisibleCanvasIds } from './canvases';
import { miradorSlice } from './utils';
import { miradorSlice, EMPTY_ARRAY } from './utils';
import { getConfig } from './config';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConfig import is not used in this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's weird - why didn't the linter catch this?

@marlo-longley
Copy link
Member

Just a question @barmintor, does the "stabilize empty object/array references for input selectors" work you've done address the inputStabilityCheck warnings from Reselect ("The result function returned its own inputs without modification")?

@barmintor
Copy link
Collaborator Author

@marlo-longley it addresses some, but not all, of those warnings

@cbeer cbeer merged commit 9df7f1c into ProjectMirador:main Feb 27, 2025
4 of 7 checks 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.

Changes to manifesto.js wrapper constructors affect code in much of application

3 participants