- 
                Notifications
    You must be signed in to change notification settings 
- Fork 363
Setting to collapse top-level replies by default #4821
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
          
     Open
      
      
            tessalt
  wants to merge
  10
  commits into
  develop
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
hide-replies-setting
  
      
      
   
  
    
  
  
  
 
  
      
    base: develop
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4b58013
              
                default collapsed comments
              
              
                tessalt 6e3de6b
              
                make new replies render un-collapsed
              
              
                tessalt c8d429d
              
                fix browserlist
              
              
                tessalt dd4afc2
              
                make collapsereplies a setting
              
              
                tessalt e528dc3
              
                add admin ui
              
              
                tessalt 584e2ad
              
                add style hooks
              
              
                tessalt 17fcc81
              
                fix tests
              
              
                tessalt 1166444
              
                maintain expanded/collapsed state while scrolling
              
              
                tessalt 18ebf8e
              
                simplify collapsable comment params
              
              
                tessalt bd1936d
              
                reorder imports
              
              
                tessalt File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
          
            50 changes: 50 additions & 0 deletions
          
          50 
        
  client/src/core/client/admin/routes/Configure/sections/General/CollapseRepliesConfig.tsx
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import { Localized } from "@fluent/react/compat"; | ||
| import React, { FunctionComponent } from "react"; | ||
| import { graphql } from "react-relay"; | ||
|  | ||
| import { | ||
| FieldSet, | ||
| FormField, | ||
| FormFieldDescription, | ||
| Label, | ||
| } from "coral-ui/components/v2"; | ||
|  | ||
| import ConfigBox from "../../ConfigBox"; | ||
| import Header from "../../Header"; | ||
| import OnOffField from "../../OnOffField"; | ||
|  | ||
| // eslint-disable-next-line no-unused-expressions | ||
| graphql` | ||
| fragment CollapseRepliesConfig_formValues on Settings { | ||
| collapseReplies | ||
| } | ||
| `; | ||
|  | ||
| interface Props { | ||
| disabled: boolean; | ||
| } | ||
|  | ||
| const CollapseRepliesConfig: FunctionComponent<Props> = ({ disabled }) => ( | ||
| <ConfigBox | ||
| title={ | ||
| <Localized id="configure-general-collapseReplies-title"> | ||
| <Header container="h2">Collapse replies</Header> | ||
| </Localized> | ||
| } | ||
| > | ||
| <Localized id="configure-general-collapseReplies-explanation"> | ||
| <FormFieldDescription> | ||
| When enabled, top-level replies to comments will be collapsed by | ||
| default. | ||
| </FormFieldDescription> | ||
| </Localized> | ||
| <FormField container={<FieldSet />}> | ||
| <Localized id="configure-general-collapseReplies-enabled"> | ||
| <Label component="legend">Collapse replies enabled</Label> | ||
| </Localized> | ||
| <OnOffField name="collapseReplies" disabled={disabled} /> | ||
| </FormField> | ||
| </ConfigBox> | ||
| ); | ||
|  | ||
| export default CollapseRepliesConfig; | 
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check means that until a user reloads the stream, they cannot collapse their new reply. I'm not sure how often someone would want to do that, but the new comment does show an expand/collapse option still, so it could be a bit confusing that it won't collapse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah interesting. I'm not suuure I care but I'll play around with it for a few minutes. good catch.