You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stricklandrbls (via GitHub)" <gi...@apache.org> on 2023/09/06 22:37:46 UTC

[GitHub] [daffodil-vscode] stricklandrbls opened a new pull request, #838: Implementing Help Component

stricklandrbls opened a new pull request, #838:
URL: https://github.com/apache/daffodil-vscode/pull/838

   - Fixed issue where the editor edit instructions were difficult to read on smaller width/height windows.
   - Implemented new `Help` layout for larger/enhanced `Tooltip` implementations.
   
   Closes #823


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Implementing Help Component [daffodil-vscode]

Posted by "stricklandrbls (via GitHub)" <gi...@apache.org>.
stricklandrbls commented on PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#issuecomment-1756619535

   I'll need to test this with the recently merged viewport displays CSS changes to ensure that this still functions as intended.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #838: Implementing Help Component

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#discussion_r1323471775


##########
src/svelte/src/components/dataEditor.svelte:
##########
@@ -319,6 +320,7 @@ limitations under the License.
     on:seek={seekEventHandler}
   />
 
+  <Help />

Review Comment:
   Would be cool if the desired help text could be bound into a generic Help component. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Implementing Help Component [daffodil-vscode]

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#issuecomment-1758117173

   This PR is from a branch pushed in the main `daffodil-vscode` repo. We try to avoid added new branches since it adds adds alot of extra emails. Instead, please push branches to your fork and open PRs from that.
   
   Also, it might be a good idea to set something like this in your "asf" remote in the daffodil-vscode `.git/config`:
   
   ```gitconfig
   [remote "asf"]
   	url = git@github.com:apache/daffodil.git
   	pushurl = do not push to asf
   ```
   
   This way you can't accidentally push to the asf remote at all since the "pushurl" isn't a valid URL. It's a bit of a hack, but there's no other way do this in git that I know of.
   
   And if you ever do need to push to asf, you can always manually do it like:
   
   ```bash
   git push git@github.com:apache/daffodil.git ...
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Implementing Help Component [daffodil-vscode]

Posted by "stricklandrbls (via GitHub)" <gi...@apache.org>.
stricklandrbls commented on PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#issuecomment-1758129935

   @stevedlawrence I just realized that this had happened as I was rebasing and pushing changes from the current `main` branch. 
   
   If I remember correctly I tried to use the GitHub feature for creating a branch that automatically is linked to an issue but it must have kept the apache repository as it's base. I typically use the CLI and now will continue to do so to avoid this happening again. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Implementing Help Component [daffodil-vscode]

Posted by "stricklandrbls (via GitHub)" <gi...@apache.org>.
stricklandrbls merged PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] stricklandrbls commented on a diff in pull request #838: Implementing Help Component

Posted by "stricklandrbls (via GitHub)" <gi...@apache.org>.
stricklandrbls commented on code in PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#discussion_r1323517064


##########
src/svelte/src/components/dataEditor.svelte:
##########
@@ -319,6 +320,7 @@ limitations under the License.
     on:seek={seekEventHandler}
   />
 
+  <Help />

Review Comment:
   The `Help` component is "generic" but only displays content from available `HelpInformation` types that are defined in the `AvailableHelpSections`. 
   
   This component uses the contents of the `currentHelpSectionDisplayed` store to determine what is displayed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #838: Implementing Help Component

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#discussion_r1323470603


##########
src/svelte/src/components/layouts/Help.ts:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+type DescriptionBody = Array<string>
+
+type HelpInformation = {
+  title: string
+  sectionId: AvailableHelpSections
+  descriptionBody: DescriptionBody
+}
+
+export const HelpDialogWidth = 300
+export const HelpDialogHeight = 350
+export const HelpDialogBorderWidth = 2
+export const HelpDialogLeftOffset = HelpDialogWidth + HelpDialogBorderWidth
+export const HelpDialogTopOffset = HelpDialogHeight + HelpDialogBorderWidth
+
+const EditInstructionsHelp: HelpInformation = {
+  title: 'Edit Modes',
+  sectionId: 'edit-instructions',
+  descriptionBody: [
+    '<h3>Multiple Byte Edits</h3>',
+    "To edit multiple bytes, highlight, by clicking and dragging over, a selection of bytes in either the physical or logical viewports. This will populate the \
+    'Edit' panel with the data to edit.",
+    '<h3>Single Byte Edits</h3>',
+    'To edit a single byte, simply click any singular byte within either of the viewports. This is replace the content with an input field to perform edits.',
+  ],
+}

Review Comment:
   Why not export this and allow it to be externally configurable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] stricklandrbls commented on a diff in pull request #838: Implementing Help Component

Posted by "stricklandrbls (via GitHub)" <gi...@apache.org>.
stricklandrbls commented on code in PR #838:
URL: https://github.com/apache/daffodil-vscode/pull/838#discussion_r1323514299


##########
src/svelte/src/components/layouts/Help.ts:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+type DescriptionBody = Array<string>
+
+type HelpInformation = {
+  title: string
+  sectionId: AvailableHelpSections
+  descriptionBody: DescriptionBody
+}
+
+export const HelpDialogWidth = 300
+export const HelpDialogHeight = 350
+export const HelpDialogBorderWidth = 2
+export const HelpDialogLeftOffset = HelpDialogWidth + HelpDialogBorderWidth
+export const HelpDialogTopOffset = HelpDialogHeight + HelpDialogBorderWidth
+
+const EditInstructionsHelp: HelpInformation = {
+  title: 'Edit Modes',
+  sectionId: 'edit-instructions',
+  descriptionBody: [
+    '<h3>Multiple Byte Edits</h3>',
+    "To edit multiple bytes, highlight, by clicking and dragging over, a selection of bytes in either the physical or logical viewports. This will populate the \
+    'Edit' panel with the data to edit.",
+    '<h3>Single Byte Edits</h3>',
+    'To edit a single byte, simply click any singular byte within either of the viewports. This is replace the content with an input field to perform edits.',
+  ],
+}

Review Comment:
   I figured that instructional information would be pretty concrete so when a developer needs to add a different category for help information then it can be hard coded here.
   
   I didn't see any reason to make it visible outside of this file and using the `AvailableHelpSections` type & object for external use that only allows defined `HelpInformation` objects as an index.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org