Skip to content

Commit

Permalink
* Some cleanup of unused node details panels. ("discussion" and "soci…
Browse files Browse the repository at this point in the history
…al"; not worth keeping them there if they have no implementation; will just add them from scratch when implemented)
  • Loading branch information
Venryx committed May 9, 2024
1 parent 1ea4583 commit 802960b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ import {nodeDetailBoxesLayer_container} from "./NodeDetailBoxesLayer.js";
import {NodeUI_LeftBox_width} from "./NodeUI_LeftBox.js";
import {DefinitionsPanel} from "./Panels/DefinitionsPanel.js";
import {DetailsPanel} from "./Panels/DetailsPanel.js";
import {DiscussionPanel} from "./Panels/DiscussionPanel.js";
import {HistoryPanel} from "./Panels/HistoryPanel.js";
import {OthersPanel} from "./Panels/OthersPanel.js";
import {PhrasingsPanel} from "./Panels/PhrasingsPanel.js";
import {RatingsPanel} from "./Panels/RatingsPanel.js";
import {SocialPanel} from "./Panels/SocialPanel.js";
import {TagsPanel} from "./Panels/TagsPanel.js";

//export const nodeBottomPanel_minWidth = 550;
Expand Down Expand Up @@ -148,8 +146,6 @@ export class NodeUI_BottomPanel extends BaseComponentPlus(
RunInAction("NodeBox_onClickTerm", ()=>nodeView.openTermIDs = termIDs);
}}/>)}
{renderPanel("phrasings", show=><PhrasingsPanel {...{show, map, node, path}}/>)}
{renderPanel("discussion", show=><DiscussionPanel {...{show}}/>)}
{renderPanel("social", show=><SocialPanel {...{show}}/>)}
{renderPanel("tags", show=><TagsPanel {...{show, map, node, path}}/>)}
{renderPanel("details", show=><DetailsPanel {...{show, map, node, path}}/>)}
{renderPanel("history", show=><HistoryPanel {...{show, map, node, path}}/>)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,15 @@ export class NodeUI_LeftBox extends BaseComponentPlus({panelsPosition: "left"} a
usePortal, nodeUI,
onHoverChange,
} = this.props;
/*const nodeView = GetNodeView(map?.id, path);
const openPanel = local_nodeView?.openPanel || nodeView?.openPanel;*/
const nodeView = local_nodeView ?? GetNodeView(map?.id, path);
const openPanel = nodeView?.openPanel;

const form = GetNodeForm(node, path);
const parentNode = GetParentNodeL3(path);

const nodeReversed = form == ClaimForm.negation;
const nodeTypeInfo = NodeType_Info.for[node.type];

const ratingTypes = GetRatingTypesForNode(node);

if (usePortal) {
/*UseEffect(()=>{
const timer = new Timer(1000 / 60, ()=>{
if (uiRoot == null || nodeUI.root?.DOM == null) return;
const nodeUIRect = nodeUI.root.DOM.getBoundingClientRect();
uiRoot.style.left = `${nodeUIRect.left - 110}px`;
uiRoot.style.top = `${nodeUIRect.top}px`;
}).Start();
return ()=>timer.Stop();
});*/
UseEffect(()=>{
let stop = false;
requestAnimationFrame(update);
Expand Down Expand Up @@ -124,15 +110,10 @@ export class NodeUI_LeftBox extends BaseComponentPlus({panelsPosition: "left"} a
<div style={{
position: "relative", borderRadius: 5, boxShadow: "rgba(0,0,0,1) 0px 0px 2px",
background: backgroundColor.alpha(0.95).css(),
//background: liveSkin.BasePanelBackgroundColor().alpha(.9).css(),
}}>
{ratingTypes.map((ratingInfo, index)=>{
const ratingTypeInfo = GetRatingTypeInfo(ratingInfo.type, node, parentNode, path);
//let ratingSet = ratingsRoot && ratingsRoot[ratingType];

let percentStr = "...";
/*const ratings = GetRatings(nodeForRatingType.id, ratingInfo.type);
const average = GetRatingAverage_AtPath(nodeForRatingType, ratingInfo.type, null, -1);*/
const ratingSummary = GetRatingSummary(node.id, ratingInfo.type);
if (ratingSummary.average != null) {
percentStr = `${ratingSummary.average.RoundTo(1)}%`;
Expand All @@ -150,7 +131,6 @@ export class NodeUI_LeftBox extends BaseComponentPlus({panelsPosition: "left"} a
<Span ml={5} style={{float: "right"}}>
{percentStr}
<sup style={{whiteSpace: "pre", top: -5, marginRight: -3, marginLeft: 1, fontSize: 10}}>
{/* ratingSet ? ratingSet.VKeys().length /*- 1*#/ : 0 */}
{(ratingSummary?.countsByRange ?? []).Sum()}
</sup>
</Span>
Expand All @@ -168,17 +148,13 @@ export class NodeUI_LeftBox extends BaseComponentPlus({panelsPosition: "left"} a
<div style={{
position: "relative", marginTop: 1, borderRadius: 5, boxShadow: "rgba(0,0,0,1) 0px 0px 2px",
background: backgroundColor.alpha(0.95).css(),
//background: liveSkin.BasePanelBackgroundColor().alpha(.9).css(),
}}>
<div style={{
position: "absolute", left: 0, right: 0, top: 0, bottom: 0, borderRadius: 5,
background: backgroundColor.alpha(0.7).css(),
//background: liveSkin.BasePanelBackgroundColor().alpha(.9).css(),
}}/>
{!SLMode_SFI && <PanelButton {...{onPanelButtonHover, onPanelButtonClick, map, path, openPanel}} panel="phrasings" text="Phrasings" style={{marginTop: 0, borderRadius: "5px 5px 0 0"}}/>}
{!SLMode_SFI && <PanelButton {...{onPanelButtonHover, onPanelButtonClick, map, path, openPanel}} panel="definitions" text="Definitions"/>}
{/* <PanelButton {...{ onPanelButtonHover, onPanelButtonClick, map, path, openPanel }} panel="discussion" text="Discussion"/>
<PanelButton {...{onPanelButtonHover, onPanelButtonClick, map, path, openPanel}} panel="social" text="Social"/> */}
<PanelButton {...{onPanelButtonHover, onPanelButtonClick, map, path, openPanel}} panel="details"
text={`Details${IsUserCreatorOrMod(MeID(), node) ? " (edit)" : ""}`}/>
{!SLMode_SFI && <PanelButton {...{onPanelButtonHover, onPanelButtonClick, map, path, openPanel}} panel="history" text="History"/>}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import {BaseComponentPlus, GetInnerComp} from "web-vcore/nm/react-vextensions.js
import {ScrollView} from "web-vcore/nm/react-vscrollview.js";
import {DefinitionsPanel} from "./DetailBoxes/Panels/DefinitionsPanel.js";
import {DetailsPanel} from "./DetailBoxes/Panels/DetailsPanel.js";
import {DiscussionPanel} from "./DetailBoxes/Panels/DiscussionPanel.js";
import {OthersPanel} from "./DetailBoxes/Panels/OthersPanel.js";
import {RatingsPanel} from "./DetailBoxes/Panels/RatingsPanel.js";
import {SocialPanel} from "./DetailBoxes/Panels/SocialPanel.js";
import {TagsPanel} from "./DetailBoxes/Panels/TagsPanel.js";
import {NodeBox} from "./NodeBox.js";

Expand Down Expand Up @@ -70,8 +68,6 @@ export class NodeUI_ForBots extends BaseComponentPlus({} as Props, {}) {
})}
{/*<PhrasingsPanel show={true} node={node} path={path}/>*/}
<DefinitionsPanel show={true} map={map} node={node} path={path}/>
<DiscussionPanel show={true}/>
<SocialPanel show={true}/>
<TagsPanel show={true} map={map} node={nodeL3} path={path}/>
<DetailsPanel show={true} map={map} node={nodeL3} path={path}/>
<OthersPanel show={true} map={map} node={nodeL3} path={path}/>
Expand Down

0 comments on commit 802960b

Please sign in to comment.