Skip to content

fix: Add props to alias query#64

Open
MillironX wants to merge 1 commit intoyoyurec:mainfrom
MillironX:fix/alias-search
Open

fix: Add props to alias query#64
MillironX wants to merge 1 commit intoyoyurec:mainfrom
MillironX:fix/alias-search

Conversation

@MillironX
Copy link
Copy Markdown

May fix #11

There is an edge case where the page that aliases point to was created after the page with the name of the alias, giving the alias pointer page a lower number and therefore selected first in queries.

An easy way (but not foolproof) way to reproduce this problem would be to create a page in the plural (e.g. [[people]]), then decide to make a singular page as the main page (e.g. [[person]] with alias:: people). Any other sort of renaming or reassigning could lead to this edge case, too.

This fix works by assuming that only the page that all other aliases point to contains any properties. By querying for the mere presence of properties, we can deduce which page all the others are aliases of.

Examples

v1.15.16 This PR
species card pre image species card post image
cattle pre image cattle post image

There is an edge case where the page that aliases point to was created
_after_ the page with the name of the alias, giving the alias pointer page
a lower number and therefore selected first in queries.

An easy way (but not foolproof) way to reproduce this problem would be to
create a page in the plural (e.g. `[[people]]`), then decide to make
a singular page as the main page (e.g. `[[person]]` with
`alias:: people`). Any other sort of renaming or reassigning could lead to
this edge case, too.

Previously, this query worked by assuming that the first page created would
have all other pages be aliased to it later.

This fix works by assuming that _only_ the page that all other aliases
point to contains any properties. By querying for the mere presence of
properties, we can deduce which page all the others are aliases of.
@Amolith
Copy link
Copy Markdown

Amolith commented Dec 2, 2024

I don't think it fixes #11, but I could be testing it wrong.

I'm on 98d227a, ran pnpm install, pnpm run build, clicked the button to Load unpacked extension, and pointed it at this repo. I created Main, added the icon, aliased it to alias, then created the other two pages.

image

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.

Bugs: Hierarchy coloring and inheritance from an aliased page

2 participants