Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix:#4558 Optimize Camera Feed for Mobile Usage #7363

Closed
wants to merge 33 commits into from

Conversation

bishwas-10
Copy link

Proposed Changes

before
image
after
image
image

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@bishwas-10 bishwas-10 requested a review from a team as a code owner March 8, 2024 14:43
Copy link

vercel bot commented Mar 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2024 0:53am

Copy link

netlify bot commented Mar 8, 2024

Deploy Preview for care-egov-staging failed.

Name Link
🔨 Latest commit d9f1321
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/661fe0e57dd5bc000898b65c

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Use aspect-ratio of tailwindcss instead of using js to handle this logic

https://tailwindcss.com/docs/aspect-ratio#setting-the-aspect-ratio

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

The page is overflowing to the right. Can we do something about it?

image

@rithviknishad
Copy link
Member

@bishwas-10
Copy link
Author

@rithviknishad
i have added overflow-hidden here will it be okay if it doesnt cause any error?
image

@rithviknishad
Copy link
Member

rithviknishad commented Mar 10, 2024

Can we also make the buttons of uniform height? The preset buttons looks broken with various when there are many presets

@bishwas-10
Copy link
Author

@rithviknishad these buttons?
image

@rithviknishad
Copy link
Member

the preset buttons

image

@bishwas-10
Copy link
Author

@rithviknishad where exactly is this page located
i am working here
image

@bishwas-10
Copy link
Author

@rithviknishad its says page not found

@rithviknishad
Copy link
Member

Use dev district admin credentials as mentioned in the readme

@rithviknishad
Copy link
Member

IMO this doesn't seem to be any better than before. We could have a select menu instead like how I've mentioned in #7363 (comment)

image

Comment on lines 410 to 485
<div className="flex flex-wrap items-center bg-gray-100">
<Popover className="relative">
<Popover.Button>
<ButtonV2 variant="secondary" border>
<CareIcon className="care-l-setting text-lg" />
Presets
</ButtonV2>
</Popover.Button>
<Transition
as={Fragment}
enter="transition ease-out duration-200"
enterFrom="opacity-0 translate-y-1"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in duration-150"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
{preset.meta.preset_name || `Preset ${index + 1}`}
</button>
))}
<Popover.Panel className="absolute z-30 mt-1 h-60 w-60 -translate-x-1/3 overflow-y-scroll px-4 sm:px-0 md:w-96 md:-translate-x-1/2 lg:max-w-3xl">
<div className="rounded-lg shadow-lg ring-1 ring-gray-400">
<div className="rounded-t-lg bg-gray-100 px-6 py-4">
<span className="block text-sm text-gray-800">
Camera(s) preset
</span>
</div>
<div className="flex flex-col">
{bedPresets?.map((preset: any, index: number) => (
<ButtonV2
key={preset.id}
variant={
currentPreset === preset ? "primary" : "secondary"
}
onClick={() => {
setLoading(CAMERA_STATES.MOVING.GENERIC);
// gotoBedPreset(preset);
absoluteMove(preset.meta.position, {
onSuccess: () => {
setLoading(CAMERA_STATES.IDLE);
setCurrentPreset(preset);
console.log(
"onSuccess: Set Preset to " +
preset?.meta?.preset_name
);
triggerGoal("Camera Preset Clicked", {
presetName: preset?.meta?.preset_name,
consultationId,
userId: authUser.id,
result: "success",
});
},
onError: () => {
setLoading(CAMERA_STATES.IDLE);
setCurrentPreset(preset);
console.log(
"onError: Set Preset to " +
preset?.meta?.preset_name
);
triggerGoal("Camera Preset Clicked", {
presetName: preset?.meta?.preset_name,
consultationId,
userId: authUser.id,
result: "error",
});
},
});
getCameraStatus({});
}}
className="w-full"
>
{preset.meta.preset_name || `Preset ${index + 1}`}
</ButtonV2>
))}
</div>
</div>
</Popover.Panel>
</Transition>
</Popover>
Copy link
Member

Choose a reason for hiding this comment

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

We already have a reusable component called SelectMenuFormField. Use that instead of duplicating the logic here...

Also, this does not look nice in desktop view...

image

@bishwas-10 bishwas-10 force-pushed the fix/mobileCameraView branch 2 times, most recently from 0a85cc1 to d9f1321 Compare April 17, 2024 14:46
@github-actions github-actions bot added merge conflict pull requests with merge conflict and removed merge conflict pull requests with merge conflict labels Apr 18, 2024
Copy link

👋 Hi, @bishwas-10,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@rithviknishad
Copy link
Member

Closing as stale + deploy failed not fixed + conflicts + solved in #7654

@bishwas-10 bishwas-10 deleted the fix/mobileCameraView branch July 18, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required Deploy-Failed Deplyment is not showing preview discussion required merge conflict pull requests with merge conflict needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize Camera Feed for Mobile Usage
5 participants